-
Notifications
You must be signed in to change notification settings - Fork 28
/
Layout.ts
47 lines (42 loc) · 902 Bytes
/
Layout.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
import { Commander, Tracer } from './';
export default abstract class Layout extends Commander {
/**
* Create a layout.
*
* @param children The child views to contain.
*/
constructor(children: (Layout | Tracer)[]) {
super(arguments);
}
/**
* Set a view as the root view.
*
* @param root
*/
static setRoot(root: Layout | Tracer) {
this.command(null, 'setRoot', arguments);
}
/**
* Add a child to the layout.
*
* @param child
* @param index The index to add the child to.
*/
add(child: Layout | Tracer, index?: Number) {
this.command('add', arguments);
}
/**
* Remove a child from the layout.
*
* @param child
*/
remove(child: Layout | Tracer) {
this.command('remove', arguments);
}
/**
* Remove all the child views from the layout.
*/
removeAll() {
this.command('removeAll', arguments);
}
}