import type React from 'react'; export type TreeSelectProps = BaseComponentProps & { tree: TreeSelectItems[] | []; selectedIds?: string[]; onChange: onChangeCallback; className?: string; targetNodeId?: string; loading?: boolean; }; export type BaseComponentProps = { renderIconBefore?: RenderIconType; renderIconAfter?: RenderIconType; hideCheckbox?: boolean; hideSelectedChildCount?: boolean; hideSearchInput?: boolean; asyncSearchCallback?: (e: string) => Promise; asyncLoading?: AsyncLoadingCallback; }; export type AsyncLoadingCallback = (parentNode: TreeSelectItems) => Promise; export type RenderIconType = React.ReactNode | Element | JSX.Element | React.ReactElement; export type onChangeCallback = (args: { selectedIds: string[]; updatedTree: TreeSelectItems[]; }) => void; export type TreeSelectItems = { id: string; label: string; children: TreeSelectItems[] | null; expanded?: boolean; selected?: boolean; filtered?: boolean; hasSelectedChild?: number; _loaded?: boolean; }; export type TreeItemKeys = keyof TreeSelectItems; export type TreeItemValues = TreeSelectItems[TreeItemKeys];