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.
Files changed (74) hide show
  1. package/README.md +4 -0
  2. package/cdn/es2015.js +827 -827
  3. package/cdn/es5.js +909 -829
  4. package/flow-typed/vasille.js +2647 -835
  5. package/lib/binding/attribute.js +8 -3
  6. package/lib/binding/binding.js +5 -5
  7. package/lib/binding/class.js +4 -4
  8. package/lib/binding/style.js +2 -2
  9. package/lib/core/core.js +73 -17
  10. package/lib/core/destroyable.js +2 -2
  11. package/lib/core/ivalue.js +4 -4
  12. package/lib/functional/components.js +17 -0
  13. package/lib/functional/merge.js +41 -0
  14. package/lib/functional/models.js +26 -0
  15. package/lib/functional/options.js +1 -0
  16. package/lib/functional/reactivity.js +33 -0
  17. package/lib/functional/stack.js +127 -0
  18. package/lib/index.js +2 -7
  19. package/lib/models/array-model.js +9 -0
  20. package/lib/models/object-model.js +28 -14
  21. package/lib/node/app.js +21 -12
  22. package/lib/node/node.js +229 -573
  23. package/lib/node/watch.js +6 -14
  24. package/lib/spec/html.js +1 -0
  25. package/lib/spec/react.js +1 -0
  26. package/lib/spec/svg.js +1 -0
  27. package/lib/v/index.js +23 -0
  28. package/lib/value/expression.js +21 -18
  29. package/lib/value/mirror.js +15 -15
  30. package/lib/value/pointer.js +5 -5
  31. package/lib/value/reference.js +18 -18
  32. package/lib/views/array-view.js +6 -10
  33. package/lib/views/base-view.js +12 -23
  34. package/lib/views/map-view.js +4 -9
  35. package/lib/views/object-view.js +4 -7
  36. package/lib/views/repeat-node.js +10 -22
  37. package/lib/views/set-view.js +4 -11
  38. package/package.json +3 -1
  39. package/types/binding/attribute.d.ts +2 -2
  40. package/types/binding/binding.d.ts +1 -1
  41. package/types/core/core.d.ts +31 -43
  42. package/types/core/destroyable.d.ts +2 -2
  43. package/types/core/ivalue.d.ts +4 -4
  44. package/types/functional/components.d.ts +4 -0
  45. package/types/functional/merge.d.ts +1 -0
  46. package/types/functional/models.d.ts +10 -0
  47. package/types/functional/options.d.ts +23 -0
  48. package/types/functional/reactivity.d.ts +11 -0
  49. package/types/functional/stack.d.ts +24 -0
  50. package/types/index.d.ts +3 -7
  51. package/types/models/array-model.d.ts +1 -0
  52. package/types/models/object-model.d.ts +2 -0
  53. package/types/node/app.d.ts +19 -17
  54. package/types/node/node.d.ts +67 -388
  55. package/types/node/watch.d.ts +9 -15
  56. package/types/spec/html.d.ts +975 -0
  57. package/types/spec/react.d.ts +4 -0
  58. package/types/spec/svg.d.ts +314 -0
  59. package/types/v/index.d.ts +36 -0
  60. package/types/value/expression.d.ts +11 -24
  61. package/types/value/mirror.d.ts +6 -6
  62. package/types/value/pointer.d.ts +1 -1
  63. package/types/value/reference.d.ts +7 -7
  64. package/types/views/array-view.d.ts +3 -4
  65. package/types/views/base-view.d.ts +8 -16
  66. package/types/views/map-view.d.ts +2 -3
  67. package/types/views/object-view.d.ts +2 -3
  68. package/types/views/repeat-node.d.ts +8 -9
  69. package/types/views/set-view.d.ts +2 -3
  70. package/types/core/executor.d.ts +0 -87
  71. package/types/core/signal.d.ts +0 -35
  72. package/types/core/slot.d.ts +0 -45
  73. package/types/node/interceptor.d.ts +0 -50
  74. package/types/views/repeater.d.ts +0 -38
