vasille 2.0.5 → 2.2.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 (62) hide show
  1. package/README.md +4 -0
  2. package/cdn/es2015.js +651 -665
  3. package/cdn/es5.js +737 -675
  4. package/flow-typed/vasille.js +2643 -835
  5. package/lib/binding/attribute.js +7 -2
  6. package/lib/binding/class.js +2 -2
  7. package/lib/binding/style.js +1 -1
  8. package/lib/core/core.js +57 -7
  9. package/lib/functional/components.js +17 -0
  10. package/lib/functional/merge.js +41 -0
  11. package/lib/functional/models.js +26 -0
  12. package/lib/functional/options.js +1 -0
  13. package/lib/functional/reactivity.js +33 -0
  14. package/lib/functional/stack.js +127 -0
  15. package/lib/index.js +2 -7
  16. package/lib/models/array-model.js +9 -0
  17. package/lib/models/object-model.js +28 -14
  18. package/lib/node/app.js +20 -11
  19. package/lib/node/node.js +186 -538
  20. package/lib/node/watch.js +5 -13
  21. package/lib/spec/html.js +1 -0
  22. package/lib/spec/react.js +1 -0
  23. package/lib/spec/svg.js +1 -0
  24. package/lib/v/index.js +23 -0
  25. package/lib/value/expression.js +8 -5
  26. package/lib/views/array-view.js +6 -10
  27. package/lib/views/base-view.js +11 -22
  28. package/lib/views/map-view.js +4 -9
  29. package/lib/views/object-view.js +4 -7
  30. package/lib/views/repeat-node.js +6 -18
  31. package/lib/views/set-view.js +4 -11
  32. package/package.json +3 -1
  33. package/types/binding/attribute.d.ts +2 -2
  34. package/types/core/core.d.ts +27 -41
  35. package/types/functional/components.d.ts +4 -0
  36. package/types/functional/merge.d.ts +1 -0
  37. package/types/functional/models.d.ts +10 -0
  38. package/types/functional/options.d.ts +23 -0
  39. package/types/functional/reactivity.d.ts +11 -0
  40. package/types/functional/stack.d.ts +24 -0
  41. package/types/index.d.ts +3 -7
  42. package/types/models/array-model.d.ts +1 -0
  43. package/types/models/object-model.d.ts +2 -0
  44. package/types/node/app.d.ts +19 -17
  45. package/types/node/node.d.ts +55 -378
  46. package/types/node/watch.d.ts +9 -15
  47. package/types/spec/html.d.ts +975 -0
  48. package/types/spec/react.d.ts +4 -0
  49. package/types/spec/svg.d.ts +314 -0
  50. package/types/v/index.d.ts +32 -0
  51. package/types/value/expression.d.ts +6 -19
  52. package/types/views/array-view.d.ts +3 -4
  53. package/types/views/base-view.d.ts +8 -16
  54. package/types/views/map-view.d.ts +2 -3
  55. package/types/views/object-view.d.ts +2 -3
  56. package/types/views/repeat-node.d.ts +7 -8
  57. package/types/views/set-view.d.ts +2 -3
  58. package/types/core/executor.d.ts +0 -87
  59. package/types/core/signal.d.ts +0 -35
  60. package/types/core/slot.d.ts +0 -45
  61. package/types/node/interceptor.d.ts +0 -50
  62. package/types/views/repeater.d.ts +0 -38
