import { StructureSchema } from '@ephox/boulder'; import type { Optional, Result } from '@ephox/katamari'; import type { ToolbarMenuButton, ToolbarMenuButtonSpec } from '../../api/Toolbar'; type Id = string; export interface TreeSpec { type: 'tree'; items: TreeItemSpec[]; onLeafAction?: (id: Id) => void; defaultExpandedIds?: Id[]; onToggleExpand?: (expandedIds: Id[], { expanded, node }: { expanded: boolean; node: Id; }) => void; defaultSelectedId?: Id; } export interface Tree { type: 'tree'; items: TreeItem[]; defaultExpandedIds: Id[]; onLeafAction: Optional<(id: Id) => void>; onToggleExpand: Optional<(expandedIds: Id[], { expanded, node }: { expanded: boolean; node: Id; }) => void>; defaultSelectedId: Optional; } interface BaseTreeItemSpec { title: string; id: Id; menu?: ToolbarMenuButtonSpec; customStateIcon?: string; customStateIconTooltip?: string; } interface BaseTreeItem { title: string; id: string; menu: Optional; customStateIcon: Optional; customStateIconTooltip: Optional; } export interface DirectorySpec extends BaseTreeItemSpec { type: 'directory'; children: TreeItemSpec[]; } export interface Directory extends BaseTreeItem { type: 'directory'; children: TreeItem[]; } export interface LeafSpec extends BaseTreeItemSpec { type: 'leaf'; } export interface Leaf extends BaseTreeItem { type: 'leaf'; } export type TreeItemSpec = DirectorySpec | LeafSpec; export type TreeItem = Directory | Leaf; export declare const treeSchema: import("@ephox/boulder").StructureProcessor; export declare const createTree: (spec: TreeSpec) => Result>; export {}; //# sourceMappingURL=Tree.d.ts.map