vasille 2.3.4 → 2.3.7

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 CHANGED
@@ -34,12 +34,12 @@ There are several modes to use Vasille.
34
34
  ### Documentation for beginners (how to create the first project step by step):
35
35
  * [`Vasille Core Library` - the hard way - `low-level`](https://gitlab.com/vasille-js/vasille-js/-/blob/v2/pages/GetStarted.md)
36
36
  * [`Vasille Less Library` - perfect for me - `high-level`](https://gitlab.com/vasille-js/vasille-less/-/blob/v2/pages/GetStarted.md)
37
- * [`Vasille Magic` - perfect for you - `highest-level`](https://gitlab.com/vasille-js/vcc/-/blob/master/pages/GetStarted.md)
37
+ * [`Vasille Magic` - perfect for you - `highest-level`](https://gitlab.com/vasille-js/vasille-magic/-/blob/master/pages/GetStarted.md)
38
38
 
39
39
  ### Full documentation:
40
40
  * [`Vasille Core Library API`- write anything - `low-level`](https://gitlab.com/vasille-js/vasille-js/-/blob/v2/pages/Vasille-Core-Library-API.md)
41
41
  * [`Vasille Less Library API`- write less do more - `high-level`](https://gitlab.com/vasille-js/vasille-less/-/blob/v2/pages/Vasille-Less-Library-API.md)
42
- * [`Vasille Magic API`- compiler writes for you - `highest-level`](https://gitlab.com/vasille-js/vasille-js/-/blob/v2/pages/API.md)
42
+ * [`Vasille Magic API`- compiler writes for you - `highest-level`](https://gitlab.com/vasille-js/vasille-magic/-/blob/master/pages/Vasille-Magic-API.md)
43
43
 
44
44
  ### Getting ready be example
45
45
  * [TypeScript Example](https://gitlab.com/vasille-js/learning/vasille-ts-example)
@@ -50,7 +50,7 @@ There are several modes to use Vasille.
50
50
 
51
51
  ## How SAFE is Vasille
52
52
 
53
- The safe of your application is ensured by
53
+ The safe of your application is ensured by
54
54
  * `100%` coverage of `vasille` code by unit tests.
55
55
  Each function, each branch are working as designed.
56
56
  * `strong typing` makes your javascript/typescript code safe as C++ code.
@@ -87,11 +87,11 @@ The test project was coded using the next frameworks:
87
87
  [Try Initial](https://vasille-js.gitlab.io/project-x32/vasille-js/) /
88
88
  [Try Optimized](https://vasille-js.gitlab.io/project-x32-if/vasille-js/).
89
89
 
90
- The result of test are demonstrated in figures 1 & 2.
90
+ The result of test are demonstrated in figures 1 & 2.
91
91
  The test result are measured in FPS (frames per second), which is calculated as `1000 / ft`,
92
92
  where `ft` is an average frame time in ms of 20 frames. All values are absolute. Higher is better.
93
93
 
94
- The initial version is updating all the page content in each frame.
94
+ The initial version is updating all the page content in each frame.
95
95
  The page reactivity connections are very complex, and we get poor results in Angular, React, Vue & Svelte.
96
96
 
97
97
  The optimized version disables the offscreen & non-actual content, which simplifies the
package/cdn/es2015.js CHANGED
@@ -345,7 +345,7 @@ class Reactive extends Destroyable {
345
345
  throw notOverwritten();
346
346
  }
347
347
  composeNow() {
348
- this.compose(this.input);
348
+ return this.compose(this.input);
349
349
  }
350
350
  runFunctional(f, ...args) {
351
351
  stack(this);
@@ -1393,6 +1393,7 @@ class Fragment extends Reactive {
1393
1393
  }
1394
1394
  compose(input) {
1395
1395
  input.slot && input.slot(this);
1396
+ return {};
1396
1397
  }
1397
1398
  /** To be overloaded: ready event handler */
1398
1399
  ready() {
@@ -1933,6 +1934,7 @@ class Tag extends INode {
1933
1934
  }
1934
1935
  compose(input) {
1935
1936
  input.slot && input.slot(this);
1937
+ return {};
1936
1938
  }
1937
1939
  findFirstChild() {
1938
1940
  return this.$.unmounted ? null : this.$.node;
@@ -2011,9 +2013,10 @@ class Extension extends INode {
2011
2013
  */
2012
2014
  class Component extends Extension {
2013
2015
  init() {
2014
- super.composeNow();
2016
+ const ret = super.composeNow();
2015
2017
  this.ready();
2016
2018
  super.applyOptionsNow();
2019
+ return ret;
2017
2020
  }
2018
2021
  ready() {
2019
2022
  super.ready();
@@ -2219,6 +2222,7 @@ class Watch extends Fragment {
2219
2222
  input.slot && input.slot(this, value);
2220
2223
  }, input.model);
2221
2224
  input.slot(this, input.model.$);
2225
+ return {};
2222
2226
  }
2223
2227
  }
2224
2228
 
@@ -2330,6 +2334,7 @@ class BaseView extends RepeatNode {
2330
2334
  input.model.listener.offAdd($.addHandler);
2331
2335
  input.model.listener.offRemove($.removeHandler);
2332
2336
  });
2337
+ return {};
2333
2338
  }
2334
2339
  }
2335
2340
 
@@ -2351,6 +2356,7 @@ class ArrayView extends BaseView {
2351
2356
  input.model.forEach(item => {
2352
2357
  this.createChild(input, item, item);
2353
2358
  });
2359
+ return {};
2354
2360
  }
2355
2361
  }
2356
2362
 
@@ -2368,6 +2374,7 @@ class MapView extends BaseView {
2368
2374
  input.model.forEach((value, key) => {
2369
2375
  this.createChild(input, key, value);
2370
2376
  });
2377
+ return {};
2371
2378
  }
2372
2379
  }
2373
2380
 
@@ -2387,6 +2394,7 @@ class ObjectView extends BaseView {
2387
2394
  this.createChild(input, key, obj[key]);
2388
2395
  }
2389
2396
  super.ready();
2397
+ return {};
2390
2398
  }
2391
2399
  }
2392
2400
 
@@ -2405,6 +2413,7 @@ class SetView extends BaseView {
2405
2413
  set.forEach(item => {
2406
2414
  this.createChild(input, item, item);
2407
2415
  });
2416
+ return {};
2408
2417
  }
2409
2418
  }
2410
2419
 
package/cdn/es5.js CHANGED
@@ -640,7 +640,7 @@ var Reactive = /** @class */ (function (_super) {
640
640
  throw (0, errors_1.notOverwritten)();
641
641
  };
642
642
  Reactive.prototype.composeNow = function () {
643
- this.compose(this.input);
643
+ return this.compose(this.input);
644
644
  };
645
645
  Reactive.prototype.runFunctional = function (f) {
646
646
  var args = [];
@@ -2064,6 +2064,7 @@ var Fragment = /** @class */ (function (_super) {
2064
2064
  };
2065
2065
  Fragment.prototype.compose = function (input) {
2066
2066
  input.slot && input.slot(this);
2067
+ return {};
2067
2068
  };
2068
2069
  /** To be overloaded: ready event handler */
2069
2070
  Fragment.prototype.ready = function () {
@@ -2631,6 +2632,7 @@ var Tag = /** @class */ (function (_super) {
2631
2632
  };
2632
2633
  Tag.prototype.compose = function (input) {
2633
2634
  input.slot && input.slot(this);
2635
+ return {};
2634
2636
  };
2635
2637
  Tag.prototype.findFirstChild = function () {
2636
2638
  return this.$.unmounted ? null : this.$.node;
@@ -2722,9 +2724,10 @@ var Component = /** @class */ (function (_super) {
2722
2724
  return _super !== null && _super.apply(this, arguments) || this;
2723
2725
  }
2724
2726
  Component.prototype.init = function () {
2725
- _super.prototype.composeNow.call(this);
2727
+ var ret = _super.prototype.composeNow.call(this);
2726
2728
  this.ready();
2727
2729
  _super.prototype.applyOptionsNow.call(this);
2730
+ return ret;
2728
2731
  };
2729
2732
  Component.prototype.ready = function () {
2730
2733
  _super.prototype.ready.call(this);
@@ -2960,6 +2963,7 @@ var Watch = /** @class */ (function (_super) {
2960
2963
  input.slot && input.slot(_this, value);
2961
2964
  }, input.model);
2962
2965
  input.slot(this, input.model.$);
2966
+ return {};
2963
2967
  };
2964
2968
  return Watch;
2965
2969
  }(node_1.Fragment));
@@ -3122,6 +3126,7 @@ var BaseView = /** @class */ (function (_super) {
3122
3126
  input.model.listener.offAdd($.addHandler);
3123
3127
  input.model.listener.offRemove($.removeHandler);
3124
3128
  });
3129
+ return {};
3125
3130
  };
3126
3131
  return BaseView;
3127
3132
  }(repeat_node_1.RepeatNode));
@@ -3167,6 +3172,7 @@ var ArrayView = /** @class */ (function (_super) {
3167
3172
  input.model.forEach(function (item) {
3168
3173
  _this.createChild(input, item, item);
3169
3174
  });
3175
+ return {};
3170
3176
  };
3171
3177
  return ArrayView;
3172
3178
  }(base_view_1.BaseView));
@@ -3209,6 +3215,7 @@ var MapView = /** @class */ (function (_super) {
3209
3215
  input.model.forEach(function (value, key) {
3210
3216
  _this.createChild(input, key, value);
3211
3217
  });
3218
+ return {};
3212
3219
  };
3213
3220
  return MapView;
3214
3221
  }(base_view_1.BaseView));
@@ -3252,6 +3259,7 @@ var ObjectView = /** @class */ (function (_super) {
3252
3259
  this.createChild(input, key, obj[key]);
3253
3260
  }
3254
3261
  _super.prototype.ready.call(this);
3262
+ return {};
3255
3263
  };
3256
3264
  return ObjectView;
3257
3265
  }(base_view_1.BaseView));
@@ -3295,6 +3303,7 @@ var SetView = /** @class */ (function (_super) {
3295
3303
  set.forEach(function (item) {
3296
3304
  _this.createChild(input, item, item);
3297
3305
  });
3306
+ return {};
3298
3307
  };
3299
3308
  return SetView;
3300
3309
  }(base_view_1.BaseView));
@@ -193,7 +193,7 @@ declare class Reactive<T> extends Destroyable {
193
193
  applyOptions(input: T): void;
194
194
  applyOptionsNow(): void;
195
195
  compose(input: T): T['return'];
196
- composeNow(): void;
196
+ composeNow(): T['return'];
197
197
  runFunctional<F>(f: F, ...args: Parameters<F>): ReturnType<F>;
198
198
  runOnDestroy(func: () => void): void;
199
199
  $destroy(): void;
@@ -231,7 +231,9 @@ declare class Reference<T> extends IValue<T> {
231
231
  }
232
232
 
233
233
 
234
- declare type KindOfIValue<T> = any[];
234
+ export type KindOfIValue<T extends any[]> = {
235
+ [K : string]: IValue<T[K]>;
236
+ };
235
237
  /**
236
238
  * Bind some values to one expression
237
239
  * @class Expression
@@ -640,12 +642,12 @@ declare class SetModel<T> extends Set<T> implements ListenableModel<T, T> {
640
642
  }
641
643
 
642
644
 
643
- declare type EventHandler<T> = (ev: T) => any;
645
+ export type EventHandler<T> = (ev: T) => any;
644
646
  declare interface Tag<Attrs, Events> {
645
647
  attrs: Attrs;
646
648
  events: Events;
647
649
  }
648
- declare type TagEvents = {
650
+ type TagEvents = {
649
651
  [K : string]: EventHandler<HTMLElementEventMap[K]> | undefined;
650
652
  };
651
653
  declare interface TagAttrs {
@@ -682,10 +684,10 @@ declare interface MediaTagAttrs extends TagAttrs {
682
684
  muted: boolean;
683
685
  controls: boolean;
684
686
  }
685
- declare type MediaEvents = {
687
+ type MediaEvents = {
686
688
  [K : string]: EventHandler<HTMLMediaElementEventMap[K]> | undefined;
687
689
  };
688
- declare type VideoEvents = {
690
+ type VideoEvents = {
689
691
  [K : string]: EventHandler<HTMLVideoElementEventMap[K]> | undefined;
690
692
  };
691
693
  declare interface BaseAttrs extends TagAttrs {
@@ -719,7 +721,7 @@ declare interface StyleAttrs extends TagAttrs {
719
721
  media: string;
720
722
  blocking: string;
721
723
  }
722
- declare type BodyEvents = {
724
+ type BodyEvents = {
723
725
  [K : string]: EventHandler<HTMLBodyElementEventMap[K]> | undefined;
724
726
  };
725
727
  declare interface BlockQuoteAttrs extends TagAttrs {
@@ -1076,7 +1078,7 @@ declare interface HtmlTagMap {
1076
1078
  "wbr": Tag<TagAttrs, TagEvents>;
1077
1079
  [K: string]: Tag<TagAttrs, TagEvents>;
1078
1080
  }
1079
- declare type HtmlOrSvgTag = HTMLElement | SVGElement;
1081
+ type HtmlOrSvgTag = HTMLElement | SVGElement;
1080
1082
  declare interface HtmlAndSvgEvents {
1081
1083
  onabort?: ((this: HtmlOrSvgTag, ev: UIEvent) => any) | null;
1082
1084
  onanimationcancel?: ((this: HtmlOrSvgTag, ev: AnimationEvent) => any) | null;
@@ -1617,7 +1619,7 @@ declare interface TagNameMap {
1617
1619
 
1618
1620
 
1619
1621
 
1620
- declare type SvgEvents = {
1622
+ type SvgEvents = {
1621
1623
  [K : string]: EventHandler<SVGElementEventMap[K]> | undefined;
1622
1624
  };
1623
1625
  declare interface SvgAreaAttrs {
@@ -1857,7 +1859,7 @@ declare interface SvgTagMap {
1857
1859
  "use": Tag<SvgUseAttrs, SvgEvents>;
1858
1860
  "view": Tag<SvgViewAttrs, SvgEvents>;
1859
1861
  }
1860
- declare type SvgTag = HtmlAndSvgEvents;
1862
+ type SvgTag = HtmlAndSvgEvents;
1861
1863
  declare interface SvgATag extends SvgTag {
1862
1864
  rel: string;
1863
1865
  }
@@ -1932,8 +1934,8 @@ declare interface SvgTagNameMap {
1932
1934
 
1933
1935
 
1934
1936
 
1935
- declare type AcceptedTagsMap = TagNameMap & SvgTagNameMap;
1936
- declare type AcceptedTagsSpec = HtmlTagMap & SvgTagMap;
1937
+ export type AcceptedTagsMap = TagNameMap & SvgTagNameMap;
1938
+ export type AcceptedTagsSpec = HtmlTagMap & SvgTagMap;
1937
1939
 
1938
1940
 
1939
1941
  /**
@@ -2114,7 +2116,7 @@ declare class Fragment<T> extends Reactive {
2114
2116
  */
2115
2117
  preinit(app: AppNode, parent: Fragment, data?: any): void;
2116
2118
  init(): T['return'];
2117
- compose(input: T): void;
2119
+ compose(input: T): T['return'];
2118
2120
  /** To be overloaded: ready event handler */
2119
2121
  ready(): void;
2120
2122
  /**
@@ -2335,7 +2337,7 @@ declare interface TagOptionsWithSlot<K> extends TagOptions<K> {
2335
2337
  declare class Tag<K> extends INode<TagOptionsWithSlot<K>> {
2336
2338
  constructor(input: TagOptionsWithSlot<K>): void;
2337
2339
  preinit(app: AppNode, parent: Fragment, tagName?: string): void;
2338
- compose(input: TagOptionsWithSlot<K>): void;
2340
+ compose(input: TagOptionsWithSlot<K>): TagOptionsWithSlot<K>['return'];
2339
2341
  findFirstChild(): Node;
2340
2342
  insertAdjacent(node: Node): void;
2341
2343
  appendNode(node: Node): void;
@@ -2365,7 +2367,7 @@ declare class Extension<T> extends INode<T> {
2365
2367
  * @extends Extension
2366
2368
  */
2367
2369
  declare class Component<T> extends Extension<T> {
2368
- init(): void;
2370
+ init(): T['return'];
2369
2371
  ready(): void;
2370
2372
  preinit(app: AppNode, parent: Fragment): void;
2371
2373
  }
@@ -2469,17 +2471,19 @@ declare interface WatchOptions<T> extends FragmentOptions {
2469
2471
  */
2470
2472
  declare class Watch<T> extends Fragment<WatchOptions<T>> {
2471
2473
  input: WatchOptions<T>;
2472
- compose(input: WatchOptions<T>): void;
2474
+ compose(input: WatchOptions<T>): WatchOptions<T>['return'];
2473
2475
  }
2474
2476
 
2475
2477
 
2476
2478
 
2477
2479
  declare interface FragmentOptions {
2478
2480
  "v:is"?: Record<string, IValue<any>>;
2479
- return?: any;
2481
+ return?: {
2482
+ [key: string]: any;
2483
+ };
2480
2484
  slot?: (node: Fragment, ...args: any[]) => void;
2481
2485
  }
2482
- declare type AttrType<T> = IValue<T | string | null> | T | string | null | undefined;
2486
+ export type AttrType<T> = IValue<T | string | null> | T | string | null | undefined;
2483
2487
  declare interface TagOptions<T> extends FragmentOptions {
2484
2488
  "v:attr"?: {
2485
2489
  [K : string]:? AttrType<AcceptedTagsSpec[T]['attrs'][K]>;
@@ -2561,7 +2565,7 @@ declare class BaseView<K, T,Model> extends RepeatNode<K, T, BSO<K, T, Model>> {
2561
2565
  $: BaseViewPrivate<K, T>;
2562
2566
  input: BSO<K, T, Model>;
2563
2567
  constructor(input: BSO<K, T, Model>, $?: BaseViewPrivate<K, T>): void;
2564
- compose(input: BSO<K, T, Model>): void;
2568
+ compose(input: BSO<K, T, Model>): {};
2565
2569
  }
2566
2570
 
2567
2571
 
@@ -2572,7 +2576,7 @@ declare class BaseView<K, T,Model> extends RepeatNode<K, T, BSO<K, T, Model>> {
2572
2576
  */
2573
2577
  declare class ArrayView<T> extends BaseView<T, T, ArrayModel<T>> {
2574
2578
  createChild(input: BSO<T, T, ArrayModel<T>>, id: T, item: T, before?: Fragment): any;
2575
- compose(input: BSO<T, T, ArrayModel<T>>): void;
2579
+ compose(input: BSO<T, T, ArrayModel<T>>): {};
2576
2580
  }
2577
2581
 
2578
2582
 
@@ -2582,7 +2586,7 @@ declare class ArrayView<T> extends BaseView<T, T, ArrayModel<T>> {
2582
2586
  * @extends BaseView
2583
2587
  */
2584
2588
  declare class MapView<K, T> extends BaseView<K, T, MapModel<K, T>> {
2585
- compose(input: BSO<K, T, MapModel<K, T>>): void;
2589
+ compose(input: BSO<K, T, MapModel<K, T>>): {};
2586
2590
  }
2587
2591
 
2588
2592
 
@@ -2592,7 +2596,7 @@ declare class MapView<K, T> extends BaseView<K, T, MapModel<K, T>> {
2592
2596
  * @extends BaseView
2593
2597
  */
2594
2598
  declare class ObjectView<T> extends BaseView<string, T, ObjectModel<T>> {
2595
- compose(input: BSO<string, T, ObjectModel<T>>): void;
2599
+ compose(input: BSO<string, T, ObjectModel<T>>): {};
2596
2600
  }
2597
2601
 
2598
2602
 
@@ -2602,7 +2606,7 @@ declare class ObjectView<T> extends BaseView<string, T, ObjectModel<T>> {
2602
2606
  * @extends BaseView
2603
2607
  */
2604
2608
  declare class SetView<T> extends BaseView<T, T, SetModel<T>> {
2605
- compose(input: BSO<T, T, SetModel<T>>): void;
2609
+ compose(input: BSO<T, T, SetModel<T>>): {};
2606
2610
  }
2607
2611
 
2608
2612
 
package/lib/core/core.js CHANGED
@@ -216,7 +216,7 @@ export class Reactive extends Destroyable {
216
216
  throw notOverwritten();
217
217
  }
218
218
  composeNow() {
219
- this.compose(this.input);
219
+ return this.compose(this.input);
220
220
  }
221
221
  runFunctional(f, ...args) {
222
222
  stack(this);
package/lib/node/node.js CHANGED
@@ -76,6 +76,7 @@ export class Fragment extends Reactive {
76
76
  }
77
77
  compose(input) {
78
78
  input.slot && input.slot(this);
79
+ return {};
79
80
  }
80
81
  /** To be overloaded: ready event handler */
81
82
  ready() {
@@ -616,6 +617,7 @@ export class Tag extends INode {
616
617
  }
617
618
  compose(input) {
618
619
  input.slot && input.slot(this);
620
+ return {};
619
621
  }
620
622
  findFirstChild() {
621
623
  return this.$.unmounted ? null : this.$.node;
@@ -694,9 +696,10 @@ export class Extension extends INode {
694
696
  */
695
697
  export class Component extends Extension {
696
698
  init() {
697
- super.composeNow();
699
+ const ret = super.composeNow();
698
700
  this.ready();
699
701
  super.applyOptionsNow();
702
+ return ret;
700
703
  }
701
704
  ready() {
702
705
  super.ready();
package/lib/node/watch.js CHANGED
@@ -15,5 +15,6 @@ export class Watch extends Fragment {
15
15
  input.slot && input.slot(this, value);
16
16
  }, input.model);
17
17
  input.slot(this, input.model.$);
18
+ return {};
18
19
  }
19
20
  }
@@ -13,5 +13,6 @@ export class ArrayView extends BaseView {
13
13
  input.model.forEach(item => {
14
14
  this.createChild(input, item, item);
15
15
  });
16
+ return {};
16
17
  }
17
18
  }
@@ -34,5 +34,6 @@ export class BaseView extends RepeatNode {
34
34
  input.model.listener.offAdd($.addHandler);
35
35
  input.model.listener.offRemove($.removeHandler);
36
36
  });
37
+ return {};
37
38
  }
38
39
  }
@@ -10,5 +10,6 @@ export class MapView extends BaseView {
10
10
  input.model.forEach((value, key) => {
11
11
  this.createChild(input, key, value);
12
12
  });
13
+ return {};
13
14
  }
14
15
  }
@@ -12,5 +12,6 @@ export class ObjectView extends BaseView {
12
12
  this.createChild(input, key, obj[key]);
13
13
  }
14
14
  super.ready();
15
+ return {};
15
16
  }
16
17
  }
@@ -11,5 +11,6 @@ export class SetView extends BaseView {
11
11
  set.forEach(item => {
12
12
  this.createChild(input, item, item);
13
13
  });
14
+ return {};
14
15
  }
15
16
  }
@@ -222,7 +222,7 @@ class Reactive extends destroyable_js_1.Destroyable {
222
222
  throw (0, errors_1.notOverwritten)();
223
223
  }
224
224
  composeNow() {
225
- this.compose(this.input);
225
+ return this.compose(this.input);
226
226
  }
227
227
  runFunctional(f, ...args) {
228
228
  stack(this);
@@ -80,6 +80,7 @@ class Fragment extends core_1.Reactive {
80
80
  }
81
81
  compose(input) {
82
82
  input.slot && input.slot(this);
83
+ return {};
83
84
  }
84
85
  /** To be overloaded: ready event handler */
85
86
  ready() {
@@ -625,6 +626,7 @@ class Tag extends INode {
625
626
  }
626
627
  compose(input) {
627
628
  input.slot && input.slot(this);
629
+ return {};
628
630
  }
629
631
  findFirstChild() {
630
632
  return this.$.unmounted ? null : this.$.node;
@@ -705,9 +707,10 @@ exports.Extension = Extension;
705
707
  */
706
708
  class Component extends Extension {
707
709
  init() {
708
- super.composeNow();
710
+ const ret = super.composeNow();
709
711
  this.ready();
710
712
  super.applyOptionsNow();
713
+ return ret;
711
714
  }
712
715
  ready() {
713
716
  super.ready();
@@ -18,6 +18,7 @@ class Watch extends node_1.Fragment {
18
18
  input.slot && input.slot(this, value);
19
19
  }, input.model);
20
20
  input.slot(this, input.model.$);
21
+ return {};
21
22
  }
22
23
  }
23
24
  exports.Watch = Watch;
@@ -16,6 +16,7 @@ class ArrayView extends base_view_1.BaseView {
16
16
  input.model.forEach(item => {
17
17
  this.createChild(input, item, item);
18
18
  });
19
+ return {};
19
20
  }
20
21
  }
21
22
  exports.ArrayView = ArrayView;
@@ -38,6 +38,7 @@ class BaseView extends repeat_node_1.RepeatNode {
38
38
  input.model.listener.offAdd($.addHandler);
39
39
  input.model.listener.offRemove($.removeHandler);
40
40
  });
41
+ return {};
41
42
  }
42
43
  }
43
44
  exports.BaseView = BaseView;
@@ -13,6 +13,7 @@ class MapView extends base_view_1.BaseView {
13
13
  input.model.forEach((value, key) => {
14
14
  this.createChild(input, key, value);
15
15
  });
16
+ return {};
16
17
  }
17
18
  }
18
19
  exports.MapView = MapView;
@@ -15,6 +15,7 @@ class ObjectView extends base_view_1.BaseView {
15
15
  this.createChild(input, key, obj[key]);
16
16
  }
17
17
  super.ready();
18
+ return {};
18
19
  }
19
20
  }
20
21
  exports.ObjectView = ObjectView;
@@ -14,6 +14,7 @@ class SetView extends base_view_1.BaseView {
14
14
  set.forEach(item => {
15
15
  this.createChild(input, item, item);
16
16
  });
17
+ return {};
17
18
  }
18
19
  }