@@ -0,0 +1,4 @@
1
+ import { SvgTagMap, SvgTagNameMap } from "./svg";
2
+ import { HtmlTagMap, TagNameMap } from "./html";
3
+ export declare type AcceptedTagsMap = TagNameMap & SvgTagNameMap;
4
+ export declare type AcceptedTagsSpec = HtmlTagMap & SvgTagMap;
@@ -0,0 +1,314 @@
1
+ import { EventHandler, HtmlAndSvgEvents, Tag } from "./html";
2
+ declare type SvgEvents = {
3
+ [K in keyof SVGElementEventMap]: EventHandler<SVGElementEventMap[K]> | undefined;
4
+ };
5
+ interface SvgAreaAttrs {
6
+ "aria-activedescendant": string;
7
+ "aria-atomic": string;
8
+ "aria-autocomplete": string;
9
+ "aria-busy": string;
10
+ "aria-checked": string;
11
+ "aria-colcount": string;
12
+ "aria-colindex": string;
13
+ "aria-colspan": string;
14
+ "aria-controls": string;
15
+ "aria-current": string;
16
+ "aria-describedby": string;
17
+ "aria-details": string;
18
+ "aria-disabled": string;
19
+ "aria-dropeffect": string;
20
+ "aria-errormessage": string;
21
+ "aria-expanded": string;
22
+ "aria-flowto": string;
23
+ "aria-grabbed": string;
24
+ "aria-haspopup": string;
25
+ "aria-hidden": string;
26
+ "aria-invalid": string;
27
+ "aria-keyshortcuts": string;
28
+ "aria-label": string;
29
+ "aria-labelledby": string;
30
+ "aria-level": string;
31
+ "aria-live": string;
32
+ "aria-modal": string;
33
+ "aria-multiline": string;
34
+ "aria-multiselectable": string;
35
+ "aria-orientation": string;
36
+ "aria-owns": string;
37
+ "aria-placeholder": string;
38
+ "aria-posinset": string;
39
+ "aria-pressed": string;
40
+ "aria-readonly": string;
41
+ "aria-relevant": string;
42
+ "aria-required": string;
43
+ "aria-roledescription": string;
44
+ "aria-rowcount": string;
45
+ "aria-rowindex": string;
46
+ "aria-rowspan": string;
47
+ "aria-selected": string;
48
+ "aria-setsize": string;
49
+ "aria-sort": string;
50
+ "aria-valuemax": string;
51
+ "aria-valuemin": string;
52
+ "aria-valuenow": string;
53
+ "aria-valuetext": string;
54
+ "role": string;
55
+ }
56
+ interface SvgConditionalProcessingAtttrs {
57
+ "requiredExtensions": string;
58
+ "systemLanguage": string;
59
+ }
60
+ interface SvgCoreAttrs {
61
+ "id": string;
62
+ "tabindex": string;
63
+ "lang": string;
64
+ "xml:space": string;
65
+ }
66
+ interface SvgSvgAttrs extends SvgAreaAttrs, SvgConditionalProcessingAtttrs, SvgCoreAttrs {
67
+ "viewBox": string;
68
+ "preserveAspectRatio": string;
69
+ "zoomAndPan": string;
70
+ "transform": string;
71
+ x: number;
72
+ y: number;
73
+ width: number;
74
+ height: number;
75
+ }
76
+ interface Svg3in1Attrs extends SvgAreaAttrs, SvgConditionalProcessingAtttrs, SvgCoreAttrs {
77
+ }
78
+ interface SvgUseAttrs extends Svg3in1Attrs {
79
+ href: string;
80
+ }
81
+ interface SvgPathLengthAttrs extends Svg3in1Attrs {
82
+ pathLength: number;
83
+ "marker-start": string;
84
+ "marker-mid": string;
85
+ "marker-end": string;
86
+ }
87
+ interface SvgPathAttrs extends SvgPathLengthAttrs {
88
+ d: string;
89
+ }
90
+ interface SvgRectAttrs extends SvgPathLengthAttrs {
91
+ x: number;
92
+ y: number;
93
+ width: number;
94
+ height: number;
95
+ rx: number;
96
+ ry: number;
97
+ }
98
+ interface SvgCircleAttrs extends SvgPathLengthAttrs {
99
+ cx: number;
100
+ cy: number;
101
+ r: number;
102
+ }
103
+ interface SvgEllipseAttrs extends SvgPathLengthAttrs {
104
+ cx: number;
105
+ cy: number;
106
+ rx: number;
107
+ ry: number;
108
+ }
109
+ interface SvgLineAttrs extends SvgPathLengthAttrs {
110
+ x1: number;
111
+ y1: number;
112
+ x2: number;
113
+ y2: number;
114
+ }
115
+ interface SvgPolygonAttrs extends SvgPathLengthAttrs {
116
+ points: number;
117
+ }
118
+ interface SvgCommonTextAttrs extends Svg3in1Attrs {
119
+ x: number;
120
+ y: number;
121
+ dx: number;
122
+ dy: number;
123
+ rotate: number;
124
+ textLength: number;
125
+ lengthAdjust: 'spacing' | 'spacingAndGlyphs';
126
+ }
127
+ interface SvgTextPathAttrs extends Svg3in1Attrs {
128
+ "lengthAdjust": 'spacing' | 'spacingAndGlyphs';
129
+ "textLength": number;
130
+ "path": string;
131
+ "href": string;
132
+ "startOffset": number;
133
+ "method": 'align' | 'stretch';
134
+ "spacing": 'auto' | 'exact';
135
+ "side": 'left' | 'right';
136
+ }
137
+ interface SvgImageAttrs extends Svg3in1Attrs {
138
+ "preserveAspectRatio": string;
139
+ "href": string;
140
+ "crossorigin": string;
141
+ x: number;
142
+ y: number;
143
+ width: number;
144
+ height: number;
145
+ }
146
+ interface SvgForeignObjectAttrs extends Svg3in1Attrs {
147
+ x: number;
148
+ y: number;
149
+ width: number;
150
+ height: number;
151
+ }
152
+ interface SvgMarkerAttrs extends Svg3in1Attrs {
153
+ "viewBox": string;
154
+ "preserveAspectRatio": string;
155
+ "refX": number;
156
+ "refY": number;
157
+ "markerUnits": 'strokeWidth' | 'userSpaceOnUse';
158
+ "markerWidth": number | `${number}%` | 'left' | 'center' | 'right';
159
+ "markerHeight": number | `${number}%` | 'top' | 'center' | 'bottom';
160
+ "orient": 'auto' | 'auto-start-reverse' | `${number}deg` | number;
161
+ }
162
+ interface SvgAAttrs extends SvgCoreAttrs {
163
+ href: string;
164
+ "target": '_self' | '_parent' | '_top' | '_blank';
165
+ "download": string;
166
+ "ping": string;
167
+ "rel": string;
168
+ "hreflang": string;
169
+ "type": string;
170
+ "referrerpolicy": string;
171
+ }
172
+ interface SvgViewAttrs extends SvgCoreAttrs, SvgAreaAttrs {
173
+ "viewBox": string;
174
+ "preserveAspectRatio": string;
175
+ "zoomAndPan": string;
176
+ }
177
+ export interface SvgTagMap {
178
+ "a": Tag<SvgAAttrs, SvgEvents>;
179
+ "animate": Tag<SvgCoreAttrs, SvgEvents>;
180
+ "animateMotion": Tag<SvgCoreAttrs, SvgEvents>;
181
+ "animateTransform": Tag<SvgCoreAttrs, SvgEvents>;
182
+ "circle": Tag<SvgCircleAttrs, SvgEvents>;
183
+ "clipPath": Tag<SvgCoreAttrs, SvgEvents>;
184
+ "defs": Tag<SvgCoreAttrs, SvgEvents>;
185
+ "desc": Tag<SvgCoreAttrs, SvgEvents>;
186
+ "ellipse": Tag<SvgEllipseAttrs, SvgEvents>;
187
+ "feBlend": Tag<SvgCoreAttrs, SvgEvents>;
188
+ "feColorMatrix": Tag<SvgCoreAttrs, SvgEvents>;
189
+ "feComponentTransfer": Tag<SvgCoreAttrs, SvgEvents>;
190
+ "feComposite": Tag<SvgCoreAttrs, SvgEvents>;
191
+ "feConvolveMatrix": Tag<SvgCoreAttrs, SvgEvents>;
192
+ "feDiffuseLighting": Tag<SvgCoreAttrs, SvgEvents>;
193
+ "feDisplacementMap": Tag<SvgCoreAttrs, SvgEvents>;
194
+ "feDistantLight": Tag<SvgCoreAttrs, SvgEvents>;
195
+ "feDropShadow": Tag<SvgCoreAttrs, SvgEvents>;
196
+ "feFlood": Tag<SvgCoreAttrs, SvgEvents>;
197
+ "feFuncA": Tag<SvgCoreAttrs, SvgEvents>;
198
+ "feFuncB": Tag<SvgCoreAttrs, SvgEvents>;
199
+ "feFuncG": Tag<SvgCoreAttrs, SvgEvents>;
200
+ "feFuncR": Tag<SvgCoreAttrs, SvgEvents>;
201
+ "feGaussianBlur": Tag<SvgCoreAttrs, SvgEvents>;
202
+ "feImage": Tag<SvgCoreAttrs, SvgEvents>;
203
+ "feMerge": Tag<SvgCoreAttrs, SvgEvents>;
204
+ "feMergeNode": Tag<SvgCoreAttrs, SvgEvents>;
205
+ "feMorphology": Tag<SvgCoreAttrs, SvgEvents>;
206
+ "feOffset": Tag<SvgCoreAttrs, SvgEvents>;
207
+ "fePointLight": Tag<SvgCoreAttrs, SvgEvents>;
208
+ "feSpecularLighting": Tag<SvgCoreAttrs, SvgEvents>;
209
+ "feSpotLight": Tag<SvgCoreAttrs, SvgEvents>;
210
+ "feTile": Tag<SvgCoreAttrs, SvgEvents>;
211
+ "feTurbulence": Tag<SvgCoreAttrs, SvgEvents>;
212
+ "filter": Tag<SvgCoreAttrs, SvgEvents>;
213
+ "foreignObject": Tag<SvgForeignObjectAttrs, SvgEvents>;
214
+ "g": Tag<Svg3in1Attrs, SvgEvents>;
215
+ "image": Tag<SvgImageAttrs, SvgEvents>;
216
+ "line": Tag<SvgLineAttrs, SvgEvents>;
217
+ "linearGradient": Tag<SvgCoreAttrs, SvgEvents>;
218
+ "marker": Tag<SvgMarkerAttrs, SvgEvents>;
219
+ "mask": Tag<SvgCoreAttrs, SvgEvents>;
220
+ "metadata": Tag<SvgCoreAttrs, SvgEvents>;
221
+ "mpath": Tag<SvgCoreAttrs, SvgEvents>;
222
+ "path": Tag<SvgPathAttrs, SvgEvents>;
223
+ "pattern": Tag<SvgCoreAttrs, SvgEvents>;
224
+ "polygon": Tag<SvgCoreAttrs, SvgEvents>;
225
+ "polyline": Tag<SvgPolygonAttrs, SvgEvents>;
226
+ "radialGradient": Tag<SvgCoreAttrs, SvgEvents>;
227
+ "rect": Tag<SvgRectAttrs, SvgEvents>;
228
+ "script": Tag<SvgCoreAttrs, SvgEvents>;
229
+ "set": Tag<SvgCoreAttrs, SvgEvents>;
230
+ "stop": Tag<SvgCoreAttrs, SvgEvents>;
231
+ "style": Tag<SvgCoreAttrs, SvgEvents>;
232
+ "svg": Tag<SvgSvgAttrs, SvgEvents>;
233
+ "switch": Tag<Svg3in1Attrs, SvgEvents>;
234
+ "symbol": Tag<SvgCoreAttrs, SvgEvents>;
235
+ "text": Tag<SvgCommonTextAttrs, SvgEvents>;
236
+ "textPath": Tag<SvgTextPathAttrs, SvgEvents>;
237
+ "title": Tag<SvgCoreAttrs, SvgEvents>;
238
+ "tspan": Tag<SvgCommonTextAttrs, SvgEvents>;
239
+ "use": Tag<SvgUseAttrs, SvgEvents>;
240
+ "view": Tag<SvgViewAttrs, SvgEvents>;
241
+ }
242
+ declare type SvgTag = HtmlAndSvgEvents;
243
+ interface SvgATag extends SvgTag {
244
+ rel: string;
245
+ }
246
+ interface SvgSvgTag extends SvgTag {
247
+ currentScale: number;
248
+ }
249
+ export interface SvgTagNameMap {
250
+ "a": SvgATag;
251
+ "animate": SvgTag;
252
+ "animateMotion": SvgTag;
253
+ "animateTransform": SvgTag;
254
+ "circle": SvgTag;
255
+ "clipPath": SvgTag;
256
+ "defs": SvgTag;
257
+ "desc": SvgTag;
258
+ "ellipse": SvgTag;
259
+ "feBlend": SvgTag;
260
+ "feColorMatrix": SvgTag;
261
+ "feComponentTransfer": SvgTag;
262
+ "feComposite": SvgTag;
263
+ "feConvolveMatrix": SvgTag;
264
+ "feDiffuseLighting": SvgTag;
265
+ "feDisplacementMap": SvgTag;
266
+ "feDistantLight": SvgTag;
267
+ "feDropShadow": SvgTag;
268
+ "feFlood": SvgTag;
269
+ "feFuncA": SvgTag;
270
+ "feFuncB": SvgTag;
271
+ "feFuncG": SvgTag;
272
+ "feFuncR": SvgTag;
273
+ "feGaussianBlur": SvgTag;
274
+ "feImage": SvgTag;
275
+ "feMerge": SvgTag;
276
+ "feMergeNode": SvgTag;
277
+ "feMorphology": SvgTag;
278
+ "feOffset": SvgTag;
279
+ "fePointLight": SvgTag;
280
+ "feSpecularLighting": SvgTag;
281
+ "feSpotLight": SvgTag;
282
+ "feTile": SvgTag;
283
+ "feTurbulence": SvgTag;
284
+ "filter": SvgTag;
285
+ "foreignObject": SvgTag;
286
+ "g": SvgTag;
287
+ "image": SvgTag;
288
+ "line": SvgTag;
289
+ "linearGradient": SvgTag;
290
+ "marker": SvgTag;
291
+ "mask": SvgTag;
292
+ "metadata": SvgTag;
293
+ "mpath": SvgTag;
294
+ "path": SvgTag;
295
+ "pattern": SvgTag;
296
+ "polygon": SvgTag;
297
+ "polyline": SvgTag;
298
+ "radialGradient": SvgTag;
299
+ "rect": SvgTag;
300
+ "script": SvgTag;
301
+ "set": SvgTag;
302
+ "stop": SvgTag;
303
+ "style": SvgTag;
304
+ "svg": SvgSvgTag;
305
+ "switch": SvgTag;
306
+ "symbol": SvgTag;
307
+ "text": SvgTag;
308
+ "textPath": SvgTag;
309
+ "title": SvgTag;
310
+ "tspan": SvgTag;
311
+ "use": SvgTag;
312
+ "view": SvgTag;
313
+ }
314
+ export {};
@@ -0,0 +1,32 @@
1
+ import { debug, text } from "../functional/components";
2
+ import { arrayModel, mapModel, objectModel, setModel } from "../functional/models";
3
+ import { expr, forward, mirror, point, ref, setValue, valueOf, watch } from "../functional/reactivity";
4
+ import { app, component, create, extension, fragment, tag } from "../functional/stack";
5
+ import { Options, TagOptions } from "../functional/options";
6
+ import { AppOptions } from "../node/app";
7
+ import { Reference } from "../value/reference";
8
+ import { merge } from "../functional/merge";
9
+ export { debug, arrayModel, mapModel, objectModel, setModel, expr, forward, mirror, point, ref, setValue, valueOf, watch, Options, TagOptions, AppOptions };
10
+ export declare const v: {
11
+ merge: typeof merge;
12
+ destructor(): any;
13
+ runOnDestroy(callback: () => void): void;
14
+ if(condition: import("../index").IValue<boolean>, callback: () => void): void;
15
+ else(callback: () => void): void;
16
+ elif(condition: import("../index").IValue<boolean>, callback: () => void): void;
17
+ for<T, K>(model: import("../models/model").ListenableModel<K, T>, callback: (value: T, index: K) => void): void;
18
+ watch<T_1>(model: import("../index").IValue<T_1>, callback: (value: T_1) => void): void;
19
+ nextTick(callback: () => void): void;
20
+ ref(value: any): import("../index").IValue<any>;
21
+ expr: typeof expr;
22
+ of: typeof valueOf;
23
+ sv: typeof setValue;
24
+ alwaysFalse: Reference<boolean>;
25
+ app: typeof app;
26
+ component: typeof component;
27
+ fragment: typeof fragment;
28
+ extension: typeof extension;
29
+ text: typeof text;
30
+ tag: typeof tag;
31
+ create: typeof create;
32
+ };
@@ -1,10 +1,13 @@
1
1
  import { IValue } from "../core/ivalue";
