import React from 'react';
import { FixedSizeListProps, ListChildComponentProps } from 'react-window';
import { BoxProps } from '../../layouts/Box';
import { DivAttributes } from '../../utils/types';
import { OverlayProps } from '../Overlay';
declare type NodeType = 'branch' | 'leaf';
export declare type NodeId = number | string;
export interface Node {
    /**
     * @since 10.19.0
     */
    id: NodeId;
}
export interface DefaultNode extends Node {
    /**
     * @since 10.19.0
     */
    name: string;
    /**
     * @since 10.19.0
     */
    parentId: NodeId;
    /**
     * @since 10.19.0
     */
    type: NodeType;
}
export interface LevelWise {
    /**
     * @since 10.19.0
     */
    level: number;
}
export interface UseTreeProps<T extends Node = Node, P extends CustomDataType<T> = Array<T>> {
    /**
     * @since 10.19.0
     */
    options: P;
    /**
     * @since 10.19.0
     */
    expanded: T['id'][];
    /**
     * @since 10.19.0
     */
    selected: T['id'][];
    /**
     * @since 10.19.0
     */
    selectionLimit: number;
    /**
     * @since 10.19.0
     */
    getRoot(data: P): T;
    /**
     * @since 10.19.0
     */
    getChildren(node: T): T[];
    /**
     * @since 10.19.0
     */
    getParentId(node: T): NodeId;
    /**
     * @since 10.19.0
     */
    autoExpandParent: boolean;
    /**
     * @since 10.19.0
     */
    multiple: boolean;
    /**
     * @since 10.19.0
     */
    onSelect(nodes: T[]): void;
    /**
     * @since 10.19.0
     */
    onCollapse(node: T): void;
    /**
     * @since 10.19.0
     */
    onExpand(node: T): Promise<any>;
}
export interface TreeNodeAPI<T extends Node = Node> {
    /**
     * @since 10.19.0
     */
    nodes: (T & LevelWise)[];
    /**
     * @since 10.19.0
     */
    getIcon(props: T): React.ReactNode;
    /**
     * @since 10.19.0
     */
    getLabel(props: T): string;
    /**
     * @since 10.19.0
     */
    getType(node: T): NodeType;
    /**
     * @since 10.19.0
     */
    isExpandable(node: T): boolean;
    /**
     * @since 10.19.0
     */
    isSelectable(node: T): boolean;
    /**
     * @since 10.19.0
     */
    isSelected(node: T): boolean;
    /**
     * @since 10.19.0
     */
    isLoading(node: T): boolean;
    /**
     * @since 10.19.0
     */
    isExpanded(node: T): boolean;
    /**
     * @since 10.19.0
     */
    highlight(node: T): void;
    /**
     * @since 10.19.0
     */
    isHighlighted(node: T): boolean;
    /**
     * @since 10.19.0
     */
    handleSelection(node: T): void;
    /**
     * @since 10.19.0
     */
    handleExpansion(node: T): void;
    /**
     * @since 10.19.0
     */
    rowRenderer(props: TreeRowProps<T>): React.ReactNode;
    /**
     * @since 10.19.0
     */
    selectionLimit: number;
    /**
     * @since 10.19.0
     */
    isFileLimitReached: boolean;
    /**
     * @since 10.19.0
     */
    isTreeFocused: boolean;
    /**
     * @since 10.19.0
     */
    treeContainer: HTMLDivElement;
}
export interface CustomDataType<T> {
    /**
     * @since 10.19.0
     */
    [key: string]: any;
}
export interface TreeRef<T extends Node = Node> {
    /**
     * @since 10.19.0
     */
    setSelected: (selected: T | T[]) => void;
    /**
     * @since 10.19.0
     */
    setExpanded: (expanded: T | T[]) => void;
    /**
     * @since 10.19.0
     */
    toggleSelected: (node: T) => void;
    /**
     * @since 10.19.0
     */
    toggleExpanded: (node: T) => void;
    /**
     * @since 10.19.0
     */
    rootEl: HTMLElement | null;
}
export interface TreeNodeProps extends ListChildComponentProps {
    /**
     * @since 10.19.0
     */
    data: TreeNodeAPI;
}
export interface TreeRowOverlayProps {
    /**
     * @since 10.19.0
     */
    overlayRef: OverlayProps['overlayRef'];
    /**
     * @since 10.19.0
     */
    targetRef: OverlayProps['targetRef'];
    /**
     * @since 10.19.0
     */
    message: {
        key: string;
        options?: object;
    };
}
export interface TreeRowProps<T extends Node = Node> extends Omit<TreeNodeAPI, 'rowRenderer' | 'nodes' | 'highlight' | 'isTreeFocused'> {
    /**
     * @since 10.19.0
     */
    node: T & LevelWise;
    /**
     * @since 10.19.0
     */
    shouldShowTooltip: boolean;
    /**
     * @since 10.19.0
     */
    isMouseOver: boolean;
    /**
     * @since 10.19.0
     */
    treeContainer: HTMLDivElement;
}
export interface TreeProps<T extends Node = Node, P extends CustomDataType<T> = Array<T>> extends Omit<DivAttributes, 'onSelect'>, Pick<FixedSizeListProps, 'innerElementType' | 'outerElementType'> {
    /**
     * @since 10.19.0
     */
    options: P;
    /**
     * Array of keys of initially expanded nodes
     * @since 10.19.0
     */
    expanded?: T['id'][];
    /**
     * Array of keys of initially selected nodes
     * @since 10.19.0
     */
    selected?: T['id'][];
    /**
     * Number of nodes that can be selected
     * @since 10.19.0
     */
    selectionLimit?: number;
    /**
     * Function should return parent <Code>Root Node</Code>
     * <CodeBlock>{'(): Node'}</CodeBlock>
     * @since 10.19.0
     */
    getRoot?(data: P): T;
    /**
     * Should return an array of children nodes.
     * <CodeBlock>{'(node: Node): Node[]'}</CodeBlock>
     * @since 10.19.0
     */
    getChildren?(node: T): T[];
    /**
     * This function will be executed on each node. Should return{' '}
     * <Code>Icon</Code> component
     * <CodeBlock>{'(node: Node): React.ReactNode'}</CodeBlock>
     * @since 10.19.0
     */
    getIcon?(node: T): React.ReactNode;
    /**
     * This function will be executed on each node. Should return{' '}
     * <Code>label</Code> for row
     * <CodeBlock>{'(node: Node): string'}</CodeBlock>
     * @since 10.19.0
     */
    getLabel?(node: T): string;
    /**
     * This function will be executed on each node. Should return parent{' '}
     * <Code>Node</Code>
     * <CodeBlock>{'(node: Node): NodeId'}</CodeBlock>
     * @since 10.19.0
     * */
    getParentId?(node: T): NodeId;
    /**
     * This function will be executed on each node. Should return{' '}
     * <Code>'branch'</Code> or <Code>'leaf'</Code>
     * <CodeBlock>{'(node: Node): NodeType'}</CodeBlock>
     * @since 10.19.0
     */
    getType?(node: T): NodeType;
    /**
     * Function of whether to enable tree node expansion/collapsing.
     * <CodeBlock>{'(node: Node): boolean'}</CodeBlock>
     * @since 10.19.0
     */
    isExpandable?(node: T): boolean;
    /**
     * Function of whether to enable tree node selection.
     * <CodeBlock>{'(node: Node): boolean'}</CodeBlock>
     * @since 10.19.0
     */
    isSelectable?(node: T): boolean;
    /**
     * Allows selection of multiple nodes
     * @since 10.19.0
     */
    multiple?: boolean;
    /**
     * Number of visible nodes. Helps fix performance bottlenecks in large dataset
     * @since 10.19.0
     */
    maxVisibleNodes?: number;
    /**
     * Height of the list. Helps fix performance bottlenecks in large dataset.
     * @since 10.19.0
     */
    visibleHeight?: number;
    /**
     * Whether to expand parent node when a child node is expanded or selected
     * @since 10.19.0
     */
    autoExpandParent?: boolean;
    /**
     * Callback return currently selected array of nodes.
     * <CodeBlock>{'(nodes: Node[]): void'}</CodeBlock>
     * @since 10.19.0
     */
    onSelect?(nodes: T[]): void;
    /**
     * Triggers when current node collapse
     * <CodeBlock>{'(node: Node): void'}</CodeBlock>
     * @since 10.19.0
     */
    onCollapse?(node: T): void;
    /**
     * Triggers when current node expand
     * <CodeBlock>{'(node: Node): Promise<void>'}</CodeBlock>
     * @since 10.19.0
     */
    onExpand?(node: T): Promise<any>;
    /**
     * Callback for rendering tree nodes
     * <CodeBlock>{'(props: TreeRowProps): React.ReactNode'}</CodeBlock>
     * @since 10.19.0
     */
    rowRenderer?(props: TreeRowProps<T>): React.ReactNode;
}
export interface IconContainerProps extends BoxProps {
    /**
     * @since 10.19.0
     */
    isSelected?: boolean;
}
export interface TreeRowTooltipProps {
    /**
     * @since 10.19.0
     */
    isHighlighted: boolean;
    /**
     * @since 10.19.0
     */
    isSelected: boolean;
    /**
     * @since 10.19.0
     */
    isSelectable: boolean;
    /**
     * @since 10.19.0
     */
    selectionLimit: number;
    /**
     * @since 10.19.0
     */
    isFileLimitReached: boolean;
    /**
     * @since 10.19.0
     */
    shouldShowTooltip: boolean;
    /**
     * @since 10.19.0
     */
    isMouseOver: boolean;
    /**
     * @since 10.19.0
     */
    fileName: string;
    /**
     * @since 10.19.0
     */
    nodeType: NodeType;
    /**
     * @since 10.19.0
     */
    treeContainer: HTMLDivElement;
}
export interface TreeRowContainerProps extends Omit<DivAttributes, 'color'> {
    /**
     * @since 10.19.0
     */
    isHighlighted: boolean;
    /**
     * @since 10.19.0
     */
    isSelected: boolean;
    /**
     * @since 10.19.0
     */
    isSelectable: boolean;
    /**
     * @since 10.19.0
     */
    isExpandable: boolean;
    /**
     * @since 10.19.0
     */
    isFileLimitReached: boolean;
    /**
     * @since 10.19.0
     */
    level: number;
}
export {};
