vasille 1.2.8 → 2.0.2

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 (151) hide show
  1. package/.gitlab-ci.yml +20 -0
  2. package/LICENSE.md +21 -0
  3. package/README.md +160 -119
  4. package/cdn/es2015.js +3221 -0
  5. package/cdn/es5.js +3673 -0
  6. package/flow-typed/vasille.js +837 -0
  7. package/lib/binding/attribute.js +32 -0
  8. package/lib/binding/binding.js +39 -0
  9. package/lib/binding/class.js +51 -0
  10. package/lib/binding/style.js +29 -0
  11. package/lib/core/core.js +178 -0
  12. package/lib/core/destroyable.js +45 -0
  13. package/lib/core/errors.js +16 -0
  14. package/lib/core/executor.js +154 -0
  15. package/lib/core/ivalue.js +56 -0
  16. package/lib/core/signal.js +50 -0
  17. package/lib/core/slot.js +47 -0
  18. package/lib/index.js +27 -22
  19. package/lib/models/array-model.js +208 -0
  20. package/lib/models/listener.js +130 -0
  21. package/lib/models/map-model.js +66 -0
  22. package/lib/models/model.js +1 -0
  23. package/lib/models/object-model.js +78 -0
  24. package/lib/models/set-model.js +62 -0
  25. package/lib/node/app.js +38 -0
  26. package/lib/node/interceptor.js +83 -0
  27. package/lib/node/node.js +1202 -0
  28. package/lib/node/watch.js +27 -0
  29. package/lib/value/expression.js +83 -0
  30. package/lib/value/mirror.js +58 -0
  31. package/lib/value/pointer.js +26 -0
  32. package/lib/value/reference.js +55 -0
  33. package/lib/views/array-view.js +23 -0
  34. package/lib/views/base-view.js +49 -0
  35. package/lib/views/map-view.js +20 -0
  36. package/lib/views/object-view.js +20 -0
  37. package/lib/views/repeat-node.js +106 -0
  38. package/lib/views/repeater.js +63 -0
  39. package/lib/views/set-view.js +23 -0
  40. package/package.json +27 -19
  41. package/types/binding/attribute.d.ts +23 -0
  42. package/types/binding/binding.d.ts +30 -0
  43. package/types/binding/class.d.ts +23 -0
  44. package/types/binding/style.d.ts +23 -0
  45. package/types/core/core.d.ts +140 -0
  46. package/types/core/destroyable.d.ts +15 -0
  47. package/types/core/errors.d.ts +4 -0
  48. package/types/core/executor.d.ts +87 -0
  49. package/types/core/ivalue.d.ts +45 -0
  50. package/types/core/signal.d.ts +35 -0
  51. package/types/core/slot.d.ts +45 -0
  52. package/types/index.d.ts +27 -21
  53. package/types/models/array-model.d.ts +103 -0
  54. package/types/models/listener.d.ts +74 -0
  55. package/types/models/map-model.d.ts +35 -0
  56. package/types/models/model.d.ts +19 -0
  57. package/types/models/object-model.d.ts +36 -0
  58. package/types/models/set-model.d.ts +34 -0
  59. package/types/node/app.d.ts +37 -0
  60. package/types/node/interceptor.d.ts +50 -0
  61. package/types/node/node.d.ts +741 -0
  62. package/types/node/watch.d.ts +23 -0
  63. package/types/value/expression.d.ts +60 -0
  64. package/types/value/mirror.d.ts +35 -0
  65. package/types/value/pointer.d.ts +19 -0
  66. package/types/value/reference.d.ts +30 -0
  67. package/types/views/array-view.d.ts +13 -0
  68. package/types/views/base-view.d.ts +43 -0
  69. package/types/views/map-view.d.ts +11 -0
  70. package/types/views/object-view.d.ts +11 -0
  71. package/types/views/repeat-node.d.ts +35 -0
  72. package/types/views/repeater.d.ts +38 -0
  73. package/types/views/set-view.d.ts +11 -0
  74. package/CHANGELOG.md +0 -23
  75. package/img/favicon.svg +0 -441
  76. package/img/getLocus.svg +0 -18
  77. package/img/logo.png +0 -0
  78. package/img/logo.svg +0 -550
  79. package/img/scores-o-log.png +0 -0
  80. package/img/scores-o.png +0 -0
  81. package/img/scores-wo-log.png +0 -0
  82. package/img/scores-wo.png +0 -0
  83. package/img/x1-x32.png +0 -0
  84. package/lib/attribute.js +0 -71
  85. package/lib/attribute.js.map +0 -1
  86. package/lib/bind.js +0 -286
  87. package/lib/bind.js.map +0 -1
  88. package/lib/class.js +0 -97
  89. package/lib/class.js.map +0 -1
  90. package/lib/executor.js +0 -167
  91. package/lib/executor.js.map +0 -1
  92. package/lib/index.js.map +0 -1
  93. package/lib/interfaces/core.js +0 -247
  94. package/lib/interfaces/core.js.map +0 -1
  95. package/lib/interfaces/destroyable.js +0 -39
  96. package/lib/interfaces/destroyable.js.map +0 -1
  97. package/lib/interfaces/errors.js +0 -49
  98. package/lib/interfaces/errors.js.map +0 -1
  99. package/lib/interfaces/ibind.js +0 -31
  100. package/lib/interfaces/ibind.js.map +0 -1
  101. package/lib/interfaces/idefinition.js +0 -64
  102. package/lib/interfaces/idefinition.js.map +0 -1
  103. package/lib/interfaces/ivalue.js +0 -60
  104. package/lib/interfaces/ivalue.js.map +0 -1
  105. package/lib/models.js +0 -579
  106. package/lib/models.js.map +0 -1
  107. package/lib/node.js +0 -2155
  108. package/lib/node.js.map +0 -1
  109. package/lib/property.js +0 -38
  110. package/lib/property.js.map +0 -1
  111. package/lib/style.js +0 -66
  112. package/lib/style.js.map +0 -1
  113. package/lib/value.js +0 -203
  114. package/lib/value.js.map +0 -1
  115. package/lib/views.js +0 -688
  116. package/lib/views.js.map +0 -1
  117. package/src/attribute.js +0 -70
  118. package/src/bind.js +0 -285
  119. package/src/class.js +0 -96
  120. package/src/executor.js +0 -165
  121. package/src/index.js +0 -20
  122. package/src/interfaces/core.js +0 -248
  123. package/src/interfaces/destroyable.js +0 -37
  124. package/src/interfaces/errors.js +0 -47
  125. package/src/interfaces/ibind.js +0 -29
  126. package/src/interfaces/idefinition.js +0 -62
  127. package/src/interfaces/ivalue.js +0 -58
  128. package/src/models.js +0 -577
  129. package/src/node.js +0 -2162
  130. package/src/property.js +0 -36
  131. package/src/style.js +0 -65
  132. package/src/value.js +0 -201
  133. package/src/views.js +0 -686
  134. package/types/attribute.d.ts +0 -18
  135. package/types/bind.d.ts +0 -72
  136. package/types/class.d.ts +0 -19
  137. package/types/data.d.ts +0 -11
  138. package/types/event.d.ts +0 -10
  139. package/types/executor.d.ts +0 -57
  140. package/types/interfaces/core.d.ts +0 -129
  141. package/types/interfaces/destroyable.d.ts +0 -11
  142. package/types/interfaces/errors.d.ts +0 -24
  143. package/types/interfaces/ibind.d.ts +0 -19
  144. package/types/interfaces/idefinition.d.ts +0 -29
  145. package/types/interfaces/ivalue.d.ts +0 -40
  146. package/types/models.d.ts +0 -179
  147. package/types/node.d.ts +0 -906
  148. package/types/property.d.ts +0 -9
  149. package/types/style.d.ts +0 -28
  150. package/types/value.d.ts +0 -43
  151. package/types/views.d.ts +0 -135