2
+ export declare type KindOfIValue<T extends unknown[]> = {
3
+ [K in keyof T]: IValue<T[K]>;
4
+ };
2
5
  /**
3
6
  * Bind some values to one expression
4
7
  * @class Expression
5
8
  * @extends IValue
6
9
  */
7
- export declare class Expression<T, T1 = void, T2 = void, T3 = void, T4 = void, T5 = void, T6 = void, T7 = void, T8 = void, T9 = void> extends IValue<T> {
10
+ export declare class Expression<T, Args extends unknown[]> extends IValue<T> {
8
11
  /**
9
12
  * The array of value which will trigger recalculation
10
13
  * @type {Array}
@@ -30,26 +33,10 @@ export declare class Expression<T, T1 = void, T2 = void, T3 = void, T4 = void, T
30
33
  /**
31
34
  * Creates a function bounded to N values
32
35
  * @param func {Function} the function to bound
36
+ * @param values
33
37
  * @param link {Boolean} links immediately if true
34
- * @param v1 {*} argument
35
- * @param v2 {*} argument
36
- * @param v3 {*} argument
37
- * @param v4 {*} argument
38
- * @param v5 {*} argument
39
- * @param v6 {*} argument
40
- * @param v7 {*} argument
41
- * @param v8 {*} argument
42
- * @param v9 {*} argument
43
38
  */
44
- constructor(func: (a1: T1) => T, link: boolean, 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>);
45
- constructor(func: (a1: T1, a2: T2) => T, link: boolean, 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>);
46
- constructor(func: (a1: T1, a2: T2, a3: T3) => T, link: boolean, 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>);
47
- constructor(func: (a1: T1, a2: T2, a3: T3, a4: T4) => T, link: boolean, 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>);
48
- constructor(func: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5) => T, link: boolean, 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>);
49
- constructor(func: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6) => T, link: boolean, 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>);
50
- constructor(func: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7) => T, link: boolean, 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>);
51
- constructor(func: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8) => T, link: boolean, 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>);
52
- constructor(func: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9) => T, link: boolean, 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>);
39
+ constructor(func: (...args: Args) => T, link: boolean, ...values: KindOfIValue<Args>);
53
40
  get $(): T;
