zent
Version:
一套前端设计语言和基于React的实现
22 lines (21 loc) • 912 B
TypeScript
import { ITreeData, ITreeRenderKey, TreeRootIdArray, ITreeRootInfoMap } from './common';
export interface ICreateStateByPropsParams {
data: ITreeData[];
dataType?: 'tree' | 'plain';
renderKey?: Partial<ITreeRenderKey>;
checkable?: boolean;
expandAll?: boolean;
checkedKeys?: TreeRootIdArray;
disabledCheckedKeys?: TreeRootIdArray;
loadMore?: (data: ITreeData) => Promise<any>;
isRoot?: (data: ITreeData) => boolean;
}
export interface ICreateStateByPropsReturn {
tree: ITreeData[];
renderKey: ITreeRenderKey;
rootInfoMap: ITreeRootInfoMap;
expandNode: TreeRootIdArray;
checkedNode: TreeRootIdArray;
disabledNode: TreeRootIdArray;
}
export default function createStateByProps({ data, isRoot, renderKey: propsRenderKey, dataType, expandAll, loadMore, checkable, disabledCheckedKeys, checkedKeys, }: ICreateStateByPropsParams): ICreateStateByPropsReturn;