19
20
  exports.SetView = SetView;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Vasille - Safe. Fast. Powerful.",
4
4
  "main": "lib/index.js",
5
5
  "types": "types/index.d.ts",
6
- "version": "2.3.4",
6
+ "version": "2.3.7",
7
7
  "exports": {
8
8
  "import": "./lib/index.js",
9
9
  "browser": "./lib/index.js",
@@ -46,7 +46,7 @@
46
46
  "@types/events": "3.0.0",
47
47
  "@types/jest": "27.4.1",
48
48
  "@types/jsdom": "16.2.14",
49
- "@types/node": "17.0.23",
49
+ "@types/node": "^18.14.6",
50
50
  "@typescript-eslint/eslint-plugin": "5.18.0",
51
51
  "@typescript-eslint/parser": "5.18.0",
52
52
  "es-check": "latest",
@@ -57,6 +57,6 @@
57
57
  "prettier": "2.7.1",
58
58
  "ts-jest": "27.1.4",
59
59
  "tslint-config-prettier": "^1.18.0",
60
- "typescript": "latest"
60
+ "typescript": "^4.9.5"
61
61
  }
62
62
  }
@@ -127,7 +127,7 @@ export declare class Reactive<T extends FragmentOptions = FragmentOptions> exten
127
127
  protected applyOptions(input: T): void;
