import { default as React } from 'react';
import { TUseValues } from '../../AHooks/useValues';
import { TCanCallback } from '../../AUtils/cbF';
import { IItem } from '../../AUtils/objF';
import { IABaseProps } from '../ABase/ABase';
import { Resources } from '../AResource/AResource';
import { EDir4, TActionRef } from '../ATypes/ATypes';
import { IATreeItemProps, IIndentProps, TIconsConfig } from './ATreeItem';
import { IATreeSearchRendererProps } from './ATreeSearch';
export interface IATreeSearchResult<T> {
    /**
     * item? : T
     *
     * Description : item of search result
     */
    item?: T;
    /**
     * items : T[]
     *
     * Description : items of search result
     */
    items: T[];
    /**
     * keyword : string
     *
     * Description : keyword of search result
     */
    keyword: string;
}
export interface IATreeItem<T> extends IItem {
    /**
     * children? : T[]
     *
     * Description : children of IATreeItem. tree will be rendered recursively.
     */
    children?: T[];
}
export interface IATreeActions {
    /**
     * collapseAll : () => void
     *
     * Description : collapse all items
     */
    collapseAll: () => void;
    /**
     * expandAll : () => void
     *
     * Description : expand all items
     */
    expandAll: () => void;
}
export type TExpandState = 'collapsed' | 'expanded' | 'noChild';
export interface IATreeProps<T extends IATreeItem<T>> extends IABaseProps {
    /**
     * ContentRenderer? : (props: IATreeItemProps<T>) => React.ReactNode
     *
     * Description : Renderer of content of ATreeItem
     */
    ContentRenderer?: (props: IATreeItemProps<T>) => React.ReactNode;
    /**
     * IndentRenderer? : TCanCallback<IATreeItemProps<T>, React.ReactNode>
     *
     * Description : Renderer of indent of ATreeItem
     *
     * Overwrites indents if provided.
     */
    IndentRenderer?: TCanCallback<IATreeItemProps<T>, React.ReactNode>;
    /**
     * OverflowPadding? : boolean
     *
     * Description : OverflowPadding of ATree
     */
    OverflowPadding?: boolean;
    /**
     * RightStickyAddon? : TCanCallback<IATreeItemProps<T>, React.ReactNode>;
     *
     * Description : RightStickyAddon of ATree
     */
    RightStickyAddon?: TCanCallback<IATreeItemProps<T>, React.ReactNode>;
    /**
     * TopRightAddon? : React.ReactNode
     *
     * Description : TopRightAddon of ATree
     */
    TopRightAddon?: React.ReactNode;
    /**
     * TreeTopAddon? : React.ReactNode
     *
     * Description : TreeTopAddon of ATree
     */
    /**
     * TreeHeaderClassName? : string
     *
     * Description : className of ATreeHeader
     */
    TreeHeaderClassName?: string;
    /**
     * TreeHeaderStyle? : React.CSSProperties
     *
     * Description : style of ATreeHeader
     */
    TreeHeaderStyle?: React.CSSProperties;
    /**
     * TreeItemClassName? : string
     *
     * Description : className of ATreeItem
     */
    TreeItemClassName?: TCanCallback<IATreeItemProps<T>, string>;
    /**
     * TreeItemRenderer? : (props: IATreeItemProps<T>) => React.ReactNode
     *
     * Description : TreeItemRenderer of ATree
     */
    TreeItemRenderer?: (props: IATreeItemProps<T>) => React.ReactNode;
    /**
     * TreeItemStyle? : React.CSSProperties
     *
     * Description : style of ATreeItem
     */
    TreeItemStyle?: TCanCallback<IATreeItemProps<T>, React.CSSProperties>;
    /**
     * TreeSearchRenderer? : (props: IATreeSearchRendererProps<T>) => React.ReactNode
     *
     * Description : TreeSearchRenderer of ATree
     */
    TreeSearchRenderer?: (props: IATreeSearchRendererProps<T>) => React.ReactNode;
    /**
     * TreeTopAddon? : React.ReactNode
     *
     * Description : TreeTopAddon of ATree
     */
    TreeTopAddon?: React.ReactNode;
    /**
     * actionRef? : TActionRef<IATreeActions>
     *
     * Description : actionRef of ATree
     */
    actionRef?: TActionRef<IATreeActions>;
    /**
     * autoFocus? : boolean
     *
     * Description : autoFocus of ATreeSearch
     */
    autoFocus?: boolean;
    /**
     * height? : number
     *
     * Description : height of ATreeItem
     */
    height?: number;
    /**
     * icons? : { noChild?: TTreeIconValue; collapsed?: TTreeIconValue; expanded?: TTreeIconValue }
     *
     * Description : icons of ATree
     */
    icons?: TCanCallback<IATreeItemProps<T>, TIconsConfig | undefined>;
    /**
     * indents? : {  collapsed?: React.ReactNode; expanded?: React.ReactNode; isLast?: React.ReactNode }
     *
     * Description : indents of ATree
     */
    indents?(props: IIndentProps<T>): {
        collapsed?: React.ReactNode;
        expanded?: React.ReactNode;
        isLast?: React.ReactNode;
    };
    /**
     * insertBorder? : boolean
     *
     * Description : insertBorder of ATree
     */
    insertBorder?: boolean;
    /**
     * isDraggable? : boolean
     *
     * Description : isDraggable of ATree
     */
    isDraggable?: boolean;
    /**
     * isSelectMulti? : boolean
     *
     * Description : isSelectMulti of ATree
     */
    isSelectMulti?: boolean;
    /**
     * maxLength? : number
     *
     * Description : maxLength of ATreeSearch
     */
    maxLength?: number;
    /**
     * noHeaderDivider? : boolean = false
     *
     * Description : noHeaderDivider of ATree
     */
    noHeaderDivider?: boolean;
    /**
     * noSearch? : boolean
     *
     * Description : noSearch of ATree. if true, search will not be rendered.
     */
    noSearch?: boolean;
    /**
     * noSyncSearchSelect? : boolean
     *
     * Description : syncSearchSelect of ATree. if true, selectedItems will be synced with searchResult.
     */
    noSyncSearchSelect?: boolean;
    /**
     * pk? : keyof T | (keyof T)[]
     *
     * Description : pk of ATree. if pk is set, it will be used as key of item. if not, index will be used.
     */
    pk?: keyof T | (keyof T)[];
    /**
     * placeholder? : React.ReactNode
     *
     * Description : placeholder of ATree. It appears when items is empty.
     */
    placeholder?: React.ReactNode;
    /**
     * resources? : Partial<typeof Resources.ATree>
     *
     * Description : resources of ATree
     */
    resources?: Partial<typeof Resources.ATree>;
    /**
     * rightStickyProps? : React.HTMLAttributes<HTMLDivElement>
     *
     * Description : rightStickyProps of ATree
     */
    rightStickyProps?: React.HTMLAttributes<HTMLDivElement>;
    /**
     * searchCircular? : boolean (default: false)
     *
     * Description : searchCircular of ATree. if true, search will be circular. if false, search will be stopped at the end of the list.
     */
    searchCircular?: boolean;
    /**
     * searchItemClassName? : string
     *
     * Description : className of search item
     */
    searchItemClassName?: string;
    /**
     * searchItemStyle? : React.CSSProperties
     *
     * Description : style of search item
     */
    searchItemStyle?: React.CSSProperties;
    /**
     * searchPredicate? : (inputValue: string, item: T) => any
     *
     * Description : searchPredicate of ATree.
     */
    searchPredicate?: (inputValue: string, item: T) => any;
    /**
     * selectDisabled? : (item: T) => boolean | string | undefined
     *
     * Description : selectDisabled of ATree. if string is returned, it will be used as tooltip.
     */
    selectDisabled?: (item: T) => boolean | string | undefined;
    /**
     * selectUnused? : (item: T) => boolean
     *
     * Description : selectUnused of ATree. if true is returned, it cannot be selected.
     */
    selectUnused?: (item: T) => boolean;
    /**
     * showCheckbox? : boolean
     *
     * Description : showCheckbox of ATree
     */
    showCheckbox?: boolean;
    /**
     * treeItemTooltip? : TCanCallback<IATreeItemProps<T>, React.ReactNode | undefined>
     *
     * Description : treeItemTooltip of ATree
     */
    treeItemTooltip?: TCanCallback<IATreeItemProps<T>, React.ReactNode | undefined>;
    /**
     * treeItemTooltipDelay? : TCanCallback<IATreeItemProps<T>, number | undefined>
     *
     * Description : treeItemTooltipDelay of ATree
     */
    treeItemTooltipDelay?: TCanCallback<IATreeItemProps<T>, number | undefined>;
    /**
     * treeItemTooltipDirection? : TCanCallback<IATreeItemProps<T>, EDir4 | undefined>
     *
     * Description : treeItemTooltipDirection of ATree
     */
    treeItemTooltipDirection?: TCanCallback<IATreeItemProps<T>, EDir4 | undefined>;
    /**
     * treeItemTooltipDistance? : TCanCallback<IATreeItemProps<T>, number | undefined>
     *
     * Description : treeItemTooltipDistance of ATree
     */
    treeItemTooltipDistance?: TCanCallback<IATreeItemProps<T>, number | undefined>;
    /**
     * useExpand? : TUseValues<T[]>
     *
     * Description : useExpand of ATree
     */
    useExpand?: TUseValues<T[]>;
    /**
     * useExpandAnimation? : boolean = false
     *
     * Description : useExpandAnimation of ATree. if true, expand animation will be used.
     */
    useExpandAnimation?: boolean;
    /**
     * useItems? : TUseValues<T[]>
     *
     * Description : useItems of ATree. items will be changed if dragging is used
     */
    useItems?: TUseValues<T[]>;
    /**
     * useSearch? : TUseValues<IATreeSearchResult<T> | undefined>
     *
     * Description : useSearch of ATree
     */
    useSearch?: TUseValues<IATreeSearchResult<T> | undefined>;
    /**
     * useSelect? : TUseValues<T[]>
     *
     * Description : useSelect of ATree
     */
    useSelect?: TUseValues<T[]>;
    /**
     * width? : number
     *
     * Description : width of ATree
     */
    width?: number;
}
/**
 * AComponent : ATree
 *
 * Description : ATree component. tree will be rendered recursively.
 * select and check are not different, check is just appeared when showCheckbox is true.
 * select, check, expand, drag-to-move, search are available.
 *
 * Basic Usage :
 *
 *     const items = [{name: 'Item1', children: [{name: 'Item1-1'}]}, {name: 'Item2'}, {name: 'Item3'}];
 *     const [selected, setSelected] = useState<typeof items[0]>(items[0]);
 *     const [expanded, setExpanded] = useState<typeof items[0]>(items[0]);
 *     const [searchResult, setSearchResult] = useState<IATreeSearchResult<typeof items[0]> | undefined>(undefined);
 *
 *     if (case 1)
 *       <ATree useItems={[items, undefined]}/>
 *
 *     if (case 2)
 *       <ATree useItems={[items, setItems]}
 *         useSelect={[selected, setSelected]}/>
 *
 *     if (case 3)
 *       <ATree useItems={[items, setItems]}
 *       useExpand={[expanded, setExpanded]}/>
 *
 *     if (case 4)
 *       <ATree useItems={[items, setItems]}
 *       useSearch={[searchResult, setSearchResult]}/>
 *
 */
export declare const ATree: <T extends IATreeItem<T>>(props: IATreeProps<T>) => React.ReactNode;
