import React from "react"; import { type PlaceholderRender, type NodeModel, type RenderParams } from "@minoru/react-dnd-treeview"; import { type DragSourceMonitor } from "react-dnd"; import type { NodeDto, WithDefaultNodeData } from "./domains/index.js"; export interface DropOptions> { dragSourceId?: NodeDto["id"]; dropTargetId: NodeDto["id"]; dragSource?: NodeDto; dropTarget?: NodeDto; } export interface TreeProps> { autoExpandOnDragOver?: boolean; canDrag?: (node: NodeDto) => boolean; canDrop?: (tree: NodeDto[], options: DropOptions) => boolean; defaultLockedOpenNodeIds?: string[]; defaultOpenNodeIds?: string[]; dropTargetOffset?: number; insertDroppableFirst?: boolean; loadingNodeIds?: string[]; nodes: NodeDto[]; onChangeOpen?: (newOpenNodes: NodeDto[]) => void; onDragStart?: (node: NodeModel>, monitor: DragSourceMonitor) => void; onDrop?: (newTree: NodeDto[], options: DropOptions) => Promise | void; onNodeClick?: (node: WithDefaultNodeData) => void; placeholderRender?: PlaceholderRender>; renderer?: (node: WithDefaultNodeData, params?: RenderParams) => React.ReactNode; rootId?: string; sort?: boolean | ((a: NodeDto, b: NodeDto) => number); } declare const Tree: ((props: TreeProps) => React.JSX.Element) & { original: (props: TreeProps) => React.JSX.Element; originalName: string; displayName: string; } & { original: ((props: TreeProps) => React.JSX.Element) & { original: (props: TreeProps) => React.JSX.Element; originalName: string; displayName: string; }; originalName: string; displayName: string; } & { createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<((props: TreeProps) => React.JSX.Element) & { original: (props: TreeProps) => React.JSX.Element; originalName: string; displayName: string; }>) => (props: unknown) => React.JSX.Element; } & { Item: (({ children, className, active, loading, ...props }: import("./components/Item.js").ItemProps) => React.JSX.Element) & { original: ({ children, className, active, loading, ...props }: import("./components/Item.js").ItemProps) => React.JSX.Element; originalName: string; displayName: string; } & { original: (({ children, className, active, loading, ...props }: import("./components/Item.js").ItemProps) => React.JSX.Element) & { original: ({ children, className, active, loading, ...props }: import("./components/Item.js").ItemProps) => React.JSX.Element; originalName: string; displayName: string; }; originalName: string; displayName: string; } & { createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ children, className, active, loading, ...props }: import("./components/Item.js").ItemProps) => React.JSX.Element) & { original: ({ children, className, active, loading, ...props }: import("./components/Item.js").ItemProps) => React.JSX.Element; originalName: string; displayName: string; }>) => (props: unknown) => React.JSX.Element; } & { CollapseTrigger: (({ open, loading, ...props }: import("./components/ItemCollapseTrigger.js").ItemCollapseTriggerProps) => React.JSX.Element) & { original: ({ open, loading, ...props }: import("./components/ItemCollapseTrigger.js").ItemCollapseTriggerProps) => React.JSX.Element; originalName: string; displayName: string; } & { original: (({ open, loading, ...props }: import("./components/ItemCollapseTrigger.js").ItemCollapseTriggerProps) => React.JSX.Element) & { original: ({ open, loading, ...props }: import("./components/ItemCollapseTrigger.js").ItemCollapseTriggerProps) => React.JSX.Element; originalName: string; displayName: string; }; originalName: string; displayName: string; } & { createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ open, loading, ...props }: import("./components/ItemCollapseTrigger.js").ItemCollapseTriggerProps) => React.JSX.Element) & { original: ({ open, loading, ...props }: import("./components/ItemCollapseTrigger.js").ItemCollapseTriggerProps) => React.JSX.Element; originalName: string; displayName: string; }>) => (props: unknown) => React.JSX.Element; }; Content: (({ children, className, ...props }: import("./components/ItemContent.js").ItemContentProps) => React.JSX.Element) & { original: ({ children, className, ...props }: import("./components/ItemContent.js").ItemContentProps) => React.JSX.Element; originalName: string; displayName: string; } & { original: (({ children, className, ...props }: import("./components/ItemContent.js").ItemContentProps) => React.JSX.Element) & { original: ({ children, className, ...props }: import("./components/ItemContent.js").ItemContentProps) => React.JSX.Element; originalName: string; displayName: string; }; originalName: string; displayName: string; } & { createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ children, className, ...props }: import("./components/ItemContent.js").ItemContentProps) => React.JSX.Element) & { original: ({ children, className, ...props }: import("./components/ItemContent.js").ItemContentProps) => React.JSX.Element; originalName: string; displayName: string; }>) => (props: unknown) => React.JSX.Element; }; DragHandle: (({ handleRef }: import("./components/ItemDragHandle.js").ItemDragHandleProps) => React.JSX.Element) & { original: ({ handleRef }: import("./components/ItemDragHandle.js").ItemDragHandleProps) => React.JSX.Element; originalName: string; displayName: string; } & { original: (({ handleRef }: import("./components/ItemDragHandle.js").ItemDragHandleProps) => React.JSX.Element) & { original: ({ handleRef }: import("./components/ItemDragHandle.js").ItemDragHandleProps) => React.JSX.Element; originalName: string; displayName: string; }; originalName: string; displayName: string; } & { createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ handleRef }: import("./components/ItemDragHandle.js").ItemDragHandleProps) => React.JSX.Element) & { original: ({ handleRef }: import("./components/ItemDragHandle.js").ItemDragHandleProps) => React.JSX.Element; originalName: string; displayName: string; }>) => (props: unknown) => React.JSX.Element; }; Icon: (({ element, active, ...props }: import("./components/ItemIcon.js").ItemIconProps) => React.JSX.Element) & { original: ({ element, active, ...props }: import("./components/ItemIcon.js").ItemIconProps) => React.JSX.Element; originalName: string; displayName: string; } & { original: (({ element, active, ...props }: import("./components/ItemIcon.js").ItemIconProps) => React.JSX.Element) & { original: ({ element, active, ...props }: import("./components/ItemIcon.js").ItemIconProps) => React.JSX.Element; originalName: string; displayName: string; }; originalName: string; displayName: string; } & { createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ element, active, ...props }: import("./components/ItemIcon.js").ItemIconProps) => React.JSX.Element) & { original: ({ element, active, ...props }: import("./components/ItemIcon.js").ItemIconProps) => React.JSX.Element; originalName: string; displayName: string; }>) => (props: unknown) => React.JSX.Element; }; SubIndentation: (({ level }: import("./components/ItemSubIndentation.js").ItemSubIndentationProps) => React.JSX.Element) & { original: ({ level }: import("./components/ItemSubIndentation.js").ItemSubIndentationProps) => React.JSX.Element; originalName: string; displayName: string; } & { original: (({ level }: import("./components/ItemSubIndentation.js").ItemSubIndentationProps) => React.JSX.Element) & { original: ({ level }: import("./components/ItemSubIndentation.js").ItemSubIndentationProps) => React.JSX.Element; originalName: string; displayName: string; }; originalName: string; displayName: string; } & { createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ level }: import("./components/ItemSubIndentation.js").ItemSubIndentationProps) => React.JSX.Element) & { original: ({ level }: import("./components/ItemSubIndentation.js").ItemSubIndentationProps) => React.JSX.Element; originalName: string; displayName: string; }>) => (props: unknown) => React.JSX.Element; }; Placeholder: (({ depth }: import("./components/ItemPlaceholder.js").ItemPlaceholderProps) => React.JSX.Element) & { original: ({ depth }: import("./components/ItemPlaceholder.js").ItemPlaceholderProps) => React.JSX.Element; originalName: string; displayName: string; } & { original: (({ depth }: import("./components/ItemPlaceholder.js").ItemPlaceholderProps) => React.JSX.Element) & { original: ({ depth }: import("./components/ItemPlaceholder.js").ItemPlaceholderProps) => React.JSX.Element; originalName: string; displayName: string; }; originalName: string; displayName: string; } & { createDecorator: (decorator: import("@webiny/react-composition/types.js").ComponentDecorator<(({ depth }: import("./components/ItemPlaceholder.js").ItemPlaceholderProps) => React.JSX.Element) & { original: ({ depth }: import("./components/ItemPlaceholder.js").ItemPlaceholderProps) => React.JSX.Element; originalName: string; displayName: string; }>) => (props: unknown) => React.JSX.Element; }; }; }; export { Tree, type NodeModel };