@@ -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
- }
@@ -1,45 +0,0 @@
1
- import { Fragment } from "../node/node";
2
- /**
3
- * Component slot
4
- * @class Slot
5
- */
6
- export declare class Slot<t extends Fragment = Fragment, t1 = void, t2 = void, t3 = void, t4 = void, t5 = void, t6 = void, t7 = void, t8 = void, t9 = void> {
7
- /**
8
- * Function to run
9
- * @type {function(node : Fragment)}
10
- */
11
- private runner?;
12
- /**
13
- * Sets the runner
14
- * @param func {function} the function to run
15
- */
16
- insert(func: (a0: t, a1: t1, a2: t2, a3: t3, a4: t4, a5: t5, a6: t6, a7: t7, a8: t8, a9: t9) => void): void;
17
- /**
18
- * @param a0 {Fragment} node to paste content
19
- * @param a1 {*} 1st argument
20
- * @param a2 {*} 2nd argument
21
- * @param a3 {*} 3rd argument
22
- * @param a4 {*} 4th argument
23
- * @param a5 {*} 5th argument
24
- * @param a6 {*} 6th argument
25
- * @param a7 {*} 7th argument
26
- * @param a8 {*} 8th argument
27
- * @param a9 {*} 9th argument
28
- */
29
- release(a0: t, a1: t1, a2: t2, a3: t3, a4: t4, a5: t5, a6: t6, a7: t7, a8: t8, a9: t9): void;
30
- /**
31
- * Predefine a handler for a slot
32
- * @param func {function(node : Fragment)} Function to run if no handler specified
33
- * @param a0 {Fragment} node to paste content
34
- * @param a1 {*} 1st argument
35
- * @param a2 {*} 2nd argument
36
- * @param a3 {*} 3rd argument
37
- * @param a4 {*} 4th argument
38
- * @param a5 {*} 5th argument
39
- * @param a6 {*} 6th argument
40
- * @param a7 {*} 7th argument
41
- * @param a8 {*} 8th argument
42
- * @param a9 {*} 9th argument
43
- */
44
- predefine(func: (a0: t, a1: t1, a2: t2, a3: t3, a4: t4, a5: t5, a6: t6, a7: t7, a8: t8, a9: t9) => void, a0: t, a1: t1, a2: t2, a3: t3, a4: t4, a5: t5, a6: t6, a7: t7, a8: t8, a9: t9): void;
45
- }
@@ -1,50 +0,0 @@
1
- import { Fragment } from "./node";
2
- import { Destroyable } from "../core/destroyable";
3
- import { Signal } from "../core/signal";
4
- import { Slot } from "../core/slot";
5
- /**
6
- * Interceptor is designed to connect signals & methods of children elements
7
- * @class Interceptor
8
- * @extends Destroyable
9
- */
10
- export declare class Interceptor<t1 = void, t2 = void, t3 = void, t4 = void, t5 = void, t6 = void, t7 = void, t8 = void, t9 = void> extends Destroyable {
11
- /**
12
- * Set of signals
13
- * @type Set
14
- */
15
- signals: Set<Signal<t1, t2, t3, t4, t5, t6, t7, t8, t9>>;
16
- /**
17
- * Set of handlers
18
- * @type Set
19
- */
20
- handlers: Set<(a1: t1, a2: t2, a3: t3, a4: t4, a5: t5, a6: t6, a7: t7, a8: t8, a9: t9) => void>;
21
- /**
22
- * Connect a signal or a handler
23
- * @param thing {Signal | function}
24
- */
25
- connect(thing: Signal<t1, t2, t3, t4, t5, t6, t7, t8, t9> | ((a1: t1, a2: t2, a3: t3, a4: t4, a5: t5, a6: t6, a7: t7, a8: t8, a9: t9) => void)): void;
26
- /**
27
- * Disconnect a handler from signals
28
- * @param handler {function}
29
- */
30
- disconnect(handler: (a1: t1, a2: t2, a3: t3, a4: t4, a5: t5, a6: t6, a7: t7, a8: t8, a9: t9) => void): void;
31
- destroy(): void;
32
- }
33
- /**
34
- * Interceptor node to implement directly to vasille DOM
35
- * @class InterceptorNode
36
- * @extends Extension
37
- */
38
- export declare class InterceptorNode<t1 = void, t2 = void, t3 = void, t4 = void, t5 = void, t6 = void, t7 = void, t8 = void, t9 = void> extends Fragment {
39
- /**
40
- * Internal interceptor
41
- * @type Interceptor
42
- */
43
- interceptor: Interceptor<t1, t2, t3, t4, t5, t6, t7, t8, t9>;
44
- /**
45
- * The default slot of node
46
- * @type Slot
47
- */
48
- slot: Slot<Fragment, Interceptor<t1, t2, t3, t4, t5, t6, t7, t8, t9>>;
49
- compose(): void;
50
- }
@@ -1,38 +0,0 @@
1
- import { RepeatNode, RepeatNodePrivate } from "./repeat-node";
2
- import { IValue } from "../core/ivalue";
3
- /**
4
- * Private part of repeater
5
- * @class RepeaterPrivate
6
- * @extends RepeatNodePrivate
7
- */
8
- export declare class RepeaterPrivate<IdT> extends RepeatNodePrivate<IdT> {
9
- /**
10
- * Handler to catch count updates
11
- */
12
- updateHandler: (value: number) => void;
13
- /**
14
- * Current count of child nodes
15
- */
16
- currentCount: number;
17
- constructor();
18
- }
19
- /**
20
- * The simplest repeat node interpretation, repeat children pack a several times
21
- * @class Repeater
22
- * @extends RepeatNode
23
- */
24
- export declare class Repeater extends RepeatNode<number, number> {
25
- protected $: RepeaterPrivate<number>;
26
- /**
27
- * The count of children
28
- */
29
- count: IValue<number>;
30
- constructor($?: RepeaterPrivate<number>);
31
- /**
32
- * Changes the children count
33
- */
34
- changeCount(number: number): void;
35
- created(): void;
36
- ready(): void;
37
- destroy(): void;
38
- }