-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.d.ts
More file actions
62 lines (51 loc) · 1.88 KB
/
Copy pathindex.d.ts
File metadata and controls
62 lines (51 loc) · 1.88 KB
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
export type SelectValueType = 0 | 0.5 | 1;
export const NotSelect: SelectValueType;
export const IncompleteSelect: SelectValueType;
export const FullSelect: SelectValueType;
export type TreeKeyType = string | number | {};
export type TreeValueType = any;
export declare class Tree {
isLeaf(): boolean;
isEqual(treeNode: Tree): boolean;
isFullSelect(cascade?: boolean): boolean;
isNotSelect(cascade?: boolean): boolean;
isIncompleteSelect(cascade?: boolean): boolean;
selectStatus(cascade?: boolean): SelectValueType;
getLeafCount(params?: {includeWeakNode?: boolean}): number;
getSelectedLeafCount(params?: {includeWeakNode?: boolean}): number;
getDeepth(params?: {includeWeakNode?: boolean}): number;
getInfo(): {};
getId(): TreeValueType;
getStringId(): string;
getParent(): Tree | void;
getWeakParent(): Tree | void;
getChildren(): Tree[];
getLeafChildren(params?: {includeWeakNode?: boolean}): Tree[];
getFullSelectChildren(cascade?: boolean,params?: {includeWeakNode?: boolean}): Tree[]
getPath(): string;
setInitialState(selectedIds: TreeKeyType[], cascade?: boolean): Tree[];
update(cascade?: boolean): void;
search(
text: string,
keys: TreeKeyType[],
multiselect: boolean,
exactly?: boolean,
canSearch?: boolean
): Tree[];
hasAncestor(ancestor: Tree): boolean;
findById(childId: TreeKeyType): Tree[] | void;
private _fromUpNotification(status: boolean): void;
private _fromDownNotification(): void;
private _onStatusChange(): void;
private _stringId(id: TreeKeyType): string;
}
declare function InitTree<T>(
root ?: T,
parent ?: Tree,
childrenKey ?: TreeKeyType,
idKey ?: TreeKeyType,
onStatusChange?: (treeNode: Tree) => void,
rootPath?: (root: T) => string,
parentPath?: (root: T) => string,
): Tree;
export default InitTree;