vasille 1.2.6 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/LICENSE.md +21 -0
  2. package/flow-typed/vasille.js +836 -0
  3. package/img/favicon.svg +17 -204
  4. package/lib/binding/attribute.js +32 -0
  5. package/lib/binding/binding.js +39 -0
  6. package/lib/binding/class.js +51 -0
  7. package/lib/binding/style.js +29 -0
  8. package/lib/core/core.js +178 -0
  9. package/lib/core/destroyable.js +45 -0
  10. package/lib/core/errors.js +16 -0
  11. package/lib/core/executor.js +154 -0
  12. package/lib/core/ivalue.js +56 -0
  13. package/lib/core/signal.js +50 -0
  14. package/lib/core/slot.js +47 -0
  15. package/lib/index.js +27 -22
  16. package/lib/models/array-model.js +208 -0
  17. package/lib/models/listener.js +130 -0
  18. package/lib/models/map-model.js +66 -0
  19. package/lib/models/model.js +1 -0
  20. package/lib/models/object-model.js +78 -0
  21. package/lib/models/set-model.js +62 -0
  22. package/lib/node/app.js +38 -0
  23. package/lib/node/interceptor.js +83 -0
  24. package/lib/node/node.js +1185 -0
  25. package/lib/node/watch.js +27 -0
  26. package/lib/value/expression.js +83 -0
  27. package/lib/value/mirror.js +58 -0
  28. package/lib/value/pointer.js +26 -0
  29. package/lib/value/reference.js +55 -0
  30. package/lib/views/array-view.js +24 -0
  31. package/lib/views/base-view.js +49 -0
  32. package/lib/views/map-view.js +20 -0
  33. package/lib/views/object-view.js +20 -0
  34. package/lib/views/repeat-node.js +106 -0
  35. package/lib/views/repeater.js +63 -0
  36. package/lib/views/set-view.js +23 -0
  37. package/package.json +16 -15
  38. package/types/binding/attribute.d.ts +23 -0
  39. package/types/binding/binding.d.ts +30 -0
  40. package/types/binding/class.d.ts +23 -0
  41. package/types/binding/style.d.ts +23 -0
  42. package/types/core/core.d.ts +140 -0
  43. package/types/core/destroyable.d.ts +15 -0
  44. package/types/core/errors.d.ts +4 -0
  45. package/types/core/executor.d.ts +87 -0
  46. package/types/core/ivalue.d.ts +45 -0
  47. package/types/core/signal.d.ts +35 -0
  48. package/types/core/slot.d.ts +45 -0
  49. package/types/index.d.ts +27 -21
  50. package/types/models/array-model.d.ts +103 -0
  51. package/types/models/listener.d.ts +74 -0
  52. package/types/models/map-model.d.ts +35 -0
  53. package/types/models/model.d.ts +19 -0
  54. package/types/models/object-model.d.ts +36 -0
  55. package/types/models/set-model.d.ts +34 -0
  56. package/types/node/app.d.ts +37 -0
  57. package/types/node/interceptor.d.ts +50 -0
  58. package/types/node/node.d.ts +739 -0
  59. package/types/node/watch.d.ts +23 -0
  60. package/types/value/expression.d.ts +60 -0
  61. package/types/value/mirror.d.ts +35 -0
  62. package/types/value/pointer.d.ts +19 -0
  63. package/types/value/reference.d.ts +30 -0
  64. package/types/views/array-view.d.ts +13 -0
  65. package/types/views/base-view.d.ts +44 -0
  66. package/types/views/map-view.d.ts +11 -0
  67. package/types/views/object-view.d.ts +11 -0
  68. package/types/views/repeat-node.d.ts +35 -0
  69. package/types/views/repeater.d.ts +38 -0
  70. package/types/views/set-view.d.ts +11 -0
  71. package/CHANGELOG.md +0 -23
  72. package/lib/attribute.js +0 -71
  73. package/lib/attribute.js.map +0 -1
  74. package/lib/bind.js +0 -286
  75. package/lib/bind.js.map +0 -1
  76. package/lib/class.js +0 -97
  77. package/lib/class.js.map +0 -1
  78. package/lib/executor.js +0 -167
  79. package/lib/executor.js.map +0 -1
  80. package/lib/index.js.map +0 -1
  81. package/lib/interfaces/core.js +0 -247
  82. package/lib/interfaces/core.js.map +0 -1
  83. package/lib/interfaces/destroyable.js +0 -39
  84. package/lib/interfaces/destroyable.js.map +0 -1
  85. package/lib/interfaces/errors.js +0 -49
  86. package/lib/interfaces/errors.js.map +0 -1
  87. package/lib/interfaces/ibind.js +0 -31
  88. package/lib/interfaces/ibind.js.map +0 -1
  89. package/lib/interfaces/idefinition.js +0 -64
  90. package/lib/interfaces/idefinition.js.map +0 -1
  91. package/lib/interfaces/ivalue.js +0 -60
  92. package/lib/interfaces/ivalue.js.map +0 -1
  93. package/lib/models.js +0 -579
  94. package/lib/models.js.map +0 -1
  95. package/lib/node.js +0 -2155
  96. package/lib/node.js.map +0 -1
  97. package/lib/property.js +0 -38
  98. package/lib/property.js.map +0 -1
  99. package/lib/style.js +0 -66
  100. package/lib/style.js.map +0 -1
  101. package/lib/value.js +0 -203
  102. package/lib/value.js.map +0 -1
  103. package/lib/views.js +0 -688
  104. package/lib/views.js.map +0 -1
  105. package/types/attribute.d.ts +0 -18
  106. package/types/bind.d.ts +0 -72
  107. package/types/class.d.ts +0 -19
  108. package/types/data.d.ts +0 -11
  109. package/types/event.d.ts +0 -10
  110. package/types/executor.d.ts +0 -57
  111. package/types/interfaces/core.d.ts +0 -129
  112. package/types/interfaces/destroyable.d.ts +0 -11
  113. package/types/interfaces/errors.d.ts +0 -24
  114. package/types/interfaces/ibind.d.ts +0 -19
  115. package/types/interfaces/idefinition.d.ts +0 -29
  116. package/types/interfaces/ivalue.d.ts +0 -40
  117. package/types/models.d.ts +0 -179
  118. package/types/node.d.ts +0 -906
  119. package/types/property.d.ts +0 -9
  120. package/types/style.d.ts +0 -28
  121. package/types/value.d.ts +0 -43
  122. package/types/views.d.ts +0 -135
