-
Notifications
You must be signed in to change notification settings - Fork 45
/
index.d.ts
59 lines (46 loc) · 1.21 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import type React from 'react';
type Checked = 0 | 0.5 | 1;
type CheckedStatus = 'checked' | 'custom' | 'unchecked';
export interface FolderTreeProps {
data: NodeData;
iconComponents?: IconComponents;
indentPixels?: number;
initCheckedStatus?: CheckedStatus;
initOpenStatus?: OpenStatus;
onChange?: OnChange;
onNameClick?: OnNameClick;
readOnly?: boolean;
showCheckbox?: boolean;
}
export type Icon = React.FunctionComponent<IconProps>;
export interface IconComponents {
CancelIcon?: Icon;
CaretRightIcon?: Icon;
CaretDownIcon?: Icon;
DeleteIcon?: Icon;
EditIcon?: Icon;
FileIcon?: Icon;
FolderIcon?: Icon;
FolderOpenIcon?: Icon;
OKIcon?: Icon;
}
export interface IconProps {
nodeData: NodeData;
onClick: () => void;
}
export interface NodeData {
checked?: Checked;
children?: Array<NodeData>;
isOpen?: boolean;
name: string;
[key: string]: any;
}
type OnChange = (state: NodeData, event: unknown) => void;
type OnNameClick = (opts: {
defaultOnClick: () => void;
nodeData: NodeData;
}) => void;
type OpenStatus = 'closed' | 'custom' | 'open';
declare const FolderTree: React.FunctionComponent<FolderTreeProps>;
export const testData: NodeData;
export default FolderTree;