export type TreeProjectionKind = "sidebar_tree" | "page_tree" | "file_tree";

export type TreeProjectionNodeType =
  | "workspace"
  | "folder"
  | "page"
  | "section"
  | "asset"
  | "mindmap"
  | "table"
  | "book"
  | "pdf"
  | "index";

export type TreeProjectionCapability =
  | "expand"
  | "open"
  | "drag"
  | "drop"
  | "select"
  | "create-child"
  | "rename"
  | "archive"
  | "restore"
  | "context-menu"
  | "reorder"
  | "open-asset"
  | "pick";

export type TreeProjectionResourceKind =
  | "workspace"
  | "document"
  | "index"
  | "asset"
  | "asset_folder"
  | "mindmap"
  | "table"
  | "book"
  | "pdf";

export type TreeProjectionAssetKind =
  | "file"
  | "mindmap"
  | "table"
  | "book"
  | "pdf"
  | "image"
  | "video"
  | "audio"
  | "unknown";

export type TreeProjectionResourceMeta = {
  resourceKind: TreeProjectionResourceKind;
  documentId?: string | null;
  assetId?: string | null;
  workspaceId?: string | null;
  assetKind?: TreeProjectionAssetKind | null;
  iconHint?: string | null;
  extra?: Record<string, unknown>;
};

export type TreeProjectionItemBase = {
  nodeId: string;
  parentNodeId: string | null;
  nodeType: TreeProjectionNodeType;
  projectionKind: TreeProjectionKind;
  title: string;
  depth: number;
  position: number | null;
  childCount: number;
  expandable: boolean;
  expandedByDefault: boolean;
  capabilities: TreeProjectionCapability[];
  resourceMeta: TreeProjectionResourceMeta;
  iconHint: string | null;
};
