-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
86 lines (74 loc) · 1.41 KB
/
types.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* GPLv3 https://www.gnu.org/licenses/gpl-3.0.en.html
*
* Author: eidng8
*/
/**
* Tree item data
*/
export interface G8TreeItem {
/**
* Just to allow accessing data via index syntax and arbitrary data to fit in.
*/
[key: string]: unknown;
/**
* Item name, serves as label, will be rendered as node label.
*/
name?: string;
/**
* Whether current node is checked.
*/
checked?: boolean;
/**
* Intermediate check box state. Active while some of the children were
* checked, but not all.
*/
intermediate?: boolean;
/**
* Whether the sub-tree of this node has been rendered.
*/
rendered?: boolean;
/**
* List of tags.
*/
tags?: G8TreeItemTag[];
/**
* List of child nodes.
*/
children?: G8TreeItem[];
}
/**
* Node tag data
*/
export interface G8TreeItemTag {
/**
* Just to allow accessing data via index syntax and arbitrary data to fit in.
*/
[key: string]: unknown;
/**
* Tag label.
*/
label: string;
/**
* Tag tooltip. Visible when mouse hovers on the tag.
*/
hint?: string;
}
/**
* Fired when a node is clicked.
*/
export class G8ClickEvent extends MouseEvent {
/**
* Data about the clicked node
*/
data!: {
/**
* Whether the node has been expanded after the click.
*/
expanded: boolean;
/**
* The data item associated with the clicked node.
*/
item: G8TreeItem;
};
}