forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqtree.d.ts
More file actions
31 lines (30 loc) · 858 Bytes
/
qtree.d.ts
File metadata and controls
31 lines (30 loc) · 858 Bytes
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
// We can't set QTreeNode as default assignment for the generics param,
// we use unknown and use conditional types to set it
export interface QTreeNode<Node = unknown> {
label?: string;
icon?: string;
iconColor?: string;
img?: string;
avatar?: string;
children?: (Node extends unknown ? QTreeNode : Node)[];
disabled?: boolean;
expandable?: boolean;
selectable?: boolean;
handler?: (node: Node extends unknown ? QTreeNode : Node) => void;
tickable?: boolean;
noTick?: boolean;
tickStrategy?: "leaf" | "leaf-filtered" | "string" | "none";
lazy?: boolean;
header?: string;
body?: string;
[index: string]: any;
}
export interface QTreeLazyLoadParams<
Node extends QTreeNode = QTreeNode,
UpdatedNodes extends QTreeNode = Node
> {
node: Node;
key: string;
done: (nodes: UpdatedNodes[]) => void;
fail: () => void;
}