File tree 2 files changed +62
-1
lines changed 2 files changed +62
-1
lines changed Original file line number Diff line number Diff line change
1
+ import type React from 'react' ;
2
+
3
+ type Checked = 0 | 0.5 | 1 ;
4
+
5
+ type CheckedStatus = 'checked' | 'custom' | 'unchecked' ;
6
+
7
+ export interface FolderTreeProps {
8
+ data : NodeData ;
9
+ iconComponents ?: IconComponents ;
10
+ indentPixels ?: number ;
11
+ initCheckedStatus ?: CheckedStatus ;
12
+ initOpenStatus ?: OpenStatus ;
13
+ onChange ?: OnChange ;
14
+ onNameClick ?: OnNameClick ;
15
+ readOnly ?: boolean ;
16
+ showCheckbox ?: boolean ;
17
+ }
18
+
19
+ export type Icon = React . FunctionComponent < IconProps > ;
20
+
21
+ export interface IconComponents {
22
+ CancelIcon ?: Icon ;
23
+ CaretRightIcon ?: Icon ;
24
+ CaretDownIcon ?: Icon ;
25
+ DeleteIcon ?: Icon ;
26
+ EditIcon ?: Icon ;
27
+ FileIcon ?: Icon ;
28
+ FolderIcon ?: Icon ;
29
+ FolderOpenIcon ?: Icon ;
30
+ OKIcon ?: Icon ;
31
+ }
32
+
33
+ export interface IconProps {
34
+ nodeData : NodeData ;
35
+ onClick : ( ) => void ;
36
+ }
37
+
38
+ export interface NodeData {
39
+ checked ?: Checked ;
40
+ children ?: Array < NodeData > ;
41
+ isOpen ?: boolean ;
42
+ name : string ;
43
+ [ key : string ] : any ;
44
+ }
45
+
46
+ type OnChange = ( state : NodeData , event : unknown ) => void ;
47
+
48
+ type OnNameClick = ( opts : {
49
+ defaultOnClick : ( ) => void ;
50
+ nodeData : NodeData ;
51
+ } ) => void ;
52
+
53
+ type OpenStatus = 'closed' | 'custom' | 'open' ;
54
+
55
+ declare const FolderTree : React . FunctionComponent < FolderTreeProps > ;
56
+
57
+ export const testData : NodeData ;
58
+
59
+ export default FolderTree ;
Original file line number Diff line number Diff line change 3
3
"version" : " 5.0.3" ,
4
4
"description" : " customizable react folder tree library" ,
5
5
"main" : " dist/react-folder-tree.bundle.js" ,
6
+ "typings" : " index.d.ts" ,
6
7
"files" : [
7
8
" dist/react-folder-tree.bundle.js" ,
8
- " dist/style.css"
9
+ " dist/style.css" ,
10
+ " index.d.ts"
9
11
],
10
12
"author" : " Shunji Zhan <shunhahaha@live.com>" ,
11
13
"keywords" : [
You can’t perform that action at this time.
0 commit comments