forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
angular-ui-tree.d.ts
80 lines (70 loc) · 1.9 KB
/
angular-ui-tree.d.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
// Type definitions for angular-ui-tree v2.8.0
// Project: https://github.com/angular-ui-tree/angular-ui-tree
// Definitions by: Calvin Fernandez <https://github.com/CalvinFernandez>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path='../angularjs/angular.d.ts' />
declare namespace AngularUITree {
interface IEventSourceInfo {
cloneModel: any;
index: number;
nodeScope: ITreeNodeScope;
nodesScope: ITreeNodeScope;
}
interface IPosition {
dirAx: number;
dirX: number;
dirY: number;
distAxX: number;
distAxY: number;
distX: number;
distY: number;
lastDirX: number;
lastDirY: number;
lastX: number;
lastY: number;
moving: boolean;
nowX: number;
nowY: number;
offsetX: number;
offsetY: number;
startX: number;
startY: number;
}
interface IEventInfo {
dest: {
index: number;
nodesScope: IParentTreeNodeScope;
};
elements: any;
pos: IPosition;
source: IEventSourceInfo;
}
interface IAcceptCallback {
(source: ITreeNodeScope, destination: ITreeNodeScope, destinationIndex: number): boolean;
}
interface IDroppedCallback {
(eventInfo: IEventInfo): void;
}
interface ICallbacks {
accept: IAcceptCallback;
dragStart: IDroppedCallback;
dropped: IDroppedCallback;
}
/**
* Internal representation of node in the UI
*/
interface ITreeNodeScope extends ng.IScope {
node: ITreeNode;
}
interface IParentTreeNodeScope extends ITreeNodeScope {
isParent(nodeScope: ITreeNodeScope): boolean;
}
/**
* Node in list
*/
interface ITreeNode {
id: number | string;
nodes: ITreeNode[];
title: string;
}
}