128
128
  protected applyOptionsNow(): void;
129
129
  protected compose(input: T): T['return'];
130
- protected composeNow(): void;
130
+ protected composeNow(): T['return'];
131
131
  runFunctional<F extends (...args: any) => any>(f: F, ...args: Parameters<F>): ReturnType<F>;
132
132
  runOnDestroy(func: () => void): void;
133
133
  $destroy(): void;
@@ -3,10 +3,12 @@ import { AcceptedTagsMap, AcceptedTagsSpec } from "../spec/react";
3
3
  import type { Fragment } from "../node/node";
4
4
  export interface FragmentOptions {
5
5
  "v:is"?: Record<string, IValue<any>>;
6
- return?: any;
6
+ return?: {
7
+ [key: string]: any;
8
+ };
7
9
  slot?: (node: Fragment, ...args: any[]) => void;
8
10
  }
9
- export declare type AttrType<T> = IValue<T | string | null> | T | string | null | undefined;
11
+ export type AttrType<T> = IValue<T | string | null> | T | string | null | undefined;
10
12
  export interface TagOptions<T extends keyof AcceptedTagsMap> extends FragmentOptions {
11
13
  "v:attr"?: {
12
14
  [K in keyof AcceptedTagsSpec[T]['attrs']]?: AttrType<AcceptedTagsSpec[T]['attrs'][K]>;
@@ -75,7 +75,7 @@ export declare class Fragment<T extends FragmentOptions = FragmentOptions> exten
75
75
  */
76
76
  preinit(app: AppNode, parent: Fragment, data?: unknown): void;
77
77
  init(): T['return'];
78
- protected compose(input: T): void;
78
+ protected compose(input: T): T['return'];
79
79
  /** To be overloaded: ready event handler */
80
80
  ready(): void;
81
81
  /**
@@ -296,7 +296,7 @@ export interface TagOptionsWithSlot<K extends keyof AcceptedTagsMap> extends Tag
296
296
  export declare class Tag<K extends keyof AcceptedTagsMap> extends INode<TagOptionsWithSlot<K>> {
297
297
  constructor(input: TagOptionsWithSlot<K>);
298
298
  preinit(app: AppNode, parent: Fragment, tagName?: string): void;
299
- protected compose(input: TagOptionsWithSlot<K>): void;
299
+ protected compose(input: TagOptionsWithSlot<K>): TagOptionsWithSlot<K>['return'];
300
300
  protected findFirstChild(): Node;
301
301
  insertAdjacent(node: Node): void;
302
302
  appendNode(node: Node): void;
@@ -326,7 +326,7 @@ export declare class Extension<T extends TagOptions<any> = TagOptions<any>> exte
326
326
  * @extends Extension
327
327
  */
328
328
  export declare class Component<T extends TagOptions<any>> extends Extension<T> {
329
- init(): void;
329
+ init(): T['return'];
330
330
  ready(): void;
331
331
  preinit(app: AppNode, parent: Fragment): void;
332
332
  }
@@ -12,6 +12,6 @@ interface WatchOptions<T> extends FragmentOptions {
12
12
  */
13
13
  export declare class Watch<T> extends Fragment<WatchOptions<T>> {
14
14
  input: WatchOptions<T>;
15
- compose(input: WatchOptions<T>): void;
15
+ compose(input: WatchOptions<T>): WatchOptions<T>['return'];
16
16
  }
17
17
  export {};
@@ -1,9 +1,9 @@
1
- export declare type EventHandler<T> = (ev: T) => any;
1
+ export type EventHandler<T> = (ev: T) => any;
2
2
  export interface Tag<Attrs, Events> {
3
3
  attrs: Attrs;
4
4
  events: Events;
5
5
  }
6
- declare type TagEvents = {
6
+ type TagEvents = {
7
7
  [K in keyof HTMLElementEventMap]: EventHandler<HTMLElementEventMap[K]> | undefined;
8
8
  };
9
9
  interface TagAttrs {
@@ -40,10 +40,10 @@ interface MediaTagAttrs extends TagAttrs {
40
40
  muted: boolean;
41
41
  controls: boolean;
42
42
  }
43
- declare type MediaEvents = {
43
+ type MediaEvents = {
44
44
  [K in keyof HTMLMediaElementEventMap]: EventHandler<HTMLMediaElementEventMap[K]> | undefined;
45
45
  };
46
- declare type VideoEvents = {
46
+ type VideoEvents = {
47
47
  [K in keyof HTMLVideoElementEventMap]: EventHandler<HTMLVideoElementEventMap[K]> | undefined;
48
48
  };
49
49
  interface BaseAttrs extends TagAttrs {
@@ -77,7 +77,7 @@ interface StyleAttrs extends TagAttrs {
77
77
  media: string;
78
78
  blocking: string;
79
79
  }
80
- declare type BodyEvents = {
80
+ type BodyEvents = {
81
81
  [K in keyof HTMLBodyElementEventMap]: EventHandler<HTMLBodyElementEventMap[K]> | undefined;
82
82
  };
83
83
  interface BlockQuoteAttrs extends TagAttrs {
@@ -434,7 +434,7 @@ export interface HtmlTagMap {
434
434
  "wbr": Tag<TagAttrs, TagEvents>;
435
435
  [K: string]: Tag<TagAttrs, TagEvents>;
436
436
  }
437
- declare type HtmlOrSvgTag = HTMLElement | SVGElement;
437
+ type HtmlOrSvgTag = HTMLElement | SVGElement;
438
438
  export interface HtmlAndSvgEvents {
439
439
  onabort?: ((this: HtmlOrSvgTag, ev: UIEvent) => any) | null;
440
440
  onanimationcancel?: ((this: HtmlOrSvgTag, ev: AnimationEvent) => any) | null;
@@ -1,4 +1,4 @@
1
1
  import { SvgTagMap, SvgTagNameMap } from "./svg";
2
2
  import { HtmlTagMap, TagNameMap } from "./html";
3
- export declare type AcceptedTagsMap = TagNameMap & SvgTagNameMap;
4
- export declare type AcceptedTagsSpec = HtmlTagMap & SvgTagMap;
3
+ export type AcceptedTagsMap = TagNameMap & SvgTagNameMap;
4
+ export type AcceptedTagsSpec = HtmlTagMap & SvgTagMap;
@@ -1,5 +1,5 @@
1
1
  import { EventHandler, HtmlAndSvgEvents, Tag } from "./html";
2
- declare type SvgEvents = {
2
+ type SvgEvents = {
3
3
  [K in keyof SVGElementEventMap]: EventHandler<SVGElementEventMap[K]> | undefined;
4
4
  };
5
5
  interface SvgAreaAttrs {
@@ -239,7 +239,7 @@ export interface SvgTagMap {
239
239
  "use": Tag<SvgUseAttrs, SvgEvents>;
240
240
  "view": Tag<SvgViewAttrs, SvgEvents>;
241
241
  }
242
- declare type SvgTag = HtmlAndSvgEvents;
242
+ type SvgTag = HtmlAndSvgEvents;
243
243
  interface SvgATag extends SvgTag {
244
244
  rel: string;
245
245
  }
@@ -1,5 +1,5 @@
1
1
  import { IValue } from "../core/ivalue";
2
- export declare type KindOfIValue<T extends unknown[]> = {
2
+ export type KindOfIValue<T extends unknown[]> = {
3
3
  [K in keyof T]: IValue<T[K]>;
4
4
  };
5
5
  /**
@@ -8,5 +8,5 @@ import { Fragment } from "../node/node";
8
8
  */
9
9
  export declare class ArrayView<T> extends BaseView<T, T, ArrayModel<T>> {
10
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;
11
+ protected compose(input: BSO<T, T, ArrayModel<T>>): {};
12
12
  }
@@ -31,5 +31,5 @@ export declare class BaseView<K, T, Model extends ListenableModel<K, T>> extends
31
31
  protected $: BaseViewPrivate<K, T>;
32
32
  input: BSO<K, T, Model>;
33
33
  constructor(input: BSO<K, T, Model>, $?: BaseViewPrivate<K, T>);
34
- protected compose(input: BSO<K, T, Model>): void;
34
+ protected compose(input: BSO<K, T, Model>): {};
35
35
  }
@@ -6,5 +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
- protected compose(input: BSO<K, T, MapModel<K, T>>): void;
9
+ protected compose(input: BSO<K, T, MapModel<K, T>>): {};
10
10
  }
@@ -6,5 +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
- protected compose(input: BSO<string, T, ObjectModel<T>>): void;
9
+ protected compose(input: BSO<string, T, ObjectModel<T>>): {};
10
10
  }
@@ -6,5 +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
- protected compose(input: BSO<T, T, SetModel<T>>): void;
9
+ protected compose(input: BSO<T, T, SetModel<T>>): {};
10
10
  }