54
41
  set $(value: T);
55
42
  on(handler: (value: T) => void): this;
@@ -1,4 +1,4 @@
1
- import { BaseView } from "./base-view";
1
+ import { BaseView, BSO } from "./base-view";
2
2
  import { ArrayModel } from "../models/array-model";
3
3
  import { Fragment } from "../node/node";
4
4
  /**
@@ -7,7 +7,6 @@ import { Fragment } from "../node/node";
7
7
  * @extends BaseView
8
8
  */
9
9
  export declare class ArrayView<T> extends BaseView<T, T, ArrayModel<T>> {
10
- constructor(model: ArrayModel<T>);
11
- createChild(id: T, item: T, before?: Fragment): any;
12
- ready(): void;
10
+ createChild(input: BSO<T, T, ArrayModel<T>>, id: T, item: T, before?: Fragment): any;
11
+ protected compose(input: BSO<T, T, ArrayModel<T>>): void;
13
12
  }
@@ -1,4 +1,4 @@
1
- import { RepeatNode, RepeatNodePrivate } from "./repeat-node";
1
+ import { RepeatNode, RepeatNodePrivate, RNO } from "./repeat-node";
2
2
  import { ListenableModel } from "../models/model";
3
3
  /**
4
4
  * Private part of BaseView
@@ -18,26 +18,18 @@ export declare class BaseViewPrivate<K, T> extends RepeatNodePrivate<K> {
18
18
  removeHandler: (index: K, value: T) => void;
19
19
  constructor();
20
20
  }
21
+ export interface BSO<K, T, Model extends ListenableModel<K, T>> extends RNO<T, K> {
22
+ model: Model;
23
+ }
21
24
  /**
22
25
  * Base class of default views
23
26
  * @class BaseView
24
27
  * @extends RepeatNode
25
28
  * @implements IModel
26
29
  */
