-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathview.d.ts
95 lines (80 loc) · 2.62 KB
/
view.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* tslint:disable */
/**
* Show a set of elements and hide their siblings.
*/
declare function view(selector: string, options?: view.Options);
declare function view(target: Node, options?: view.Options);
declare function view(targets: Node[], options?: view.Options);
declare function view(targets: NodeList, options?: view.Options);
declare module view {
interface Options {
/**
* Provide data to be exposed via `event.detail.data` of the `view:show` event.
*/
data?: any;
/**
* Ensure all ancestors of matched elements are also visible.
*/
deep?: boolean;
}
/**
* Show elements without hiding others.
*/
function show(selector: string, options?: Options);
function show(target: Node, options?: Options);
function show(targets: Node[], options?: Options);
function show(targets: NodeList, options?: Options);
/**
* Hide elements without showing others.
*/
function hide(selector: string);
function hide(target: Node);
function hide(targets: Node[]);
function hide(targets: NodeList);
/**
* Toggle the visibility of elements without affecting siblings.
*/
function toggle(selector: string, options?: Options);
function toggle(target: Node, options?: Options);
function toggle(targets: Node[], options?: Options);
function toggle(targets: NodeList, options?: Options);
/**
* Obtain a `view` scoped to a given root.
*/
function scope(root: Element): view;
}
interface view {
/**
* Show a set of elements and hide their siblings.
*/
(selector: string, options?: view.Options);
(target: Node, options?: view.Options);
(targets: Node[], options?: view.Options);
(targets: NodeList, options?: view.Options);
/**
* Show elements without hiding others.
*/
show(selector: string, options?: view.Options);
show(target: Node, options?: view.Options);
show(targets: Node[], options?: view.Options);
show(targets: NodeList, options?: view.Options);
/**
* Hide elements without showing others.
*/
hide(selector: string);
hide(target: Node);
hide(targets: Node[]);
hide(targets: NodeList);
/**
* Toggle the visibility of elements without affecting siblings.
*/
toggle(selector: string, options?: view.Options);
toggle(target: Node, options?: view.Options);
toggle(targets: Node[], options?: view.Options);
toggle(targets: NodeList, options?: view.Options);
/**
* Obtain a `view` scoped to a given root.
*/
scope(root: Element): view;
}
export = view;