package/types/node.d.ts DELETED
@@ -1,906 +0,0 @@
1
- /**
2
- * The private part of a text node
3
- */
4
- export class TextNodePrivate extends VasilleNodePrivate {
5
- /**
6
- * Contains the text of node as Reference
7
- * @type {IValue}
8
- */
9
- value: IValue;
10
- /**
11
- * User defined handler to handle text change
12
- * @type {Function}
13
- */
14
- handler: Function;
15
- /**
16
- * Pre-initializes a text node
17
- * @param app {App} the app node
18
- * @param rt {INode} The root node
19
- * @param ts {INode} The this node
20
- * @param before {?VasilleNode} node to paste after
21
- * @param text {String | IValue}
22
- */
23
- preinitText(app: App, rt: INode, ts: INode, before: VasilleNode | null, text: string | IValue): void;
24
- }
25
- /**
26
- * Represents a text node
27
- */
28
- export class TextNode extends VasilleNode {
29
- /**
30
- * Constructs a text node
31
- */
32
- constructor();
33
- /**
34
- * Pointer to text node
35
- * @type {Text}
36
- */
37
- node: Text;
38
- /**
39
- * Pre-initializes a text node
40
- * @param app {App} the app node
41
- * @param rt {INode} The root node
42
- * @param ts {INode} The this node
43
- * @param before {?VasilleNode} node to paste after
44
- * @param text {String | IValue}
45
- */
46
- $$preinitText(app: App, rt: INode, ts: INode, before: VasilleNode | null, text: string | IValue): void;
47
- }
48
- /**
49
- * The private part of a base node
50
- */
51
- export class BaseNodePrivate extends VasilleNodePrivate {
52
- /**
53
- * The building active state
54
- * @type {boolean}
55
- */
56
- building: boolean;
57
- /**
58
- * Represents style bindings
59
- * @type {Set<Binding>}
60
- */
61
- class: Set<Binding>;
62
- /**
63
- * Represents a list of user-defined bindings
64
- * @type {Set<IValue>}
65
- */
66
- watch: Set<IValue>;
67
- /**
68
- * List of user defined signals
69
- * @type {Map<string, {args : Array<Function>, handlers : Array<Function>}>}
70
- */
71
- signal: Map<string, {
72
- args: Array<Function>;
73
- handlers: Array<Function>;
74
- }>;
75
- /**
76
- * List of references
77
- * @type {Map<String, INode|Set<INode>>}
78
- */
79
- refs: Map<string, INode | Set<INode>>;
80
- /**
81
- * List of $slots
82
- * @type {Map<String, INode>}
83
- */
84
- slots: Map<string, INode>;
85
- /**
86
- * Defined the frozen state of component
87
- * @type {boolean}
88
- */
89
- frozen: boolean;
90
- /**
91
- * Defines if node is unmounted
92
- * @type {boolean}
93
- */
94
- unmounted: boolean;
95
- /**
96
- * Handle to run on component destroy
97
- * @type {Function}
98
- */
99
- onDestroy: Function;
100
- /**
101
- * Defines a HTML class for all html nodes
102
- * @type {string}
103
- */
104
- metaClass: string;
105
- /**
106
- * Defines a container for CSS rule in creation time
107
- * @type {Array<{scoped : string, unscoped : string, rules : {[p : string] : string}}>}
108
- */
109
- metaStyle: {
110
- scoped: string;
111
- unscoped: string;
112
- rules: {
113
- [p: string]: string;
114
- };
115
- }[];
116
- /**
117
- * Get the current root (ts on building, rt on filling)
118
- * @type {INode}
119
- */
120
- get rt(): INode;
121
- }
122
- /**
123
- * Represents an Vasille.js node which can contains children
124
- * @extends VasilleNode
125
- */
126
- export class INode extends VasilleNode {
127
- /**
128
- * collect identifiers of created rules packs
129
- * @type {Set<string>}
130
- */
131
- static cssRules: Set<string>;
132
- /**
133
- * Constructs a base node
134
- * @param $ {?BaseNodePrivate}
135
- */
136
- constructor($: BaseNodePrivate | null);
137
- /**
138
- * The children list
139
- * @type {Array<VasilleNode>}
140
- */
141
- $children: Array<VasilleNode>;
142
- /**
143
- * Pre-initializes a base node which can contain children
144
- * @param app {App} the app node
145
- * @param rt {INode} The root node
146
- * @param ts {INode} The this node
147
- * @param before {?VasilleNode} node to paste after it
148
- * @param node {HTMLElement | Text | Comment} The encapsulated node
149
- */
150
- $$preinitNode(app: App, rt: INode, ts: INode, before: VasilleNode | null, node: HTMLElement | Text | Comment): void;
151
- /**
152
- * Start component building
153
- */
154
- $$startBuilding(): void;
155
- /**
156
- * Stop component building
157
- */
158
- $$stopBuilding(): void;
159
- /**
160
- * Initialize node
161
- */
162
- $init(): void;
163
- /**
164
- * Assigns value to this property is such exists and is a IValue
165
- * @param ts {Object} pointer to this
166
- * @param prop {string} property name
167
- * @param value {*} value to assign
168
- */
169
- $$unsafeAssign(ts: any, prop: string, value: any): void;
170
- /** To be overloaded: created event handler */
171
- $created(): void;
172
- /** To be overloaded: mounted event handler */
173
- $mounted(): void;
174
- /** To be overloaded: ready event handler */
175
- $ready(): void;
176
- /** To be overloaded: attributes creation milestone */
177
- $createAttrs(): void;
178
- /** To be overloaded: $style attributes creation milestone */
179
- $createStyle(): void;
180
- /** To be overloaded: signals creation milestone */
181
- $createSignals(): void;
182
- /** To be overloaded: watchers creation milestone */
183
- $createWatchers(): void;
184
- /** To be overloaded: DOM creation milestone */
185
- $createDom(): void;
186
- /** To be overloaded: CSS creation milestone */
187
- $createCss(): void;
188
- /**
189
- * create a private field
190
- * @param value {*}
191
- * @return {IValue<*>}
192
- */
193
- $ref(value: any): any;
194
- /**
195
- * creates a public field
196
- * @param type {Function}
197
- * @param value {*}
198
- * @return {Reference}
199
- */
200
- $prop(type: Function, value?: any): Reference;
201
- /**
202
- * creates a pointer
203
- * @param type {Function}
204
- * @return {Pointer}
205
- */
206
- $pointer(type: Function): Pointer;
207
- /**
208
- * Gets a attribute value
209
- * @param name {string} Attribute name
210
- * @return {IValue<string>}
211
- */
212
- $attr(name: string): any;
213
- /**
214
- * Defines a attribute
215
- * @param name {String} The name of attribute
216
- * @param value {String | IValue | Callable} A $$value or a $$value getter
217
- * @return {INode} A pointer to this
218
- */
219
- $defAttr(name: string, value: string | IValue | Callable): INode;
220
- /**
221
- * Defines a set of attributes
222
- * @param obj {Object<String, String | IValue>} A set attributes
223
- * @return {INode} A pointer to this
224
- */
225
- $defAttrs(obj: any): INode;
226
- /**
227
- * Creates and binds a multivalued binding to attribute
228
- * @param name {String} The name of attribute
229
- * @param calculator {Function} Binding calculator (must return a value)
230
- * @param values {...IValue} Values to bind
231
- * @return {INode} A pointer to this
232
- */
233
- $bindAttr(name: string, calculator: Function, ...values: IValue[]): INode;
234
- /**
235
- * Sets a attribute value
236
- * @param name {string} Name of attribute
237
- * @param value {string} Reference of attribute
238
- * @return {INode} A pointer to this
239
- */
240
- $setAttr(name: string, value: string): INode;
241
- /**
242
- * Sets value of some attributes
243
- * @param data {Object<string, string>} Names and values of attributes
244
- * @return {INode} A pointer to this
245
- */
246
- $setAttrs(data: {
247
- [x: string]: string;
248
- }): INode;
249
- /**
250
- * Adds a CSS class
251
- * @param cl {string} Class name
252
- * @return {INode} A pointer to this
253
- */
254
- $addClass(cl: string): INode;
255
- /**
256
- * Adds some CSS classes
257
- * @param cl {...string} Classes names
258
- * @return {INode} A pointer to this
259
- */
260
- $addClasses(...cl: string[]): INode;
261
- /**
262
- * Bind a CSS class
263
- * @param cl {?string}
264
- * @param value {string | IValue | null}
265
- * @param func {?Callable}
266
- * @return {INode}
267
- */
268
- $bindClass(cl: string | null, value?: string | IValue | null, func?: Callable | null): INode;
269
- /**
270
- * Gets a style attribute value
271
- * @param name {string} Name of style attribute
272
- * @return {IValue}
273
- */
274
- $style(name: string): IValue;
275
- /**
276
- * Defines a style attribute
277
- * @param name {String} The name of style attribute
278
- * @param value {String | IValue | Callable} A value or a value getter
279
- * @return {this} A pointer to this
280
- */
281
- $defStyle(name: string, value: string | IValue | Callable): this;
282
- /**
283
- * Defines a set of style attributes
284
- * @param obj {Object<String, String | IValue>} A set of style attributes
285
- * @return {this} A pointer to this
286
- */
287
- $defStyles(obj: any): this;
288
- /**
289
- * Creates and binds a calculator to a style attribute
290
- * @param name {String} Name of style attribute
291
- * @param calculator {Function} A calculator for style value
292
- * @param values {...IValue} Values to bind
293
- * @return {this} A pointer to this
294
- */
295
- $bindStyle(name: string, calculator: Function, ...values: IValue[]): this;
296
- /**
297
- * Sets a style property value
298
- * @param prop {string} Property name
299
- * @param value {string} Property value
300
- * @return {INode}
301
- */
302
- $setStyle(prop: string, value: string): INode;
303
- /**
304
- * Sets some style property value
305
- * @param data {Object<string, string>} Names and value of properties
306
- * @return {INode}
307
- */
308
- $setStyles(data: {
309
- [x: string]: string;
310
- }): INode;
311
- /**
312
- * Defines a signal
313
- * @param name {string} Signal name
314
- * @param types {...Function} Arguments types
315
- */
316
- $defSignal(name: string, ...types: Function[]): void;
317
- /**
318
- * Add a handler for a signal
319
- * @param name {string} Signal name
320
- * @param func {Function} Handler
321
- */
322
- $on(name: string, func: Function): void;
323
- /**
324
- * Emit a signal
325
- * @param name {string} Signal name
326
- * @param args {...*} Signal arguments
327
- */
328
- $emit(name: string, ...args: any[]): void;
329
- /**
330
- * Add a listener for an event
331
- * @param name {string} Event name
332
- * @param handler {function (Event)} Event handler
333
- * @param options {Object | boolean} addEventListener options
334
- * @return {this}
335
- */
336
- $listen(name: string, handler: (arg0: Event) => any, options: any | boolean): this;
337
- /**
338
- * @param handler {function (MouseEvent)}
339
- * @param options {Object | boolean}
340
- */
341
- $oncontextmenu(handler: (arg0: MouseEvent) => any, options: any | boolean): void;
342
- /**
343
- * @param handler {function (MouseEvent)}
344
- * @param options {Object | boolean}
345
- */
346
- $onmousedown(handler: (arg0: MouseEvent) => any, options: any | boolean): void;
347
- /**
348
- * @param handler {function (MouseEvent)}
349
- * @param options {Object | boolean}
350
- */
351
- $onmouseenter(handler: (arg0: MouseEvent) => any, options: any | boolean): void;
352
- /**
353
- * @param handler {function (MouseEvent)}
354
- * @param options {Object | boolean}
355
- */
356
- $onmouseleave(handler: (arg0: MouseEvent) => any, options: any | boolean): void;
357
- /**
358
- * @param handler {function (MouseEvent)}
359
- * @param options {Object | boolean}
360
- */
361
- $onmousemove(handler: (arg0: MouseEvent) => any, options: any | boolean): void;
362
- /**
363
- * @param handler {function (MouseEvent)}
364
- * @param options {Object | boolean}
365
- */
366
- $onmouseout(handler: (arg0: MouseEvent) => any, options: any | boolean): void;
367
- /**
368
- * @param handler {function (MouseEvent)}
369
- * @param options {Object | boolean}
370
- */
371
- $onmouseover(handler: (arg0: MouseEvent) => any, options: any | boolean): void;
372
- /**
373
- * @param handler {function (MouseEvent)}
374
- * @param options {Object | boolean}
375
- */
376
- $onmouseup(handler: (arg0: MouseEvent) => any, options: any | boolean): void;
377
- /**
378
- * @param handler {function (MouseEvent)}
379
- * @param options {Object | boolean}
380
- */
381
- $onclick(handler: (arg0: MouseEvent) => any, options: any | boolean): void;
382
- /**
383
- * @param handler {function (MouseEvent)}
384
- * @param options {Object | boolean}
385
- */
386
- $ondblclick(handler: (arg0: MouseEvent) => any, options: any | boolean): void;
387
- /**
388
- * @param handler {function (FocusEvent)}
389
- * @param options {Object | boolean}
390
- */
391
- $onblur(handler: (arg0: FocusEvent) => any, options: any | boolean): void;
392
- /**
393
- * @param handler {function (FocusEvent)}
394
- * @param options {Object | boolean}
395
- */
396
- $onfocus(handler: (arg0: FocusEvent) => any, options: any | boolean): void;
397
- /**
398
- * @param handler {function (FocusEvent)}
399
- * @param options {Object | boolean}
400
- */
401
- $onfocusin(handler: (arg0: FocusEvent) => any, options: any | boolean): void;
402
- /**
403
- * @param handler {function (FocusEvent)}
404
- * @param options {Object | boolean}
405
- */
406
- $onfocusout(handler: (arg0: FocusEvent) => any, options: any | boolean): void;
407
- /**
408
- * @param handler {function (KeyboardEvent)}
409
- * @param options {Object | boolean}
410
- */
411
- $onkeydown(handler: (arg0: KeyboardEvent) => any, options: any | boolean): void;
412
- /**
413
- * @param handler {function (KeyboardEvent)}
414
- * @param options {Object | boolean}
415
- */
416
- $onkeyup(handler: (arg0: KeyboardEvent) => any, options: any | boolean): void;
417
- /**
418
- * @param handler {function (KeyboardEvent)}
419
- * @param options {Object | boolean}
420
- */
421
- $onkeypress(handler: (arg0: KeyboardEvent) => any, options: any | boolean): void;
422
- /**
423
- * @param handler {function (TouchEvent)}
424
- * @param options {Object | boolean}
425
- */
426
- $ontouchstart(handler: (arg0: TouchEvent) => any, options: any | boolean): void;
427
- /**
428
- * @param handler {function (TouchEvent)}
429
- * @param options {Object | boolean}
430
- */
431
- $ontouchmove(handler: (arg0: TouchEvent) => any, options: any | boolean): void;
432
- /**
433
- * @param handler {function (TouchEvent)}
434
- * @param options {Object | boolean}
435
- */
436
- $ontouchend(handler: (arg0: TouchEvent) => any, options: any | boolean): void;
437
- /**
438
- * @param handler {function (TouchEvent)}
439
- * @param options {Object | boolean}
440
- */
441
- $ontouchcancel(handler: (arg0: TouchEvent) => any, options: any | boolean): void;
442
- /**
443
- * @param handler {function (WheelEvent)}
444
- * @param options {Object | boolean}
445
- */
446
- $onwheel(handler: (arg0: WheelEvent) => any, options: any | boolean): void;
447
- /**
448
- * @param handler {function (ProgressEvent)}
449
- * @param options {Object | boolean}
450
- */
451
- $onabort(handler: (arg0: ProgressEvent) => any, options: any | boolean): void;
452
- /**
453
- * @param handler {function (ProgressEvent)}
454
- * @param options {Object | boolean}
455
- */
456
- $onerror(handler: (arg0: ProgressEvent) => any, options: any | boolean): void;
457
- /**
458
- * @param handler {function (ProgressEvent)}
459
- * @param options {Object | boolean}
460
- */
461
- $onload(handler: (arg0: ProgressEvent) => any, options: any | boolean): void;
462
- /**
463
- * @param handler {function (ProgressEvent)}
464
- * @param options {Object | boolean}
465
- */
466
- $onloadend(handler: (arg0: ProgressEvent) => any, options: any | boolean): void;
467
- /**
468
- * @param handler {function (ProgressEvent)}
469
- * @param options {Object | boolean}
470
- */
471
- $onloadstart(handler: (arg0: ProgressEvent) => any, options: any | boolean): void;
472
- /**
473
- * @param handler {function (ProgressEvent)}
474
- * @param options {Object | boolean}
475
- */
476
- $onprogress(handler: (arg0: ProgressEvent) => any, options: any | boolean): void;
477
- /**
478
- * @param handler {function (ProgressEvent)}
479
- * @param options {Object | boolean}
480
- */
481
- $ontimeout(handler: (arg0: ProgressEvent) => any, options: any | boolean): void;
482
- /**
483
- * @param handler {function (DragEvent)}
484
- * @param options {Object | boolean}
485
- */
486
- $ondrag(handler: (arg0: DragEvent) => any, options: any | boolean): void;
487
- /**
488
- * @param handler {function (DragEvent)}
489
- * @param options {Object | boolean}
490
- */
491
- $ondragend(handler: (arg0: DragEvent) => any, options: any | boolean): void;
492
- /**
493
- * @param handler {function (DragEvent)}
494
- * @param options {Object | boolean}
495
- */
496
- $ondragenter(handler: (arg0: DragEvent) => any, options: any | boolean): void;
497
- /**
498
- * @param handler {function (DragEvent)}
499
- * @param options {Object | boolean}
500
- */
501
- $ondragexit(handler: (arg0: DragEvent) => any, options: any | boolean): void;
502
- /**
503
- * @param handler {function (DragEvent)}
504
- * @param options {Object | boolean}
505
- */
506
- $ondragleave(handler: (arg0: DragEvent) => any, options: any | boolean): void;
507
- /**
508
- * @param handler {function (DragEvent)}
509
- * @param options {Object | boolean}
510
- */
511
- $ondragover(handler: (arg0: DragEvent) => any, options: any | boolean): void;
512
- /**
513
- * @param handler {function (DragEvent)}
514
- * @param options {Object | boolean}
515
- */
516
- $ondragstart(handler: (arg0: DragEvent) => any, options: any | boolean): void;
517
- /**
518
- * @param handler {function (DragEvent)}
519
- * @param options {Object | boolean}
520
- */
521
- $ondrop(handler: (arg0: DragEvent) => any, options: any | boolean): void;
522
- /**
523
- * @param handler {function (PointerEvent)}
524
- * @param options {Object | boolean}
525
- */
526
- $onpointerover(handler: (arg0: PointerEvent) => any, options: any | boolean): void;
527
- /**
528
- * @param handler {function (PointerEvent)}
529
- * @param options {Object | boolean}
530
- */
531
- $onpointerenter(handler: (arg0: PointerEvent) => any, options: any | boolean): void;
532
- /**
533
- * @param handler {function (PointerEvent)}
534
- * @param options {Object | boolean}
535
- */
536
- $onpointerdown(handler: (arg0: PointerEvent) => any, options: any | boolean): void;
537
- /**
538
- * @param handler {function (PointerEvent)}
539
- * @param options {Object | boolean}
540
- */
541
- $onpointermove(handler: (arg0: PointerEvent) => any, options: any | boolean): void;
542
- /**
543
- * @param handler {function (PointerEvent)}
544
- * @param options {Object | boolean}
545
- */
546
- $onpointerup(handler: (arg0: PointerEvent) => any, options: any | boolean): void;
547
- /**
548
- * @param handler {function (PointerEvent)}
549
- * @param options {Object | boolean}
550
- */
551
- $onpointercancel(handler: (arg0: PointerEvent) => any, options: any | boolean): void;
552
- /**
553
- * @param handler {function (PointerEvent)}
554
- * @param options {Object | boolean}
555
- */
556
- $onpointerout(handler: (arg0: PointerEvent) => any, options: any | boolean): void;
557
- /**
558
- * @param handler {function (PointerEvent)}
559
- * @param options {Object | boolean}
560
- */
561
- $onpointerleave(handler: (arg0: PointerEvent) => any, options: any | boolean): void;
562
- /**
563
- * @param handler {function (PointerEvent)}
564
- * @param options {Object | boolean}
565
- */
566
- $ongotpointercapture(handler: (arg0: PointerEvent) => any, options: any | boolean): void;
567
- /**
568
- * @param handler {function (PointerEvent)}
569
- * @param options {Object | boolean}
570
- */
571
- $onlostpointercapture(handler: (arg0: PointerEvent) => any, options: any | boolean): void;
572
- /**
573
- * @param handler {function (AnimationEvent)}
574
- * @param options {Object | boolean}
575
- */
576
- $onanimationstart(handler: (arg0: AnimationEvent) => any, options: any | boolean): void;
577
- /**
578
- * @param handler {function (AnimationEvent)}
579
- * @param options {Object | boolean}
580
- */
581
- $onanimationend(handler: (arg0: AnimationEvent) => any, options: any | boolean): void;
582
- /**
583
- * @param handler {function (AnimationEvent)}
584
- * @param options {Object | boolean}
585
- */
586
- $onanimationiteraton(handler: (arg0: AnimationEvent) => any, options: any | boolean): void;
587
- /**
588
- * @param handler {function (ClipboardEvent)}
589
- * @param options {Object | boolean}
590
- */
591
- $onclipboardchange(handler: (arg0: ClipboardEvent) => any, options: any | boolean): void;
592
- /**
593
- * @param handler {function (ClipboardEvent)}
594
- * @param options {Object | boolean}
595
- */
596
- $oncut(handler: (arg0: ClipboardEvent) => any, options: any | boolean): void;
597
- /**
598
- * @param handler {function (ClipboardEvent)}
599
- * @param options {Object | boolean}
600
- */
601
- $oncopy(handler: (arg0: ClipboardEvent) => any, options: any | boolean): void;
602
- /**
603
- * @param handler {function (ClipboardEvent)}
604
- * @param options {Object | boolean}
605
- */
606
- $onpaste(handler: (arg0: ClipboardEvent) => any, options: any | boolean): void;
607
- /**
608
- * Defines a watcher
609
- * @param func {function} Function to run on value change
610
- * @param vars {...IValue} Values to listen
611
- */
612
- $watch(func: Function, ...vars: IValue[]): void;
613
- /**
614
- * Creates a bind expression
615
- * @param f {Function} function to alc expression value
616
- * @param args {...IValue} value sto bind
617
- * @return {IBind}
618
- */
619
- $bind(f: Function, ...args: IValue[]): IBind;
620
- $runOnDestroy(f: any): void;
621
- /**
622
- * Register current node as named slot
623
- * @param name {String} The name of slot
624
- */
625
- $makeSlot(name: string): INode;
626
- /**
627
- * Gets a slot by name
628
- * @param name {string} Name of slot
629
- * @return {INode}
630
- */
631
- $slot(name: string): INode;
632
- /**
633
- * Pushes a node to children immediately
634
- * @param node {VasilleNode} A node to push
635
- * @private
636
- */
637
- private $$pushNode;
638
- /**
639
- * Find first core node in shadow element if so exists
640
- * @param node {Extension} Node to iterate
641
- * @return {?CoreEl}
642
- */
643
- $$findFirstChild(node: Extension): any;
644
- /**
645
- * Append a child in correct parent (to be overwritten)
646
- * @param node {HTMLElement | Text | Comment} A node to push
647
- * @param before {VasilleNode} node to paste after
648
- * @private
649
- */
650
- private $$appendChild;
651
- /**
652
- * Disable/Enable reactivity of component with feedback
653
- * @param cond {IValue} show condition
654
- * @param onOff {Function} on show feedback
655
- * @param onOn {Function} on hide feedback
656
- */
657
- $bindFreeze(cond: IValue, onOff: Function, onOn: Function): INode;
658
- /**
659
- * A v-show & ngShow alternative
660
- * @param cond {IValue} show condition
661
- */
662
- $bindShow(cond: IValue): INode;
663
- /**
664
- * Mount/Unmount a node
665
- * @param cond {IValue} show condition
666
- */
667
- $bindMount(cond: IValue): INode;
668
- /**
669
- * Enable/Disable reactivity o component
670
- * @param cond {IValue} show condition
671
- */
672
- $bindAlive(cond: IValue): INode;
673
- /**
674
- * Defines a text fragment
675
- * @param text {String | IValue} A text fragment string
676
- * @param cb {?function (TextNode)} Callback if previous is slot name
677
- * @return {INode} A pointer to this
678
- */
679
- $defText(text: string | IValue, cb: ((arg0: TextNode) => any) | null): INode;
680
- /**
681
- * Defines a tag element
682
- * @param tagName {String} is the tag name
683
- * @param cb {function(Tag, *)} Callback if previous is slot name
684
- * @return {INode} A pointer to this
685
- */
686
- $defTag(tagName: string, cb: (arg0: Tag, arg1: any) => any): INode;
687
- /**
688
- * Defines a custom element
689
- * @param node {*} Custom element constructor
690
- * @param props {function(INode)} List of properties values
691
- * @param cb {?function(INode, *)} Callback if previous is slot name
692
- * @return {INode} A pointer to this
693
- */
694
- $defElement(node: any, props: (arg0: INode) => any, cb: ((arg0: INode, arg1: any) => any) | null): INode;
695
- /**
696
- * Calls callback function to create properties
697
- * @param node {INode}
698
- * @param props {function(INode)}
699
- * @return {*}
700
- */
701
- $$callPropsCallback(node: INode, props: (arg0: INode) => any): any;
702
- /**
703
- * Defines a repeater node
704
- * @param nodeT {RepeatNode} A repeat node object
705
- * @param props {function(INode)} Send data to repeat node
706
- * @param cb {function(RepeatNodeItem, *)} Call-back to create child nodes
707
- * @return {INode}
708
- */
709
- $defRepeater(nodeT: any, props: (arg0: INode) => any, cb: (arg0: RepeatNodeItem, arg1: any) => any): INode;
710
- /**
711
- * Defines a if node
712
- * @param cond {* | IValue<*>} condition
713
- * @param cb {function(RepeatNodeItem, ?number)} Call-back to create child nodes
714
- * @return {this}
715
- */
716
- $defIf(cond: any | IValue<any>, cb: (arg0: RepeatNodeItem, arg1: number | null) => any): this;
717
- /**
718
- * Defines a if-else node
719
- * @param ifCond {* | IValue<*>} `if` condition
720
- * @param ifCb {function(RepeatNodeItem, ?number)} Call-back to create `if` child nodes
721
- * @param elseCb {function(RepeatNodeItem, ?number)} Call-back to create `else` child nodes
722
- * @return {this}
723
- */
724
- $defIfElse(ifCond: any | IValue<any>, ifCb: (arg0: RepeatNodeItem, arg1: number | null) => any, elseCb: (arg0: RepeatNodeItem, arg1: number | null) => any): this;
725
- /**
726
- * Defines a switch nodes: Will break after first true condition
727
- * @param cases {...{ cond : IValue<boolean> | boolean, cb : function(RepeatNodeItem, ?number) }}
728
- * @return {INode}
729
- */
730
- $defSwitch(...cases: {
731
- cond: IValue<boolean> | boolean;
732
- cb: (arg0: RepeatNodeItem, arg1: number | null) => any;
733
- }[]): INode;
734
- /**
735
- * @param cond {IValue<boolean> | boolean}
736
- * @param cb {(function(RepeatNodeItem, ?number) : void)}
737
- * @return {{cond : (IValue<boolean>|boolean), cb : (function(RepeatNodeItem, ?number) : void)}}
738
- */
739
- $case(cond: IValue<boolean> | boolean, cb: ((arg0: RepeatNodeItem, arg1: number | null) => void)): {
740
- cond: (IValue<boolean> | boolean);
741
- cb: ((arg0: RepeatNodeItem, arg1: number | null) => void);
742
- };
743
- /**
744
- * @param cb {(function(RepeatNodeItem, ?number) : void)}
745
- * @return {{cond : boolean, cb : (function(RepeatNodeItem, ?number) : void)}}
746
- */
747
- $default(cb: ((arg0: RepeatNodeItem, arg1: number | null) => void)): {
748
- cond: boolean;
749
- cb: ((arg0: RepeatNodeItem, arg1: number | null) => void);
750
- };
751
- /**
752
- * bind HTML
753
- * @param value {IValue<string>}
754
- */
755
- $bindHTML(value: any): void;
756
- /**
757
- * @param class_ {string} set class which will be used to scope style
758
- */
759
- $setMetaClass(class_: string): void;
760
- /**
761
- * Scope a selector to current component
762
- * @param selector {string} selector to scope
763
- * @return {string}
764
- */
765
- $scope(selector: string): string;
766
- /**
767
- * Defines a local CSS rule
768
- * @param scoped {string} selector to scope
769
- * @param rules {Object<string, string>} css rules
770
- */
771
- $local(scoped: string, rules: {
772
- [x: string]: string;
773
- }): void;
774
- /**
775
- * Defines a hybrid rule
776
- * @param scoped {string} selector to scope
777
- * @param unscoped {string} selector to append unscoped
778
- * @param rules {Object<string, string>} css rules
779
- */
780
- $hybrid(scoped: string, unscoped: string, rules: {
781
- [x: string]: string;
782
- }): void;
783
- /**
784
- * Make style tag for component
785
- */
786
- $$makeStyleTag(): void;
787
- }
788
- /**
789
- * Represents an Vasille.js HTML element node
790
- */
791
- export class Tag extends INode {
792
- constructor();
793
- /**
794
- * HTML node created by this TagNode
795
- * @type {HTMLElement}
796
- */
797
- $node: HTMLElement;
798
- /**
799
- * Constructs a element node
800
- * @param app {App} the app node
801
- * @param rt {INode} The root node
802
- * @param ts {INode} The this node
803
- * @param before {VasilleNode} Node to insert before it
804
- * @param tagName {String} Name of HTML tag
805
- */
806
- $$preinitElementNode(app: App, rt: INode, ts: INode, before: VasilleNode, tagName: string): void;
807
- }
808
- /**
809
- * Represents a Vasille.js shadow node
810
- */
811
- export class Extension extends INode {
812
- constructor($: any);
813
- /**
814
- * Pre-initialize a shadow node
815
- * @param app {App} the app node
816
- * @param rt {INode} The root node
817
- * @param ts {INode} The this node
818
- * @param before {VasilleNode} node to paste after it
819
- */
820
- $$preinitShadow(app: App, rt: INode, ts: INode, before: VasilleNode): void;
821
- }
822
- /**
823
- * Defines a node which cas has just a child (TagNode | Component)
824
- */
825
- export class Component extends Extension {
826
- constructor();
827
- }
828
- /**
829
- * Defines a abstract node, which represents a dynamical part of application
830
- */
831
- export class RepeatNodeItem extends Extension {
832
- /**
833
- * Constructs a repeat node item
834
- * @param id {*}
835
- */
836
- constructor(id: any);
837
- /**
838
- * node identifier
839
- * @type {*}
840
- */
841
- $id: any;
842
- }
843
- /**
844
- * Private part of switch node
845
- */
846
- export class SwitchedNodePrivate extends BaseNodePrivate {
847
- /**
848
- * Index of current true condition
849
- * @type {number}
850
- */
851
- index: number;
852
- /**
853
- * The unique child which can be absent
854
- * @type {Extension}
855
- */
856
- node: Extension;
857
- /**
858
- * Array of possible casses
859
- * @type {Array<{cond : IValue<boolean>, cb : function(RepeatNodeItem, ?number)}>}
860
- */
861
- cases: Array<{
862
- cond: IValue<boolean>;
863
- cb: (arg0: RepeatNodeItem, arg1: number | null) => any;
864
- }>;
865
- /**
866
- * A function which sync index and content, will be bounded to each condition
867
- * @type {Function}
868
- */
869
- sync: Function;
870
- }
871
- /**
872
- * Represents a Vasille.js application node
873
- */
874
- export class App extends INode {
875
- /**
876
- * Constructs a app node
877
- * @param node {HTMLElement} The root of application
878
- * @param meta {?{debug : boolean}} Application properties
879
- */
880
- constructor(node: HTMLElement, meta: {
881
- debug: boolean;
882
- } | null);
883
- /**
884
- * The debug state of application, if true will output debug data
885
- * @type {boolean}
886
- */
887
- $debug: boolean;
888
- /**
889
- * Executor is use to optimize the page creation/update
890
- * @type {Executor}
891
- */
892
- $run: Executor;
893
- /**
894
- * @param props {function($ : any) : void}
895
- */
896
- $create(props: (arg0: any, arg1: any) => void): void;
897
- }
898
- import { VasilleNodePrivate } from "./interfaces/core.js";
899
- import { IValue } from "./interfaces/ivalue.js";
900
- import { VasilleNode } from "./interfaces/core.js";
901
- import { Binding } from "./bind.js";
902
- import { Reference } from "./value.js";
903
- import { Pointer } from "./value.js";
904
- import { Callable } from "./interfaces/idefinition.js";
905
- import { IBind } from "./interfaces/ibind.js";
906
- import { Executor } from "./executor.js";