-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbranchy.types.ts
58 lines (44 loc) · 1.2 KB
/
branchy.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
export class FoldingType {
public static Expanded: FoldingType = new FoldingType('node-expanded');
public static Collapsed: FoldingType = new FoldingType('node-collapsed');
public static Leaf: FoldingType = new FoldingType('node-leaf');
constructor(private _cssClass: string) {
}
public get cssClass(): string {
return this._cssClass;
}
}
export interface TreeModel {
value: string | RenamableNode;
children?: Array<TreeModel>;
_status?: TreeStatus;
_foldingType?: FoldingType;
_indexInParent?: number;
}
export enum TreeStatus {
New,
Modified,
EditInProgress
}
export interface RenamableNode {
setName(name: string): void;
toString(): string;
}
export interface NodeEvent {
node: TreeModel;
}
export interface NodeSelectedEvent extends NodeEvent {
}
export interface NodeDestructiveEvent extends NodeEvent {
parent: TreeModel;
}
export interface NodeMovedEvent extends NodeDestructiveEvent {
}
export interface NodeRemovedEvent extends NodeDestructiveEvent {
}
export interface NodeCreatedEvent extends NodeDestructiveEvent {
}
export interface NodeRenamedEvent extends NodeDestructiveEvent {
newValue: string | RenamableNode;
oldValue: string | RenamableNode;
}