vasille 2.0.5 → 2.2.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.
- package/README.md +4 -0
- package/cdn/es2015.js +827 -827
- package/cdn/es5.js +909 -829
- package/flow-typed/vasille.js +2647 -835
- package/lib/binding/attribute.js +8 -3
- package/lib/binding/binding.js +5 -5
- package/lib/binding/class.js +4 -4
- package/lib/binding/style.js +2 -2
- package/lib/core/core.js +73 -17
- package/lib/core/destroyable.js +2 -2
- package/lib/core/ivalue.js +4 -4
- package/lib/functional/components.js +17 -0
- package/lib/functional/merge.js +41 -0
- package/lib/functional/models.js +26 -0
- package/lib/functional/options.js +1 -0
- package/lib/functional/reactivity.js +33 -0
- package/lib/functional/stack.js +127 -0
- package/lib/index.js +2 -7
- package/lib/models/array-model.js +9 -0
- package/lib/models/object-model.js +28 -14
- package/lib/node/app.js +21 -12
- package/lib/node/node.js +229 -573
- package/lib/node/watch.js +6 -14
- package/lib/spec/html.js +1 -0
- package/lib/spec/react.js +1 -0
- package/lib/spec/svg.js +1 -0
- package/lib/v/index.js +23 -0
- package/lib/value/expression.js +21 -18
- package/lib/value/mirror.js +15 -15
- package/lib/value/pointer.js +5 -5
- package/lib/value/reference.js +18 -18
- package/lib/views/array-view.js +6 -10
- package/lib/views/base-view.js +12 -23
- package/lib/views/map-view.js +4 -9
- package/lib/views/object-view.js +4 -7
- package/lib/views/repeat-node.js +10 -22
- package/lib/views/set-view.js +4 -11
- package/package.json +3 -1
- package/types/binding/attribute.d.ts +2 -2
- package/types/binding/binding.d.ts +1 -1
- package/types/core/core.d.ts +31 -43
- package/types/core/destroyable.d.ts +2 -2
- package/types/core/ivalue.d.ts +4 -4
- package/types/functional/components.d.ts +4 -0
- package/types/functional/merge.d.ts +1 -0
- package/types/functional/models.d.ts +10 -0
- package/types/functional/options.d.ts +23 -0
- package/types/functional/reactivity.d.ts +11 -0
- package/types/functional/stack.d.ts +24 -0
- package/types/index.d.ts +3 -7
- package/types/models/array-model.d.ts +1 -0
- package/types/models/object-model.d.ts +2 -0
- package/types/node/app.d.ts +19 -17
- package/types/node/node.d.ts +67 -388
- package/types/node/watch.d.ts +9 -15
- package/types/spec/html.d.ts +975 -0
- package/types/spec/react.d.ts +4 -0
- package/types/spec/svg.d.ts +314 -0
- package/types/v/index.d.ts +36 -0
- package/types/value/expression.d.ts +11 -24
- package/types/value/mirror.d.ts +6 -6
- package/types/value/pointer.d.ts +1 -1
- package/types/value/reference.d.ts +7 -7
- package/types/views/array-view.d.ts +3 -4
- package/types/views/base-view.d.ts +8 -16
- package/types/views/map-view.d.ts +2 -3
- package/types/views/object-view.d.ts +2 -3
- package/types/views/repeat-node.d.ts +8 -9
- package/types/views/set-view.d.ts +2 -3
- package/types/core/executor.d.ts +0 -87
- package/types/core/signal.d.ts +0 -35
- package/types/core/slot.d.ts +0 -45
- package/types/node/interceptor.d.ts +0 -50
- package/types/views/repeater.d.ts +0 -38
|
@@ -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,36 @@
|
|
|
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 type VApp<In extends AppOptions<any> = AppOptions<'div'>> = (node: Element, opts: In) => In['return'];
|
|
11
|
+
export declare type VComponent<In extends TagOptions<any>> = (opts: In, callback?: In['slot']) => In['return'];
|
|
12
|
+
export declare type VFragment<In extends Options = Options> = (opts: In, callback?: In['slot']) => In['return'];
|
|
13
|
+
export declare type VExtension<In extends TagOptions<any>> = (opts: In, callback?: In['slot']) => In['return'];
|
|
14
|
+
export declare const v: {
|
|
15
|
+
merge: typeof merge;
|
|
16
|
+
destructor(): any;
|
|
17
|
+
runOnDestroy(callback: () => void): void;
|
|
18
|
+
if(condition: import("../index").IValue<boolean>, callback: () => void): void;
|
|
19
|
+
else(callback: () => void): void;
|
|
20
|
+
elif(condition: import("../index").IValue<boolean>, callback: () => void): void;
|
|
21
|
+
for<T, K>(model: import("../models/model").ListenableModel<K, T>, callback: (value: T, index: K) => void): void;
|
|
22
|
+
watch<T_1>(model: import("../index").IValue<T_1>, callback: (value: T_1) => void): void;
|
|
23
|
+
nextTick(callback: () => void): void;
|
|
24
|
+
ref(value: any): import("../index").IValue<any>;
|
|
25
|
+
expr: typeof expr;
|
|
26
|
+
of: typeof valueOf;
|
|
27
|
+
sv: typeof setValue;
|
|
28
|
+
alwaysFalse: Reference<boolean>;
|
|
29
|
+
app: typeof app;
|
|
30
|
+
component: typeof component;
|
|
31
|
+
fragment: typeof fragment;
|
|
32
|
+
extension: typeof extension;
|
|
33
|
+
text: typeof text;
|
|
34
|
+
tag: typeof tag;
|
|
35
|
+
create: typeof create;
|
|
36
|
+
};
|
|
@@ -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,
|
|
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,31 +33,15 @@ 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: (
|
|
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
|
-
on(handler: (value: T) => void): this;
|
|
56
|
-
off(handler: (value: T) => void): this;
|
|
57
|
-
enable(): this;
|
|
58
|
-
disable(): this;
|
|
59
|
-
destroy(): void;
|
|
42
|
+
$on(handler: (value: T) => void): this;
|
|
43
|
+
$off(handler: (value: T) => void): this;
|
|
44
|
+
$enable(): this;
|
|
45
|
+
$disable(): this;
|
|
46
|
+
$destroy(): void;
|
|
60
47
|
}
|
package/types/value/mirror.d.ts
CHANGED
|
@@ -11,16 +11,16 @@ export declare class Mirror<T> extends Reference<T> {
|
|
|
11
11
|
* pointed value
|
|
12
12
|
* @type IValue
|
|
13
13
|
*/
|
|
14
|
-
protected pointedValue: IValue<T>;
|
|
14
|
+
protected $pointedValue: IValue<T>;
|
|
15
15
|
/**
|
|
16
16
|
* Collection of handlers
|
|
17
17
|
* @type Set
|
|
18
18
|
*/
|
|
19
|
-
private readonly handler;
|
|
19
|
+
private readonly $handler;
|
|
20
20
|
/**
|
|
21
21
|
* Ensure forward only synchronization
|
|
22
22
|
*/
|
|
23
|
-
forwardOnly: boolean;
|
|
23
|
+
$forwardOnly: boolean;
|
|
24
24
|
/**
|
|
25
25
|
* Constructs a notifiable bind to a value
|
|
26
26
|
* @param value {IValue} is initial value
|
|
@@ -29,7 +29,7 @@ export declare class Mirror<T> extends Reference<T> {
|
|
|
29
29
|
constructor(value: IValue<T>, forwardOnly?: boolean);
|
|
30
30
|
get $(): T;
|
|
31
31
|
set $(v: T);
|
|
32
|
-
enable(): void;
|
|
33
|
-
disable(): void;
|
|
34
|
-
destroy(): void;
|
|
32
|
+
$enable(): void;
|
|
33
|
+
$disable(): void;
|
|
34
|
+
$destroy(): void;
|
|
35
35
|
}
|
package/types/value/pointer.d.ts
CHANGED
|
@@ -9,22 +9,22 @@ export declare class Reference<T> extends IValue<T> {
|
|
|
9
9
|
* The encapsulated value
|
|
10
10
|
* @type {*}
|
|
11
11
|
*/
|
|
12
|
-
private value;
|
|
12
|
+
private $value;
|
|
13
13
|
/**
|
|
14
14
|
* Array of handlers
|
|
15
15
|
* @type {Set}
|
|
16
16
|
* @readonly
|
|
17
17
|
*/
|
|
18
|
-
private readonly onchange;
|
|
18
|
+
private readonly $onchange;
|
|
19
19
|
/**
|
|
20
20
|
* @param value {any} the initial value
|
|
21
21
|
*/
|
|
22
22
|
constructor(value: T);
|
|
23
23
|
get $(): T;
|
|
24
24
|
set $(value: T);
|
|
25
|
-
enable(): void;
|
|
26
|
-
disable(): void;
|
|
27
|
-
on(handler: (value: T) => void): void;
|
|
28
|
-
off(handler: (value: T) => void): void;
|
|
29
|
-
destroy(): void;
|
|
25
|
+
$enable(): void;
|
|
26
|
+
$disable(): void;
|
|
27
|
+
$on(handler: (value: T) => void): void;
|
|
28
|
+
$off(handler: (value: T) => void): void;
|
|
29
|
+
$destroy(): void;
|
|
30
30
|
}
|
|
@@ -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
|
-
|
|
11
|
-
|
|
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
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
2
|
+
import { Options } from "../functional/options";
|
|
3
3
|
/**
|
|
4
4
|
* Private part of repeat node
|
|
5
5
|
* @class RepeatNodePrivate
|
|
@@ -12,24 +12,23 @@ export declare class RepeatNodePrivate<IdT> extends INodePrivate {
|
|
|
12
12
|
*/
|
|
13
13
|
nodes: Map<IdT, Fragment>;
|
|
14
14
|
constructor();
|
|
15
|
-
destroy(): void;
|
|
15
|
+
$destroy(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface RNO<T, IdT> extends Options {
|
|
18
|
+
slot?: (node: Fragment, value: T, index: IdT) => void;
|
|
16
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(
|
|
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
|
-
|
|
10
|
-
ready(): void;
|
|
9
|
+
protected compose(input: BSO<T, T, SetModel<T>>): void;
|
|
11
10
|
}
|