@@ -0,0 +1,739 @@
1
+ import { Reactive, ReactivePrivate } from "../core/core";
2
+ import { IValue } from "../core/ivalue";
3
+ import type { AppNode } from "./app";
4
+ /**
5
+ * Represents a Vasille.js node
6
+ * @class FragmentPrivate
7
+ * @extends ReactivePrivate
8
+ */
9
+ export declare class FragmentPrivate extends ReactivePrivate {
10
+ /**
11
+ * The app node
12
+ * @type {AppNode}
13
+ */
14
+ app: AppNode;
15
+ /**
16
+ * Parent node
17
+ * @type {Fragment}
18
+ */
19
+ parent: Fragment;
20
+ /**
21
+ * Next node
22
+ * @type {?Fragment}
23
+ */
24
+ next?: Fragment;
25
+ /**
26
+ * Previous node
27
+ * @type {?Fragment}
28
+ */
29
+ prev?: Fragment;
30
+ constructor();
31
+ /**
32
+ * Pre-initializes the base of a fragment
33
+ * @param app {App} the app node
34
+ * @param parent {Fragment} the parent node
35
+ */
36
+ preinit(app: AppNode, parent: Fragment): void;
37
+ /**
38
+ * Unlinks all bindings
39
+ */
40
+ $destroy(): void;
41
+ }
42
+ /**
43
+ * This class is symbolic
44
+ * @extends Reactive
45
+ */
46
+ export declare class Fragment extends Reactive {
47
+ /**
48
+ * Private part
49
+ * @protected
50
+ */
51
+ protected $: FragmentPrivate;
52
+ /**
53
+ * The children list
54
+ * @type Array
55
+ */
56
+ $children: Array<Fragment>;
57
+ /**
58
+ * Constructs a Vasille Node
59
+ * @param $ {FragmentPrivate}
60
+ */
61
+ constructor($?: FragmentPrivate);
62
+ /**
63
+ * Gets the app of node
64
+ */
65
+ get app(): AppNode;
66
+ /**
67
+ * Prepare to init fragment
68
+ * @param app {AppNode} app of node
69
+ * @param parent {Fragment} parent of node
70
+ * @param data {*} additional data
71
+ */
72
+ $preinit(app: AppNode, parent: Fragment, data?: unknown): void;
73
+ /**
74
+ * Initialize node
75
+ */
76
+ $init(): this;
77
+ /** To be overloaded: created event handler */
78
+ $created(): void;
79
+ /** To be overloaded: mounted event handler */
80
+ $mounted(): void;
81
+ /** To be overloaded: ready event handler */
82
+ $ready(): void;
83
+ /** To be overloaded: signals creation milestone */
84
+ $createSignals(): void;
85
+ /** To be overloaded: watchers creation milestone */
86
+ $createWatchers(): void;
87
+ /** To be overloaded: DOM creation milestone */
88
+ $compose(): void;
89
+ /**
90
+ * Pushes a node to children immediately
91
+ * @param node {Fragment} A node to push
92
+ * @protected
93
+ */
94
+ protected $$pushNode(node: Fragment): void;
95
+ /**
96
+ * Find first node in element if so exists
97
+ * @return {?Element}
98
+ * @protected
99
+ */
100
+ protected $$findFirstChild(): Node;
101
+ /**
102
+ * Append a node to end of element
103
+ * @param node {Node} node to insert
104
+ */
105
+ $$appendNode(node: Node): void;
106
+ /**
107
+ * Insert a node as a sibling of this
108
+ * @param node {Node} node to insert
109
+ */
110
+ $$insertAdjacent(node: Node): void;
111
+ /**
112
+ * Defines a text fragment
113
+ * @param text {String | IValue} A text fragment string
114
+ * @param cb {function (TextNode)} Callback if previous is slot name
115
+ */
116
+ $text(text: string | IValue<string>, cb?: (text: TextNode) => void): this;
117
+ $debug(text: IValue<string>): this;
118
+ /**
119
+ * Defines a tag element
120
+ * @param tagName {String} the tag name
121
+ * @param cb {function(Tag, *)} callback
122
+ */
123
+ $tag<K extends keyof HTMLElementTagNameMap>(tagName: K, cb?: (node: Tag, element: HTMLElementTagNameMap[K]) => void): this;
124
+ $tag<K extends keyof SVGElementTagNameMap>(tagName: K, cb?: (node: Tag, element: SVGElementTagNameMap[K]) => void): this;
125
+ $tag(tagName: string, cb?: (node: Tag, element: Element) => void): this;
126
+ /**
127
+ * Defines a custom element
128
+ * @param node {Fragment} vasille element to insert
129
+ * @param callback {function($ : *)}
130
+ */
131
+ $create<T extends Fragment>(node: T, callback?: ($: T) => void): this;
132
+ /**
133
+ * Defines an if node
134
+ * @param cond {IValue} condition
135
+ * @param cb {function(Fragment)} callback to run on true
136
+ * @return {this}
137
+ */
138
+ $if(cond: IValue<boolean>, cb: (node: Fragment) => void): this;
139
+ /**
140
+ * Defines a if-else node
141
+ * @param ifCond {IValue} `if` condition
142
+ * @param ifCb {function(Fragment)} Call-back to create `if` child nodes
143
+ * @param elseCb {function(Fragment)} Call-back to create `else` child nodes
144
+ */
145
+ $if_else(ifCond: IValue<boolean>, ifCb: (node: Fragment) => void, elseCb: (node: Fragment) => void): this;
146
+ /**
147
+ * Defines a switch nodes: Will break after first true condition
148
+ * @param cases {...{ cond : IValue, cb : function(Fragment) }} cases
149
+ * @return {INode}
150
+ */
151
+ $switch(...cases: Array<{
152
+ cond: IValue<boolean>;
153
+ cb: (node: Fragment) => void;
154
+ }>): this;
155
+ /**
156
+ * Create a case for switch
157
+ * @param cond {IValue<boolean>}
158
+ * @param cb {function(Fragment) : void}
159
+ * @return {{cond : IValue, cb : (function(Fragment) : void)}}
160
+ */
161
+ $case(cond: IValue<boolean>, cb: (node: Fragment) => void): {
162
+ cond: IValue<boolean>;
163
+ cb: (node: Fragment) => void;
164
+ };
165
+ /**
166
+ * @param cb {(function(Fragment) : void)}
167
+ * @return {{cond : IValue, cb : (function(Fragment) : void)}}
168
+ */
169
+ $default(cb: (node: Fragment) => void): {
170
+ cond: IValue<boolean>;
171
+ cb: (node: Fragment) => void;
172
+ };
173
+ $destroy(): void;
174
+ }
175
+ /**
176
+ * The private part of a text node
177
+ * @class TextNodePrivate
178
+ * @extends FragmentPrivate
179
+ */
180
+ export declare class TextNodePrivate extends FragmentPrivate {
181
+ node: Text;
182
+ constructor();
183
+ /**
184
+ * Pre-initializes a text node
185
+ * @param app {AppNode} the app node
186
+ * @param text {IValue}
187
+ */
188
+ preinitText(app: AppNode, parent: Fragment, text: IValue<string>): void;
189
+ /**
190
+ * Clear node data
191
+ */
192
+ $destroy(): void;
193
+ }
194
+ /**
195
+ * Represents a text node
196
+ * @class TextNode
197
+ * @extends Fragment
198
+ */
199
+ export declare class TextNode extends Fragment {
200
+ protected $: TextNodePrivate;
201
+ constructor();
202
+ $preinit(app: AppNode, parent: Fragment, text?: IValue<string>): void;
203
+ protected $$findFirstChild(): Node;
204
+ $destroy(): void;
205
+ }
206
+ /**
207
+ * The private part of a base node
208
+ * @class INodePrivate
209
+ * @extends FragmentPrivate
210
+ */
211
+ export declare class INodePrivate extends FragmentPrivate {
212
+ /**
213
+ * Defines if node is unmounted
214
+ * @type {boolean}
215
+ */
216
+ unmounted: boolean;
217
+ /**
218
+ * The element of vasille node
219
+ * @type Element
220
+ */
221
+ node: Element;
222
+ constructor();
223
+ $destroy(): void;
224
+ }
225
+ /**
226
+ * Vasille node which can manipulate an element node
227
+ * @class INode
228
+ * @extends Fragment
229
+ */
230
+ export declare class INode extends Fragment {
231
+ protected $: INodePrivate;
232
+ /**
233
+ * Constructs a base node
234
+ * @param $ {?INodePrivate}
235
+ */
236
+ constructor($?: INodePrivate);
237
+ /**
238
+ * Get the bound node
239
+ */
240
+ get node(): Element;
241
+ /**
242
+ * Initialize node
243
+ */
244
+ $init(): this;
245
+ /** To be overloaded: attributes creation milestone */
246
+ $createAttrs(): void;
247
+ /** To be overloaded: $style attributes creation milestone */
248
+ $createStyle(): void;
249
+ /**
250
+ * Bind attribute value
251
+ * @param name {String} name of attribute
252
+ * @param value {IValue} value
253
+ */
254
+ $attr(name: string, value: IValue<string>): this;
255
+ /**
256
+ * Creates and binds a multivalued binding to attribute
257
+ * @param name {String} The name of attribute
258
+ * @param calculator {Function} Binding calculator (must return a value)
259
+ * @param v1 {*} argument
260
+ * @param v2 {*} argument
261
+ * @param v3 {*} argument
262
+ * @param v4 {*} argument
263
+ * @param v5 {*} argument
264
+ * @param v6 {*} argument
265
+ * @param v7 {*} argument
266
+ * @param v8 {*} argument
267
+ * @param v9 {*} argument
268
+ * @return {INode} A pointer to this
269
+ */
270
+ $bindAttr<T1>(name: string, calculator: (a1: T1) => string, v1: IValue<T1>, v2?: IValue<void>, v3?: IValue<void>, v4?: IValue<void>, v5?: IValue<void>, v6?: IValue<void>, v7?: IValue<void>, v8?: IValue<void>, v9?: IValue<void>): this;
271
+ $bindAttr<T1, T2>(name: string, calculator: (a1: T1, a2: T2) => string, v1: IValue<T1>, v2: IValue<T2>, v3?: IValue<void>, v4?: IValue<void>, v5?: IValue<void>, v6?: IValue<void>, v7?: IValue<void>, v8?: IValue<void>, v9?: IValue<void>): this;
272
+ $bindAttr<T1, T2, T3>(name: string, calculator: (a1: T1, a2: T2, a3: T3) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4?: IValue<void>, v5?: IValue<void>, v6?: IValue<void>, v7?: IValue<void>, v8?: IValue<void>, v9?: IValue<void>): this;
273
+ $bindAttr<T1, T2, T3, T4>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>, v5?: IValue<void>, v6?: IValue<void>, v7?: IValue<void>, v8?: IValue<void>, v9?: IValue<void>): this;
274
+ $bindAttr<T1, T2, T3, T4, T5>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>, v5: IValue<T5>, v6?: IValue<void>, v7?: IValue<void>, v8?: IValue<void>, v9?: IValue<void>): this;
275
+ $bindAttr<T1, T2, T3, T4, T5, T6>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>, v5: IValue<T5>, v6: IValue<T6>, v7?: IValue<void>, v8?: IValue<void>, v9?: IValue<void>): this;
276
+ $bindAttr<T1, T2, T3, T4, T5, T6, T7>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>, v5: IValue<T5>, v6: IValue<T6>, v7: IValue<T7>, v8?: IValue<void>, v9?: IValue<void>): this;
277
+ $bindAttr<T1, T2, T3, T4, T5, T6, T7, T8>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>, v5: IValue<T5>, v6: IValue<T6>, v7: IValue<T7>, v8: IValue<T8>, v9?: IValue<void>): this;
278
+ $bindAttr<T1, T2, T3, T4, T5, T6, T7, T8, T9>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>, v5: IValue<T5>, v6: IValue<T6>, v7: IValue<T7>, v8: IValue<T8>, v9: IValue<T9>): this;
279
+ /**
280
+ * Set attribute value
281
+ * @param name {string} name of attribute
282
+ * @param value {string} value
283
+ */
284
+ $setAttr(name: string, value: string): this;
285
+ /**
286
+ * Adds a CSS class
287
+ * @param cl {string} Class name
288
+ */
289
+ $addClass(cl: string): this;
290
+ /**
291
+ * Adds some CSS classes
292
+ * @param cls {...string} classes names
293
+ */
294
+ $addClasses(...cls: Array<string>): this;
295
+ /**
296
+ * Bind a CSS class
297
+ * @param className {IValue}
298
+ */
299
+ $bindClass(className: IValue<string>): this;
300
+ /**
301
+ * Bind a floating class name
302
+ * @param cond {IValue} condition
303
+ * @param className {string} class name
304
+ */
305
+ $floatingClass(cond: IValue<boolean>, className: string): this;
306
+ /**
307
+ * Defines a style attribute
308
+ * @param name {String} name of style attribute
309
+ * @param value {IValue} value
310
+ */
311
+ $style(name: string, value: IValue<string>): this;
312
+ /**
313
+ * Binds style property value
314
+ * @param name {string} name of style attribute
315
+ * @param calculator {function} calculator for style value
316
+ * @param v1 {*} argument
317
+ * @param v2 {*} argument
318
+ * @param v3 {*} argument
319
+ * @param v4 {*} argument
320
+ * @param v5 {*} argument
321
+ * @param v6 {*} argument
322
+ * @param v7 {*} argument
323
+ * @param v8 {*} argument
324
+ * @param v9 {*} argument
325
+ */
326
+ $bindStyle<T1>(name: string, calculator: (a1: T1) => string, v1: IValue<T1>): this;
327
+ $bindStyle<T1, T2>(name: string, calculator: (a1: T1, a2: T2) => string, v1: IValue<T1>, v2: IValue<T2>): this;
328
+ $bindStyle<T1, T2, T3>(name: string, calculator: (a1: T1, a2: T2, a3: T3) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>): this;
329
+ $bindStyle<T1, T2, T3, T4>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>): this;
330
+ $bindStyle<T1, T2, T3, T4, T5>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>, v5: IValue<T5>): this;
331
+ $bindStyle<T1, T2, T3, T4, T5, T6>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>, v5: IValue<T5>, v6: IValue<T6>): this;
332
+ $bindStyle<T1, T2, T3, T4, T5, T6, T7>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>, v5: IValue<T5>, v6: IValue<T6>, v7: IValue<T7>): this;
333
+ $bindStyle<T1, T2, T3, T4, T5, T6, T7, T8>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>, v5: IValue<T5>, v6: IValue<T6>, v7: IValue<T7>, v8: IValue<T8>): this;
334
+ $bindStyle<T1, T2, T3, T4, T5, T6, T7, T8, T9>(name: string, calculator: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9) => string, v1: IValue<T1>, v2: IValue<T2>, v3: IValue<T3>, v4: IValue<T4>, v5: IValue<T5>, v6: IValue<T6>, v7: IValue<T7>, v8: IValue<T8>, v9: IValue<T9>): this;
335
+ /**
336
+ * Sets a style property value
337
+ * @param prop {string} Property name
338
+ * @param value {string} Property value
339
+ */
340
+ $setStyle(prop: string, value: string): this;
341
+ /**
342
+ * Add a listener for an event
343
+ * @param name {string} Event name
344
+ * @param handler {function (Event)} Event handler
345
+ * @param options {Object | boolean} addEventListener options
346
+ */
347
+ $listen(name: string, handler: (ev: Event) => void, options?: boolean | AddEventListenerOptions): this;
348
+ /**
349
+ * @param handler {function (MouseEvent)}
350
+ * @param options {Object | boolean}
351
+ */
352
+ $oncontextmenu(handler: (ev: MouseEvent) => void, options?: boolean | AddEventListenerOptions): this;
353
+ /**
354
+ * @param handler {function (MouseEvent)}
355
+ * @param options {Object | boolean}
356
+ */
357
+ $onmousedown(handler: (ev: MouseEvent) => void, options?: boolean | AddEventListenerOptions): this;
358
+ /**
359
+ * @param handler {function (MouseEvent)}
360
+ * @param options {Object | boolean}
361
+ */
362
+ $onmouseenter(handler: (ev: MouseEvent) => void, options?: boolean | AddEventListenerOptions): this;
363
+ /**
364
+ * @param handler {function (MouseEvent)}
365
+ * @param options {Object | boolean}
366
+ */
367
+ $onmouseleave(handler: (ev: MouseEvent) => void, options?: boolean | AddEventListenerOptions): this;
368
+ /**
369
+ * @param handler {function (MouseEvent)}
370
+ * @param options {Object | boolean}
371
+ */
372
+ $onmousemove(handler: (ev: MouseEvent) => void, options?: boolean | AddEventListenerOptions): this;
373
+ /**
374
+ * @param handler {function (MouseEvent)}
375
+ * @param options {Object | boolean}
376
+ */
377
+ $onmouseout(handler: (ev: MouseEvent) => void, options?: boolean | AddEventListenerOptions): this;
378
+ /**
379
+ * @param handler {function (MouseEvent)}
380
+ * @param options {Object | boolean}
381
+ */
382
+ $onmouseover(handler: (ev: MouseEvent) => void, options?: boolean | AddEventListenerOptions): this;
383
+ /**
384
+ * @param handler {function (MouseEvent)}
385
+ * @param options {Object | boolean}
386
+ */
387
+ $onmouseup(handler: (ev: MouseEvent) => void, options?: boolean | AddEventListenerOptions): this;
388
+ /**
389
+ * @param handler {function (MouseEvent)}
390
+ * @param options {Object | boolean}
391
+ */
392
+ $onclick(handler: (ev: MouseEvent) => void, options?: boolean | AddEventListenerOptions): this;
393
+ /**
394
+ * @param handler {function (MouseEvent)}
395
+ * @param options {Object | boolean}
396
+ */
397
+ $ondblclick(handler: (ev: MouseEvent) => void, options?: boolean | AddEventListenerOptions): this;
398
+ /**
399
+ * @param handler {function (FocusEvent)}
400
+ * @param options {Object | boolean}
401
+ */
402
+ $onblur(handler: (ev: FocusEvent) => void, options?: boolean | AddEventListenerOptions): this;
403
+ /**
404
+ * @param handler {function (FocusEvent)}
405
+ * @param options {Object | boolean}
406
+ */
407
+ $onfocus(handler: (ev: FocusEvent) => void, options?: boolean | AddEventListenerOptions): this;
408
+ /**
409
+ * @param handler {function (FocusEvent)}
410
+ * @param options {Object | boolean}
411
+ */
412
+ $onfocusin(handler: (ev: FocusEvent) => void, options?: boolean | AddEventListenerOptions): this;
413
+ /**
414
+ * @param handler {function (FocusEvent)}
415
+ * @param options {Object | boolean}
416
+ */
417
+ $onfocusout(handler: (ev: FocusEvent) => void, options?: boolean | AddEventListenerOptions): this;
418
+ /**
419
+ * @param handler {function (KeyboardEvent)}
420
+ * @param options {Object | boolean}
421
+ */
422
+ $onkeydown(handler: (ev: KeyboardEvent) => void, options?: boolean | AddEventListenerOptions): this;
423
+ /**
424
+ * @param handler {function (KeyboardEvent)}
425
+ * @param options {Object | boolean}
426
+ */
427
+ $onkeyup(handler: (ev: KeyboardEvent) => void, options?: boolean | AddEventListenerOptions): this;
428
+ /**
429
+ * @param handler {function (KeyboardEvent)}
430
+ * @param options {Object | boolean}
431
+ */
432
+ $onkeypress(handler: (ev: KeyboardEvent) => void, options?: boolean | AddEventListenerOptions): this;
433
+ /**
434
+ * @param handler {function (TouchEvent)}
435
+ * @param options {Object | boolean}
436
+ */
437
+ $ontouchstart(handler: (ev: TouchEvent) => void, options?: boolean | AddEventListenerOptions): this;
438
+ /**
439
+ * @param handler {function (TouchEvent)}
440
+ * @param options {Object | boolean}
441
+ */
442
+ $ontouchmove(handler: (ev: TouchEvent) => void, options?: boolean | AddEventListenerOptions): this;
443
+ /**
444
+ * @param handler {function (TouchEvent)}
445
+ * @param options {Object | boolean}
446
+ */
447
+ $ontouchend(handler: (ev: TouchEvent) => void, options?: boolean | AddEventListenerOptions): this;
448
+ /**
449
+ * @param handler {function (TouchEvent)}
450
+ * @param options {Object | boolean}
451
+ */
452
+ $ontouchcancel(handler: (ev: TouchEvent) => void, options?: boolean | AddEventListenerOptions): this;
453
+ /**
454
+ * @param handler {function (WheelEvent)}
455
+ * @param options {Object | boolean}
456
+ */
457
+ $onwheel(handler: (ev: WheelEvent) => void, options?: boolean | AddEventListenerOptions): this;
458
+ /**
459
+ * @param handler {function (ProgressEvent)}
460
+ * @param options {Object | boolean}
461
+ */
462
+ $onabort(handler: (ev: ProgressEvent) => void, options?: boolean | AddEventListenerOptions): this;
463
+ /**
464
+ * @param handler {function (ProgressEvent)}
465
+ * @param options {Object | boolean}
466
+ */
467
+ $onerror(handler: (ev: ProgressEvent) => void, options?: boolean | AddEventListenerOptions): this;
468
+ /**
469
+ * @param handler {function (ProgressEvent)}
470
+ * @param options {Object | boolean}
471
+ */
472
+ $onload(handler: (ev: ProgressEvent) => void, options?: boolean | AddEventListenerOptions): this;
473
+ /**
474
+ * @param handler {function (ProgressEvent)}
475
+ * @param options {Object | boolean}
476
+ */
477
+ $onloadend(handler: (ev: ProgressEvent) => void, options?: boolean | AddEventListenerOptions): this;
478
+ /**
479
+ * @param handler {function (ProgressEvent)}
480
+ * @param options {Object | boolean}
481
+ */
482
+ $onloadstart(handler: (ev: ProgressEvent) => void, options?: boolean | AddEventListenerOptions): this;
483
+ /**
484
+ * @param handler {function (ProgressEvent)}
485
+ * @param options {Object | boolean}
486
+ */
487
+ $onprogress(handler: (ev: ProgressEvent) => void, options?: boolean | AddEventListenerOptions): this;
488
+ /**
489
+ * @param handler {function (ProgressEvent)}
490
+ * @param options {Object | boolean}
491
+ */
492
+ $ontimeout(handler: (ev: ProgressEvent) => void, options?: boolean | AddEventListenerOptions): this;
493
+ /**
494
+ * @param handler {function (DragEvent)}
495
+ * @param options {Object | boolean}
496
+ */
497
+ $ondrag(handler: (ev: DragEvent) => void, options?: boolean | AddEventListenerOptions): this;
498
+ /**
499
+ * @param handler {function (DragEvent)}
500
+ * @param options {Object | boolean}
501
+ */
502
+ $ondragend(handler: (ev: DragEvent) => void, options?: boolean | AddEventListenerOptions): this;
503
+ /**
504
+ * @param handler {function (DragEvent)}
505
+ * @param options {Object | boolean}
506
+ */
507
+ $ondragenter(handler: (ev: DragEvent) => void, options?: boolean | AddEventListenerOptions): this;
508
+ /**
509
+ * @param handler {function (DragEvent)}
510
+ * @param options {Object | boolean}
511
+ */
512
+ $ondragexit(handler: (ev: DragEvent) => void, options?: boolean | AddEventListenerOptions): this;
513
+ /**
514
+ * @param handler {function (DragEvent)}
515
+ * @param options {Object | boolean}
516
+ */
517
+ $ondragleave(handler: (ev: DragEvent) => void, options?: boolean | AddEventListenerOptions): this;
518
+ /**
519
+ * @param handler {function (DragEvent)}
520
+ * @param options {Object | boolean}
521
+ */
522
+ $ondragover(handler: (ev: DragEvent) => void, options?: boolean | AddEventListenerOptions): this;
523
+ /**
524
+ * @param handler {function (DragEvent)}
525
+ * @param options {Object | boolean}
526
+ */
527
+ $ondragstart(handler: (ev: DragEvent) => void, options?: boolean | AddEventListenerOptions): this;
528
+ /**
529
+ * @param handler {function (DragEvent)}
530
+ * @param options {Object | boolean}
531
+ */
532
+ $ondrop(handler: (ev: DragEvent) => void, options?: boolean | AddEventListenerOptions): this;
533
+ /**
534
+ * @param handler {function (PointerEvent)}
535
+ * @param options {Object | boolean}
536
+ */
537
+ $onpointerover(handler: (ev: PointerEvent) => void, options?: boolean | AddEventListenerOptions): this;
538
+ /**
539
+ * @param handler {function (PointerEvent)}
540
+ * @param options {Object | boolean}
541
+ */
542
+ $onpointerenter(handler: (ev: PointerEvent) => void, options?: boolean | AddEventListenerOptions): this;
543
+ /**
544
+ * @param handler {function (PointerEvent)}
545
+ * @param options {Object | boolean}
546
+ */
547
+ $onpointerdown(handler: (ev: PointerEvent) => void, options?: boolean | AddEventListenerOptions): this;
548
+ /**
549
+ * @param handler {function (PointerEvent)}
550
+ * @param options {Object | boolean}
551
+ */
552
+ $onpointermove(handler: (ev: PointerEvent) => void, options?: boolean | AddEventListenerOptions): this;
553
+ /**
554
+ * @param handler {function (PointerEvent)}
555
+ * @param options {Object | boolean}
556
+ */
557
+ $onpointerup(handler: (ev: PointerEvent) => void, options?: boolean | AddEventListenerOptions): this;
558
+ /**
559
+ * @param handler {function (PointerEvent)}
560
+ * @param options {Object | boolean}
561
+ */
562
+ $onpointercancel(handler: (ev: PointerEvent) => void, options?: boolean | AddEventListenerOptions): this;
563
+ /**
564
+ * @param handler {function (PointerEvent)}
565
+ * @param options {Object | boolean}
566
+ */
567
+ $onpointerout(handler: (ev: PointerEvent) => void, options?: boolean | AddEventListenerOptions): this;
568
+ /**
569
+ * @param handler {function (PointerEvent)}
570
+ * @param options {Object | boolean}
571
+ */
572
+ $onpointerleave(handler: (ev: PointerEvent) => void, options?: boolean | AddEventListenerOptions): this;
573
+ /**
574
+ * @param handler {function (PointerEvent)}
575
+ * @param options {Object | boolean}
576
+ */
577
+ $ongotpointercapture(handler: (ev: PointerEvent) => void, options?: boolean | AddEventListenerOptions): this;
578
+ /**
579
+ * @param handler {function (PointerEvent)}
580
+ * @param options {Object | boolean}
581
+ */
582
+ $onlostpointercapture(handler: (ev: PointerEvent) => void, options?: boolean | AddEventListenerOptions): this;
583
+ /**
584
+ * @param handler {function (AnimationEvent)}
585
+ * @param options {Object | boolean}
586
+ */
587
+ $onanimationstart(handler: (ev: AnimationEvent) => void, options?: boolean | AddEventListenerOptions): this;
588
+ /**
589
+ * @param handler {function (AnimationEvent)}
590
+ * @param options {Object | boolean}
591
+ */
592
+ $onanimationend(handler: (ev: AnimationEvent) => void, options?: boolean | AddEventListenerOptions): this;
593
+ /**
594
+ * @param handler {function (AnimationEvent)}
595
+ * @param options {Object | boolean}
596
+ */
597
+ $onanimationiteraton(handler: (ev: AnimationEvent) => void, options?: boolean | AddEventListenerOptions): this;
598
+ /**
599
+ * @param handler {function (ClipboardEvent)}
600
+ * @param options {Object | boolean}
601
+ */
602
+ $onclipboardchange(handler: (ev: ClipboardEvent) => void, options?: boolean | AddEventListenerOptions): this;
603
+ /**
604
+ * @param handler {function (ClipboardEvent)}
605
+ * @param options {Object | boolean}
606
+ */
607
+ $oncut(handler: (ev: ClipboardEvent) => void, options?: boolean | AddEventListenerOptions): this;
608
+ /**
609
+ * @param handler {function (ClipboardEvent)}
610
+ * @param options {Object | boolean}
611
+ */
612
+ $oncopy(handler: (ev: ClipboardEvent) => void, options?: boolean | AddEventListenerOptions): this;
613
+ /**
614
+ * @param handler {function (ClipboardEvent)}
615
+ * @param options {Object | boolean}
616
+ */
617
+ $onpaste(handler: (ev: ClipboardEvent) => void, options?: boolean | AddEventListenerOptions): this;
618
+ $$insertAdjacent(node: Node): void;
619
+ /**
620
+ * A v-show & ngShow alternative
621
+ * @param cond {IValue} show condition
622
+ */
623
+ $bindShow(cond: IValue<boolean>): this;
624
+ /**
625
+ * bind HTML
626
+ * @param value {IValue}
627
+ */
628
+ $html(value: IValue<string>): void;
629
+ }
630
+ /**
631
+ * Represents an Vasille.js HTML element node
632
+ * @class Tag
633
+ * @extends INode
634
+ */
635
+ export declare class Tag extends INode {
636
+ constructor();
637
+ $preinit(app: AppNode, parent: Fragment, tagName?: string): void;
638
+ protected $$findFirstChild(): Node;
639
+ $$appendNode(node: Node): void;
640
+ /**
641
+ * Mount/Unmount a node
642
+ * @param cond {IValue} show condition
643
+ */
644
+ $bindMount(cond: IValue<boolean>): this;
645
+ /**
646
+ * Runs GC
647
+ */
648
+ $destroy(): void;
649
+ }
650
+ /**
651
+ * Represents a vasille extension node
652
+ * @class Extension
653
+ * @extends INode
654
+ */
655
+ export declare class Extension extends INode {
656
+ $preinit(app: AppNode, parent: Fragment): void;
657
+ constructor($?: INodePrivate);
658
+ $destroy(): void;
659
+ }
660
+ /**
661
+ * Node which cas has just a child
662
+ * @class Component
663
+ * @extends Extension
664
+ */
665
+ export declare class Component extends Extension {
666
+ constructor();
667
+ $mounted(): void;
668
+ }
669
+ /**
670
+ * Private part of switch node
671
+ * @class SwitchedNodePrivate
672
+ * @extends INodePrivate
673
+ */
674
+ export declare class SwitchedNodePrivate extends INodePrivate {
675
+ /**
676
+ * Index of current true condition
677
+ * @type number
678
+ */
679
+ index: number;
680
+ /**
681
+ * The unique child which can be absent
682
+ * @type Extension
683
+ */
684
+ fragment?: Fragment;
685
+ /**
686
+ * Array of possible cases
687
+ * @type {Array<{cond : IValue<boolean>, cb : function(Fragment)}>}
688
+ */
689
+ cases: {
690
+ cond: IValue<boolean>;
691
+ cb: (node: Fragment) => void;
692
+ }[];
693
+ /**
694
+ * A function which sync index and content, will be bounded to each condition
695
+ * @type {Function}
696
+ */
697
+ sync: () => void;
698
+ constructor();
699
+ /**
700
+ * Runs GC
701
+ */
702
+ $destroy(): void;
703
+ }
704
+ /**
705
+ * The private part of a text node
706
+ */
707
+ export declare class DebugPrivate extends FragmentPrivate {
708
+ node: Comment;
709
+ constructor();
710
+ /**
711
+ * Pre-initializes a text node
712
+ * @param app {App} the app node
713
+ * @param parent {Fragment} parent node
714
+ * @param text {String | IValue}
715
+ */
716
+ preinitComment(app: AppNode, parent: Fragment, text: IValue<string>): void;
717
+ /**
718
+ * Clear node data
719
+ */
720
+ $destroy(): void;
721
+ }
722
+ /**
723
+ * Represents a debug node
724
+ * @class DebugNode
725
+ * @extends Fragment
726
+ */
727
+ export declare class DebugNode extends Fragment {
728
+ /**
729
+ * private data
730
+ * @type {DebugNode}
731
+ */
732
+ protected $: DebugPrivate;
733
+ constructor();
734
+ $preinit(app: AppNode, parent: Fragment, text?: IValue<string>): void;
735
+ /**
736
+ * Runs garbage collector
737
+ */
738
+ $destroy(): void;
739
+ }