import { IObject, TypeExtends } from '@newgrand/udp-core'; import React, { ReactNode } from 'react'; import { TreeProps } from './tree'; interface AsyncTreeProps extends TreeProps { /** * @description 过滤或定位输入框对应的placeholder */ placeholder?: string; /** * @description 是否显示树节点过滤 * @default true */ showFilter?: boolean | ((defaultNode: ReactNode) => ReactNode); /** * @description 是否显示树节点定位,优先级高于showFilter,selectable为true时有效 * @default false */ showLocate?: boolean | ((defaultNode: ReactNode) => ReactNode); /** * @description 过滤属性,{includeChildren: true} 表示包含下级节点 */ filterOptions?: { includeChildren?: boolean; }; /** * @description 是否启用懒加载 * @default false */ lazyLoad?: boolean; /** * @description 选中树节点时触发 */ onSelectedChange?: (keys: Array, nodes: Array, type: 'checked' | 'selected') => void; /** * @description 树节点渲染完成触发 */ onLoad?: (...args: any[]) => void; /** * @description 发起节点数据的请求 */ request: (...args: any[]) => Promise; /** * @description 树节点数据加载完成后触发 */ dataLoad?: (nodes: Array, extraParams?: object) => Array; /** * @description 重写节点的属性 */ convertNode?: (data: object, levelIndex: { level: number; index: number; }) => IObject & { isSelected?: boolean; isChecked?: boolean; key: string; title: ReactNode; expanded?: boolean; }; /** * @description request 注入的参数 */ params?: IObject | Function; /** * @description 默认选中状态是否触发状态更新事件 * @default false */ defaultChange?: boolean; /** * @description 查询完成回调 */ onSearch?: (searchValue: string, nodes: any[]) => void; } export type IAsyncTreeProps = TypeExtends ReactNode; }>; /** * 导出异步树控件 */ export declare const AsyncTree: React.ForwardRefExoticComponent & { titleRender?: ((node: any, oldRender: Function) => ReactNode) | undefined; } & { id?: string | undefined; }, "outRef"> & React.RefAttributes<{ [x: string]: any; getApi(): any; }>>; export {};