@cfxjs/react-ui
Version:
Modern and minimalist React UI library.
30 lines (29 loc) • 1 kB
TypeScript
import React from 'react';
import TreeFile from './tree-file';
import TreeFolder from './tree-folder';
declare const FileTreeValueType: ["directory", "file"];
export declare type FileTreeValue = {
type: typeof FileTreeValueType[number];
name: string;
extra?: string;
files?: Array<FileTreeValue>;
};
interface Props {
value?: Array<FileTreeValue>;
initialExpand?: boolean;
onClick?: (path: string) => void;
className?: string;
}
declare const defaultProps: {
initialExpand: boolean;
className: string;
};
declare type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
export declare type TreeProps = Props & typeof defaultProps & NativeAttrs;
declare type TreeComponent<P = {}> = React.FC<P> & {
File: typeof TreeFile;
Folder: typeof TreeFolder;
};
declare type ComponentProps = Partial<typeof defaultProps> & Omit<Props, keyof typeof defaultProps> & NativeAttrs;
declare const _default: TreeComponent<ComponentProps>;
export default _default;