27
- export declare class BaseView<K, T, Model extends ListenableModel<K, T>> extends RepeatNode<K, T> {
30
+ export declare class BaseView<K, T, Model extends ListenableModel<K, T>> extends RepeatNode<K, T, BSO<K, T, Model>> {
28
31
  protected $: BaseViewPrivate<K, T>;
29
- /**
30
- * Property which will contain a model
31
- * @type {IModel}
32
- */
33
- model: Model;
34
- constructor($1?: BaseViewPrivate<K, T>);
35
- /**
36
- * Handle ready event
37
- */
38
- ready(): void;
39
- /**
40
- * Handles destroy event
41
- */
42
- destroy(): void;
32
+ input: BSO<K, T, Model>;
33
+ constructor(input: BSO<K, T, Model>, $?: BaseViewPrivate<K, T>);
34
+ protected compose(input: BSO<K, T, Model>): void;
43
35
  }
@@ -1,4 +1,4 @@
1
- import { BaseView } from "./base-view";
1
+ import { BaseView, BSO } from "./base-view";
2
2
  import { MapModel } from "../models/map-model";
3
3
  /**
4
4
  * Create a children pack for each map value
@@ -6,6 +6,5 @@ import { MapModel } from "../models/map-model";
6
6
  * @extends BaseView
7
7
  */
8
8
  export declare class MapView<K, T> extends BaseView<K, T, MapModel<K, T>> {
9
- constructor(model: MapModel<K, T>);
10
- ready(): void;
9
+ protected compose(input: BSO<K, T, MapModel<K, T>>): void;
11
10
  }
@@ -1,4 +1,4 @@
1
- import { BaseView } from "./base-view";
1
+ import { BaseView, BSO } from "./base-view";
2
2
  import { ObjectModel } from "../models/object-model";
3
3
  /**
4
4
  * Create a children pack for each object field
@@ -6,6 +6,5 @@ import { ObjectModel } from "../models/object-model";
6
6
  * @extends BaseView
7
7
  */
8
8
  export declare class ObjectView<T> extends BaseView<string, T, ObjectModel<T>> {
9
- constructor(model: ObjectModel<T>);
10
- ready(): void;
9
+ protected compose(input: BSO<string, T, ObjectModel<T>>): void;
11
10
  }
@@ -1,5 +1,5 @@
1
1
  import { Fragment, INodePrivate } from "../node/node";
2
- import { Slot } from "../core/slot";
2
+ import { Options } from "../functional/options";
3
3
  /**
4
4
  * Private part of repeat node
5
5
  * @class RepeatNodePrivate
@@ -14,22 +14,21 @@ export declare class RepeatNodePrivate<IdT> extends INodePrivate {
14
14
  constructor();
15
15
  destroy(): void;
16
16
  }
17
+ export interface RNO<T, IdT> extends Options {
18
+ slot?: (node: Fragment, value: T, index: IdT) => void;
19
+ }
17
20
  /**
18
21
  * Repeat node repeats its children
19
22
  * @class RepeatNode
20
23
  * @extends Fragment
21
24
  */
22
- export declare class RepeatNode<IdT, T> extends Fragment {
25
+ export declare class RepeatNode<IdT, T, Opts extends RNO<T, IdT> = RNO<T, IdT>> extends Fragment<Opts> {
23
26
  protected $: RepeatNodePrivate<IdT>;
24
- /**
25
- * Default slot
26
- */
27
- slot: Slot<Fragment, T, IdT>;
28
27
  /**
29
28
  * If false will use timeout executor, otherwise the app executor
30
29
  */
31
30
  freezeUi: boolean;
32
- constructor($?: RepeatNodePrivate<IdT>);
33
- createChild(id: IdT, item: T, before?: Fragment): any;
31
+ constructor(input: Opts, $: RepeatNodePrivate<IdT>);
32
+ createChild(opts: Opts, id: IdT, item: T, before?: Fragment): any;
34
33
  destroyChild(id: IdT, item: T): void;
35
34
  }
@@ -1,4 +1,4 @@
1
- import { BaseView } from "./base-view";
1
+ import { BaseView, BSO } from "./base-view";
2
2
  import { SetModel } from "../models/set-model";
3
3
  /**
4
4
  * Create a children pack for each set value
@@ -6,6 +6,5 @@ import { SetModel } from "../models/set-model";
6
6
  * @extends BaseView
7
7
  */
8
8
  export declare class SetView<T> extends BaseView<T, T, SetModel<T>> {
9
- constructor(model: SetModel<T>);
10
- ready(): void;
9
+ protected compose(input: BSO<T, T, SetModel<T>>): void;
11
10
  }
@@ -1,87 +0,0 @@
1
- /**
2
- * Represents an executor unit interface
3
- * @class Executor
4
- */
5
- export declare class Executor {
6
- /**
7
- * Adds a CSS class
8
- * @param el {Element} element to manipulate
9
- * @param cl {string} class to be added
10
- */
11
- addClass(el: Element, cl: string): void;
12
- /**
13
- * Removes a CSS class
14
- * @param el {Element} element to manipulate
15
- * @param cl {string} class to be removed
16
- */
17
- removeClass(el: Element, cl: string): void;
18
- /**
19
- * Sets a tag attribute
20
- * @param el {Element} element to manipulate
21
- * @param name {string} name of attribute
22
- * @param value {string} value of attribute
23
- */
24
- setAttribute(el: Element, name: string, value: string): void;
25
- /**
26
- * Removes a tag attribute
27
- * @param el {Element} element to manipulate
28
- * @param name {string} name of attribute
29
- */
30
- removeAttribute(el: Element, name: string): void;
31
- /**
32
- * Sets a style attribute
33
- * @param el {HTMLElement} element to manipulate
34
- * @param prop {string} property name
35
- * @param value {string} property value
36
- */
37
- setStyle(el: HTMLElement, prop: string, value: string): void;
38
- /**
39
- * Inserts a child before target
40
- * @param target {Element} target element
41
- * @param child {Node} element to insert before
42
- */
43
- insertBefore(target: Node, child: Node): void;
44
- /**
45
- * Appends a child to element
46
- * @param el {Element} element
47
- * @param child {Node} child to be inserted
48
- */
49
- appendChild(el: Element, child: Node): void;
50
- /**
51
- * Calls a call-back function
52
- * @param cb {function} call-back function
53
- */
54
- callCallback(cb: () => void): void;
55
- }
56
- /**
57
- * Executor which execute any commands immediately
58
- * @class InstantExecutor
59
- * @extends Executor
60
- */
61
- export declare class InstantExecutor extends Executor {
62
- addClass(el: Element, cl: string): void;
63
- removeClass(el: Element, cl: string): void;
64
- setAttribute(el: Element, name: string, value: string): void;
65
- removeAttribute(el: Element, name: string): void;
66
- setStyle(el: HTMLElement, prop: string, value: string): void;
67
- insertBefore(target: Node, child: Node): void;
68
- appendChild(el: Node, child: Node): void;
69
- callCallback(cb: () => void): void;
70
- }
71
- /**
72
- * Executor which execute any commands over timeout
73
- * @class TimeoutExecutor
74
- * @extends InstantExecutor
75
- */
76
- export declare class TimeoutExecutor extends InstantExecutor {
77
- addClass(el: Element, cl: string): void;
78
- removeClass(el: Element, cl: string): void;
79
- setAttribute(el: Element, name: string, value: string): void;
80
- removeAttribute(el: Element, name: string): void;
81
- setStyle(el: HTMLElement, prop: string, value: string): void;
82
- insertBefore(target: Node, child: Node): void;
83
- appendChild(el: Node, child: Node): void;
84
- callCallback(cb: () => void): void;
85
- }
86
- export declare const instantExecutor: InstantExecutor;
87
- export declare const timeoutExecutor: TimeoutExecutor;
@@ -1,35 +0,0 @@
1
- /**
2
- * Signal is an event generator
3
- * @class Signal
4
- */
5
- export declare class Signal<T1 = void, T2 = void, T3 = void, T4 = void, T5 = void, T6 = void, T7 = void, T8 = void, T9 = void> {
6
- /**
7
- * Handler of event
8
- * @type {Set}
9
- * @private
10
- */
11
- private handlers;
12
- /**
13
- * Emit event
14
- * @param a1 {*} argument
15
- * @param a2 {*} argument
16
- * @param a3 {*} argument
17
- * @param a4 {*} argument
18
- * @param a5 {*} argument
19
- * @param a6 {*} argument
20
- * @param a7 {*} argument
21
- * @param a8 {*} argument
22
- * @param a9 {*} argument
23
- */
24
- emit(a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9): void;
25
- /**
26
- * Subscribe to event
27
- * @param func {function} handler
28
- */
29
- subscribe(func: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9) => void): void;
30
- /**
31
- * Unsubscribe from event
32
- * @param func {function} handler
33
- */
34
- unsubscribe(func: (a1: T1, a2: T2, a3: T3, a4: T4, a5: T5, a6: T6, a7: T7, a8: T8, a9: T9) => void): void;
35
- }