veles 0.0.1
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/LICENSE +21 -0
- package/README.md +304 -0
- package/dist/chunk-EVX3ZDYT.js +271 -0
- package/dist/chunk-EVX3ZDYT.js.map +1 -0
- package/dist/index.cjs +727 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +63 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.js +441 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx-runtime-vDysOz5d.d.cts +250 -0
- package/dist/jsx-runtime-vDysOz5d.d.ts +250 -0
- package/dist/jsx-runtime.cjs +276 -0
- package/dist/jsx-runtime.cjs.map +1 -0
- package/dist/jsx-runtime.d.cts +1 -0
- package/dist/jsx-runtime.d.ts +1 -0
- package/dist/jsx-runtime.js +9 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
type VelesDOMElementProps = {
|
|
2
|
+
onCopy?: any | undefined;
|
|
3
|
+
onCopyCapture?: any | undefined;
|
|
4
|
+
onCut?: any | undefined;
|
|
5
|
+
onCutCapture?: any | undefined;
|
|
6
|
+
onPaste?: any | undefined;
|
|
7
|
+
onPasteCapture?: any | undefined;
|
|
8
|
+
onCompositionEnd?: any | undefined;
|
|
9
|
+
onCompositionEndCapture?: any | undefined;
|
|
10
|
+
onCompositionStart?: any | undefined;
|
|
11
|
+
onCompositionStartCapture?: any | undefined;
|
|
12
|
+
onCompositionUpdate?: any | undefined;
|
|
13
|
+
onCompositionUpdateCapture?: any | undefined;
|
|
14
|
+
onFocus?: any | undefined;
|
|
15
|
+
onFocusCapture?: any | undefined;
|
|
16
|
+
onBlur?: any | undefined;
|
|
17
|
+
onBlurCapture?: any | undefined;
|
|
18
|
+
onChange?: any | undefined;
|
|
19
|
+
onChangeCapture?: any | undefined;
|
|
20
|
+
onBeforeInput?: any | undefined;
|
|
21
|
+
onBeforeInputCapture?: any | undefined;
|
|
22
|
+
onInput?: any | undefined;
|
|
23
|
+
onInputCapture?: any | undefined;
|
|
24
|
+
onReset?: any | undefined;
|
|
25
|
+
onResetCapture?: any | undefined;
|
|
26
|
+
onSubmit?: any | undefined;
|
|
27
|
+
onSubmitCapture?: any | undefined;
|
|
28
|
+
onInvalid?: any | undefined;
|
|
29
|
+
onInvalidCapture?: any | undefined;
|
|
30
|
+
onLoad?: any | undefined;
|
|
31
|
+
onLoadCapture?: any | undefined;
|
|
32
|
+
onError?: any | undefined;
|
|
33
|
+
onErrorCapture?: any | undefined;
|
|
34
|
+
onKeyDown?: any | undefined;
|
|
35
|
+
onKeyDownCapture?: any | undefined;
|
|
36
|
+
/** @deprecated */
|
|
37
|
+
onKeyPress?: any | undefined;
|
|
38
|
+
/** @deprecated */
|
|
39
|
+
onKeyPressCapture?: any | undefined;
|
|
40
|
+
onKeyUp?: any | undefined;
|
|
41
|
+
onKeyUpCapture?: any | undefined;
|
|
42
|
+
onAbort?: any | undefined;
|
|
43
|
+
onAbortCapture?: any | undefined;
|
|
44
|
+
onCanPlay?: any | undefined;
|
|
45
|
+
onCanPlayCapture?: any | undefined;
|
|
46
|
+
onCanPlayThrough?: any | undefined;
|
|
47
|
+
onCanPlayThroughCapture?: any | undefined;
|
|
48
|
+
onDurationChange?: any | undefined;
|
|
49
|
+
onDurationChangeCapture?: any | undefined;
|
|
50
|
+
onEmptied?: any | undefined;
|
|
51
|
+
onEmptiedCapture?: any | undefined;
|
|
52
|
+
onEncrypted?: any | undefined;
|
|
53
|
+
onEncryptedCapture?: any | undefined;
|
|
54
|
+
onEnded?: any | undefined;
|
|
55
|
+
onEndedCapture?: any | undefined;
|
|
56
|
+
onLoadedData?: any | undefined;
|
|
57
|
+
onLoadedDataCapture?: any | undefined;
|
|
58
|
+
onLoadedMetadata?: any | undefined;
|
|
59
|
+
onLoadedMetadataCapture?: any | undefined;
|
|
60
|
+
onLoadStart?: any | undefined;
|
|
61
|
+
onLoadStartCapture?: any | undefined;
|
|
62
|
+
onPause?: any | undefined;
|
|
63
|
+
onPauseCapture?: any | undefined;
|
|
64
|
+
onPlay?: any | undefined;
|
|
65
|
+
onPlayCapture?: any | undefined;
|
|
66
|
+
onPlaying?: any | undefined;
|
|
67
|
+
onPlayingCapture?: any | undefined;
|
|
68
|
+
onProgress?: any | undefined;
|
|
69
|
+
onProgressCapture?: any | undefined;
|
|
70
|
+
onRateChange?: any | undefined;
|
|
71
|
+
onRateChangeCapture?: any | undefined;
|
|
72
|
+
onResize?: any | undefined;
|
|
73
|
+
onResizeCapture?: any | undefined;
|
|
74
|
+
onSeeked?: any | undefined;
|
|
75
|
+
onSeekedCapture?: any | undefined;
|
|
76
|
+
onSeeking?: any | undefined;
|
|
77
|
+
onSeekingCapture?: any | undefined;
|
|
78
|
+
onStalled?: any | undefined;
|
|
79
|
+
onStalledCapture?: any | undefined;
|
|
80
|
+
onSuspend?: any | undefined;
|
|
81
|
+
onSuspendCapture?: any | undefined;
|
|
82
|
+
onTimeUpdate?: any | undefined;
|
|
83
|
+
onTimeUpdateCapture?: any | undefined;
|
|
84
|
+
onVolumeChange?: any | undefined;
|
|
85
|
+
onVolumeChangeCapture?: any | undefined;
|
|
86
|
+
onWaiting?: any | undefined;
|
|
87
|
+
onWaitingCapture?: any | undefined;
|
|
88
|
+
onAuxClick?: (e: MouseEvent) => any | undefined;
|
|
89
|
+
onAuxClickCapture?: (e: MouseEvent) => any | undefined;
|
|
90
|
+
onClick?: (e: MouseEvent) => any | undefined;
|
|
91
|
+
onClickCapture?: (e: MouseEvent) => any | undefined;
|
|
92
|
+
onContextMenu?: (e: MouseEvent) => any | undefined;
|
|
93
|
+
onContextMenuCapture?: (e: MouseEvent) => any | undefined;
|
|
94
|
+
onDoubleClick?: (e: MouseEvent) => any | undefined;
|
|
95
|
+
onDoubleClickCapture?: (e: MouseEvent) => any | undefined;
|
|
96
|
+
onDrag?: any | undefined;
|
|
97
|
+
onDragCapture?: any | undefined;
|
|
98
|
+
onDragEnd?: any | undefined;
|
|
99
|
+
onDragEndCapture?: any | undefined;
|
|
100
|
+
onDragEnter?: any | undefined;
|
|
101
|
+
onDragEnterCapture?: any | undefined;
|
|
102
|
+
onDragExit?: any | undefined;
|
|
103
|
+
onDragExitCapture?: any | undefined;
|
|
104
|
+
onDragLeave?: any | undefined;
|
|
105
|
+
onDragLeaveCapture?: any | undefined;
|
|
106
|
+
onDragOver?: any | undefined;
|
|
107
|
+
onDragOverCapture?: any | undefined;
|
|
108
|
+
onDragStart?: any | undefined;
|
|
109
|
+
onDragStartCapture?: any | undefined;
|
|
110
|
+
onDrop?: any | undefined;
|
|
111
|
+
onDropCapture?: any | undefined;
|
|
112
|
+
onMouseDown?: (e: MouseEvent) => any | undefined;
|
|
113
|
+
onMouseDownCapture?: (e: MouseEvent) => any | undefined;
|
|
114
|
+
onMouseEnter?: (e: MouseEvent) => any | undefined;
|
|
115
|
+
onMouseLeave?: (e: MouseEvent) => any | undefined;
|
|
116
|
+
onMouseMove?: (e: MouseEvent) => any | undefined;
|
|
117
|
+
onMouseMoveCapture?: (e: MouseEvent) => any | undefined;
|
|
118
|
+
onMouseOut?: (e: MouseEvent) => any | undefined;
|
|
119
|
+
onMouseOutCapture?: (e: MouseEvent) => any | undefined;
|
|
120
|
+
onMouseOver?: (e: MouseEvent) => any | undefined;
|
|
121
|
+
onMouseOverCapture?: (e: MouseEvent) => any | undefined;
|
|
122
|
+
onMouseUp?: (e: MouseEvent) => any | undefined;
|
|
123
|
+
onMouseUpCapture?: (e: MouseEvent) => any | undefined;
|
|
124
|
+
onSelect?: any | undefined;
|
|
125
|
+
onSelectCapture?: any | undefined;
|
|
126
|
+
onTouchCancel?: any | undefined;
|
|
127
|
+
onTouchCancelCapture?: any | undefined;
|
|
128
|
+
onTouchEnd?: any | undefined;
|
|
129
|
+
onTouchEndCapture?: any | undefined;
|
|
130
|
+
onTouchMove?: any | undefined;
|
|
131
|
+
onTouchMoveCapture?: any | undefined;
|
|
132
|
+
onTouchStart?: any | undefined;
|
|
133
|
+
onTouchStartCapture?: any | undefined;
|
|
134
|
+
onPointerDown?: any | undefined;
|
|
135
|
+
onPointerDownCapture?: any | undefined;
|
|
136
|
+
onPointerMove?: any | undefined;
|
|
137
|
+
onPointerMoveCapture?: any | undefined;
|
|
138
|
+
onPointerUp?: any | undefined;
|
|
139
|
+
onPointerUpCapture?: any | undefined;
|
|
140
|
+
onPointerCancel?: any | undefined;
|
|
141
|
+
onPointerCancelCapture?: any | undefined;
|
|
142
|
+
onPointerEnter?: any | undefined;
|
|
143
|
+
onPointerLeave?: any | undefined;
|
|
144
|
+
onPointerOver?: any | undefined;
|
|
145
|
+
onPointerOverCapture?: any | undefined;
|
|
146
|
+
onPointerOut?: any | undefined;
|
|
147
|
+
onPointerOutCapture?: any | undefined;
|
|
148
|
+
onGotPointerCapture?: any | undefined;
|
|
149
|
+
onGotPointerCaptureCapture?: any | undefined;
|
|
150
|
+
onLostPointerCapture?: any | undefined;
|
|
151
|
+
onLostPointerCaptureCapture?: any | undefined;
|
|
152
|
+
onScroll?: any | undefined;
|
|
153
|
+
onScrollCapture?: any | undefined;
|
|
154
|
+
onWheel?: any | undefined;
|
|
155
|
+
onWheelCapture?: any | undefined;
|
|
156
|
+
onAnimationStart?: any | undefined;
|
|
157
|
+
onAnimationStartCapture?: any | undefined;
|
|
158
|
+
onAnimationEnd?: any | undefined;
|
|
159
|
+
onAnimationEndCapture?: any | undefined;
|
|
160
|
+
onAnimationIteration?: any | undefined;
|
|
161
|
+
onAnimationIterationCapture?: any | undefined;
|
|
162
|
+
onTransitionEnd?: any | undefined;
|
|
163
|
+
onTransitionEndCapture?: any | undefined;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// an internal representation of DOM nodes in the tree
|
|
167
|
+
// despite being DOM nodes, we still can track mounting/unmounting
|
|
168
|
+
// (although it is not exposed at the moment)
|
|
169
|
+
type VelesElement = {
|
|
170
|
+
velesNode: true;
|
|
171
|
+
|
|
172
|
+
html: HTMLElement;
|
|
173
|
+
|
|
174
|
+
phantom?: boolean;
|
|
175
|
+
|
|
176
|
+
// every element except the most top one should have one
|
|
177
|
+
parentVelesElement?: VelesElement;
|
|
178
|
+
childComponents: (VelesElement | VelesComponent | VelesStringElement)[];
|
|
179
|
+
|
|
180
|
+
// not intended to be used directly
|
|
181
|
+
_privateMethods: {
|
|
182
|
+
_addUnmountHandler: Function;
|
|
183
|
+
_callUnmountHandlers: Function;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
type VelesStringElement = {
|
|
188
|
+
velesStringElement: true;
|
|
189
|
+
html: Text;
|
|
190
|
+
parentVelesElement?: VelesElement;
|
|
191
|
+
|
|
192
|
+
// not intended to be used directly
|
|
193
|
+
// despite being a text component, having same lifecycle
|
|
194
|
+
// methods is useful for state changes, to remove tracking
|
|
195
|
+
// when the said Text is returned from `useValue` state method
|
|
196
|
+
_privateMethods: {
|
|
197
|
+
_addUnmountHandler: Function;
|
|
198
|
+
_callUnmountHandlers: Function;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// an internal representation of components in the tree
|
|
203
|
+
type VelesComponent = {
|
|
204
|
+
velesComponent: true;
|
|
205
|
+
|
|
206
|
+
tree: VelesElement | VelesComponent | VelesStringElement;
|
|
207
|
+
|
|
208
|
+
// not intended to be used directly
|
|
209
|
+
_privateMethods: {
|
|
210
|
+
_callMountHandlers: Function;
|
|
211
|
+
_callUnmountHandlers: Function;
|
|
212
|
+
_addUnmountHandler: Function;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// all supported child options
|
|
217
|
+
type velesChild = string | VelesElement | VelesComponent | VelesStringElement;
|
|
218
|
+
type VelesChildren = velesChild | velesChild[] | undefined | null;
|
|
219
|
+
|
|
220
|
+
type VelesElementProps = {
|
|
221
|
+
children?: VelesChildren;
|
|
222
|
+
ref?: {
|
|
223
|
+
velesRef: true;
|
|
224
|
+
current: any;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
// event handlers + any html properties
|
|
228
|
+
// the value can be either a string value
|
|
229
|
+
// or a function in case we support reactivity
|
|
230
|
+
// TODO: we can improve these types
|
|
231
|
+
[htmlAttribute: string]: any;
|
|
232
|
+
} & VelesDOMElementProps;
|
|
233
|
+
|
|
234
|
+
type ComponentAPI = {
|
|
235
|
+
onMount: (cb: Function) => void;
|
|
236
|
+
onUnmount: (cb: Function) => void;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
type ComponentFunction = (
|
|
240
|
+
props: VelesElementProps,
|
|
241
|
+
componentAPI: ComponentAPI
|
|
242
|
+
) => VelesElement | VelesComponent | string | null;
|
|
243
|
+
|
|
244
|
+
declare function createElement(element: string | ComponentFunction, props?: VelesElementProps): VelesElement | VelesComponent;
|
|
245
|
+
|
|
246
|
+
declare function Fragment({ children }: {
|
|
247
|
+
children: VelesChildren;
|
|
248
|
+
}): VelesComponent | VelesElement;
|
|
249
|
+
|
|
250
|
+
export { Fragment as F, type VelesElement as V, type VelesComponent as a, type VelesStringElement as b, createElement as c };
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
type VelesDOMElementProps = {
|
|
2
|
+
onCopy?: any | undefined;
|
|
3
|
+
onCopyCapture?: any | undefined;
|
|
4
|
+
onCut?: any | undefined;
|
|
5
|
+
onCutCapture?: any | undefined;
|
|
6
|
+
onPaste?: any | undefined;
|
|
7
|
+
onPasteCapture?: any | undefined;
|
|
8
|
+
onCompositionEnd?: any | undefined;
|
|
9
|
+
onCompositionEndCapture?: any | undefined;
|
|
10
|
+
onCompositionStart?: any | undefined;
|
|
11
|
+
onCompositionStartCapture?: any | undefined;
|
|
12
|
+
onCompositionUpdate?: any | undefined;
|
|
13
|
+
onCompositionUpdateCapture?: any | undefined;
|
|
14
|
+
onFocus?: any | undefined;
|
|
15
|
+
onFocusCapture?: any | undefined;
|
|
16
|
+
onBlur?: any | undefined;
|
|
17
|
+
onBlurCapture?: any | undefined;
|
|
18
|
+
onChange?: any | undefined;
|
|
19
|
+
onChangeCapture?: any | undefined;
|
|
20
|
+
onBeforeInput?: any | undefined;
|
|
21
|
+
onBeforeInputCapture?: any | undefined;
|
|
22
|
+
onInput?: any | undefined;
|
|
23
|
+
onInputCapture?: any | undefined;
|
|
24
|
+
onReset?: any | undefined;
|
|
25
|
+
onResetCapture?: any | undefined;
|
|
26
|
+
onSubmit?: any | undefined;
|
|
27
|
+
onSubmitCapture?: any | undefined;
|
|
28
|
+
onInvalid?: any | undefined;
|
|
29
|
+
onInvalidCapture?: any | undefined;
|
|
30
|
+
onLoad?: any | undefined;
|
|
31
|
+
onLoadCapture?: any | undefined;
|
|
32
|
+
onError?: any | undefined;
|
|
33
|
+
onErrorCapture?: any | undefined;
|
|
34
|
+
onKeyDown?: any | undefined;
|
|
35
|
+
onKeyDownCapture?: any | undefined;
|
|
36
|
+
/** @deprecated */
|
|
37
|
+
onKeyPress?: any | undefined;
|
|
38
|
+
/** @deprecated */
|
|
39
|
+
onKeyPressCapture?: any | undefined;
|
|
40
|
+
onKeyUp?: any | undefined;
|
|
41
|
+
onKeyUpCapture?: any | undefined;
|
|
42
|
+
onAbort?: any | undefined;
|
|
43
|
+
onAbortCapture?: any | undefined;
|
|
44
|
+
onCanPlay?: any | undefined;
|
|
45
|
+
onCanPlayCapture?: any | undefined;
|
|
46
|
+
onCanPlayThrough?: any | undefined;
|
|
47
|
+
onCanPlayThroughCapture?: any | undefined;
|
|
48
|
+
onDurationChange?: any | undefined;
|
|
49
|
+
onDurationChangeCapture?: any | undefined;
|
|
50
|
+
onEmptied?: any | undefined;
|
|
51
|
+
onEmptiedCapture?: any | undefined;
|
|
52
|
+
onEncrypted?: any | undefined;
|
|
53
|
+
onEncryptedCapture?: any | undefined;
|
|
54
|
+
onEnded?: any | undefined;
|
|
55
|
+
onEndedCapture?: any | undefined;
|
|
56
|
+
onLoadedData?: any | undefined;
|
|
57
|
+
onLoadedDataCapture?: any | undefined;
|
|
58
|
+
onLoadedMetadata?: any | undefined;
|
|
59
|
+
onLoadedMetadataCapture?: any | undefined;
|
|
60
|
+
onLoadStart?: any | undefined;
|
|
61
|
+
onLoadStartCapture?: any | undefined;
|
|
62
|
+
onPause?: any | undefined;
|
|
63
|
+
onPauseCapture?: any | undefined;
|
|
64
|
+
onPlay?: any | undefined;
|
|
65
|
+
onPlayCapture?: any | undefined;
|
|
66
|
+
onPlaying?: any | undefined;
|
|
67
|
+
onPlayingCapture?: any | undefined;
|
|
68
|
+
onProgress?: any | undefined;
|
|
69
|
+
onProgressCapture?: any | undefined;
|
|
70
|
+
onRateChange?: any | undefined;
|
|
71
|
+
onRateChangeCapture?: any | undefined;
|
|
72
|
+
onResize?: any | undefined;
|
|
73
|
+
onResizeCapture?: any | undefined;
|
|
74
|
+
onSeeked?: any | undefined;
|
|
75
|
+
onSeekedCapture?: any | undefined;
|
|
76
|
+
onSeeking?: any | undefined;
|
|
77
|
+
onSeekingCapture?: any | undefined;
|
|
78
|
+
onStalled?: any | undefined;
|
|
79
|
+
onStalledCapture?: any | undefined;
|
|
80
|
+
onSuspend?: any | undefined;
|
|
81
|
+
onSuspendCapture?: any | undefined;
|
|
82
|
+
onTimeUpdate?: any | undefined;
|
|
83
|
+
onTimeUpdateCapture?: any | undefined;
|
|
84
|
+
onVolumeChange?: any | undefined;
|
|
85
|
+
onVolumeChangeCapture?: any | undefined;
|
|
86
|
+
onWaiting?: any | undefined;
|
|
87
|
+
onWaitingCapture?: any | undefined;
|
|
88
|
+
onAuxClick?: (e: MouseEvent) => any | undefined;
|
|
89
|
+
onAuxClickCapture?: (e: MouseEvent) => any | undefined;
|
|
90
|
+
onClick?: (e: MouseEvent) => any | undefined;
|
|
91
|
+
onClickCapture?: (e: MouseEvent) => any | undefined;
|
|
92
|
+
onContextMenu?: (e: MouseEvent) => any | undefined;
|
|
93
|
+
onContextMenuCapture?: (e: MouseEvent) => any | undefined;
|
|
94
|
+
onDoubleClick?: (e: MouseEvent) => any | undefined;
|
|
95
|
+
onDoubleClickCapture?: (e: MouseEvent) => any | undefined;
|
|
96
|
+
onDrag?: any | undefined;
|
|
97
|
+
onDragCapture?: any | undefined;
|
|
98
|
+
onDragEnd?: any | undefined;
|
|
99
|
+
onDragEndCapture?: any | undefined;
|
|
100
|
+
onDragEnter?: any | undefined;
|
|
101
|
+
onDragEnterCapture?: any | undefined;
|
|
102
|
+
onDragExit?: any | undefined;
|
|
103
|
+
onDragExitCapture?: any | undefined;
|
|
104
|
+
onDragLeave?: any | undefined;
|
|
105
|
+
onDragLeaveCapture?: any | undefined;
|
|
106
|
+
onDragOver?: any | undefined;
|
|
107
|
+
onDragOverCapture?: any | undefined;
|
|
108
|
+
onDragStart?: any | undefined;
|
|
109
|
+
onDragStartCapture?: any | undefined;
|
|
110
|
+
onDrop?: any | undefined;
|
|
111
|
+
onDropCapture?: any | undefined;
|
|
112
|
+
onMouseDown?: (e: MouseEvent) => any | undefined;
|
|
113
|
+
onMouseDownCapture?: (e: MouseEvent) => any | undefined;
|
|
114
|
+
onMouseEnter?: (e: MouseEvent) => any | undefined;
|
|
115
|
+
onMouseLeave?: (e: MouseEvent) => any | undefined;
|
|
116
|
+
onMouseMove?: (e: MouseEvent) => any | undefined;
|
|
117
|
+
onMouseMoveCapture?: (e: MouseEvent) => any | undefined;
|
|
118
|
+
onMouseOut?: (e: MouseEvent) => any | undefined;
|
|
119
|
+
onMouseOutCapture?: (e: MouseEvent) => any | undefined;
|
|
120
|
+
onMouseOver?: (e: MouseEvent) => any | undefined;
|
|
121
|
+
onMouseOverCapture?: (e: MouseEvent) => any | undefined;
|
|
122
|
+
onMouseUp?: (e: MouseEvent) => any | undefined;
|
|
123
|
+
onMouseUpCapture?: (e: MouseEvent) => any | undefined;
|
|
124
|
+
onSelect?: any | undefined;
|
|
125
|
+
onSelectCapture?: any | undefined;
|
|
126
|
+
onTouchCancel?: any | undefined;
|
|
127
|
+
onTouchCancelCapture?: any | undefined;
|
|
128
|
+
onTouchEnd?: any | undefined;
|
|
129
|
+
onTouchEndCapture?: any | undefined;
|
|
130
|
+
onTouchMove?: any | undefined;
|
|
131
|
+
onTouchMoveCapture?: any | undefined;
|
|
132
|
+
onTouchStart?: any | undefined;
|
|
133
|
+
onTouchStartCapture?: any | undefined;
|
|
134
|
+
onPointerDown?: any | undefined;
|
|
135
|
+
onPointerDownCapture?: any | undefined;
|
|
136
|
+
onPointerMove?: any | undefined;
|
|
137
|
+
onPointerMoveCapture?: any | undefined;
|
|
138
|
+
onPointerUp?: any | undefined;
|
|
139
|
+
onPointerUpCapture?: any | undefined;
|
|
140
|
+
onPointerCancel?: any | undefined;
|
|
141
|
+
onPointerCancelCapture?: any | undefined;
|
|
142
|
+
onPointerEnter?: any | undefined;
|
|
143
|
+
onPointerLeave?: any | undefined;
|
|
144
|
+
onPointerOver?: any | undefined;
|
|
145
|
+
onPointerOverCapture?: any | undefined;
|
|
146
|
+
onPointerOut?: any | undefined;
|
|
147
|
+
onPointerOutCapture?: any | undefined;
|
|
148
|
+
onGotPointerCapture?: any | undefined;
|
|
149
|
+
onGotPointerCaptureCapture?: any | undefined;
|
|
150
|
+
onLostPointerCapture?: any | undefined;
|
|
151
|
+
onLostPointerCaptureCapture?: any | undefined;
|
|
152
|
+
onScroll?: any | undefined;
|
|
153
|
+
onScrollCapture?: any | undefined;
|
|
154
|
+
onWheel?: any | undefined;
|
|
155
|
+
onWheelCapture?: any | undefined;
|
|
156
|
+
onAnimationStart?: any | undefined;
|
|
157
|
+
onAnimationStartCapture?: any | undefined;
|
|
158
|
+
onAnimationEnd?: any | undefined;
|
|
159
|
+
onAnimationEndCapture?: any | undefined;
|
|
160
|
+
onAnimationIteration?: any | undefined;
|
|
161
|
+
onAnimationIterationCapture?: any | undefined;
|
|
162
|
+
onTransitionEnd?: any | undefined;
|
|
163
|
+
onTransitionEndCapture?: any | undefined;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// an internal representation of DOM nodes in the tree
|
|
167
|
+
// despite being DOM nodes, we still can track mounting/unmounting
|
|
168
|
+
// (although it is not exposed at the moment)
|
|
169
|
+
type VelesElement = {
|
|
170
|
+
velesNode: true;
|
|
171
|
+
|
|
172
|
+
html: HTMLElement;
|
|
173
|
+
|
|
174
|
+
phantom?: boolean;
|
|
175
|
+
|
|
176
|
+
// every element except the most top one should have one
|
|
177
|
+
parentVelesElement?: VelesElement;
|
|
178
|
+
childComponents: (VelesElement | VelesComponent | VelesStringElement)[];
|
|
179
|
+
|
|
180
|
+
// not intended to be used directly
|
|
181
|
+
_privateMethods: {
|
|
182
|
+
_addUnmountHandler: Function;
|
|
183
|
+
_callUnmountHandlers: Function;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
type VelesStringElement = {
|
|
188
|
+
velesStringElement: true;
|
|
189
|
+
html: Text;
|
|
190
|
+
parentVelesElement?: VelesElement;
|
|
191
|
+
|
|
192
|
+
// not intended to be used directly
|
|
193
|
+
// despite being a text component, having same lifecycle
|
|
194
|
+
// methods is useful for state changes, to remove tracking
|
|
195
|
+
// when the said Text is returned from `useValue` state method
|
|
196
|
+
_privateMethods: {
|
|
197
|
+
_addUnmountHandler: Function;
|
|
198
|
+
_callUnmountHandlers: Function;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// an internal representation of components in the tree
|
|
203
|
+
type VelesComponent = {
|
|
204
|
+
velesComponent: true;
|
|
205
|
+
|
|
206
|
+
tree: VelesElement | VelesComponent | VelesStringElement;
|
|
207
|
+
|
|
208
|
+
// not intended to be used directly
|
|
209
|
+
_privateMethods: {
|
|
210
|
+
_callMountHandlers: Function;
|
|
211
|
+
_callUnmountHandlers: Function;
|
|
212
|
+
_addUnmountHandler: Function;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
// all supported child options
|
|
217
|
+
type velesChild = string | VelesElement | VelesComponent | VelesStringElement;
|
|
218
|
+
type VelesChildren = velesChild | velesChild[] | undefined | null;
|
|
219
|
+
|
|
220
|
+
type VelesElementProps = {
|
|
221
|
+
children?: VelesChildren;
|
|
222
|
+
ref?: {
|
|
223
|
+
velesRef: true;
|
|
224
|
+
current: any;
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
// event handlers + any html properties
|
|
228
|
+
// the value can be either a string value
|
|
229
|
+
// or a function in case we support reactivity
|
|
230
|
+
// TODO: we can improve these types
|
|
231
|
+
[htmlAttribute: string]: any;
|
|
232
|
+
} & VelesDOMElementProps;
|
|
233
|
+
|
|
234
|
+
type ComponentAPI = {
|
|
235
|
+
onMount: (cb: Function) => void;
|
|
236
|
+
onUnmount: (cb: Function) => void;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
type ComponentFunction = (
|
|
240
|
+
props: VelesElementProps,
|
|
241
|
+
componentAPI: ComponentAPI
|
|
242
|
+
) => VelesElement | VelesComponent | string | null;
|
|
243
|
+
|
|
244
|
+
declare function createElement(element: string | ComponentFunction, props?: VelesElementProps): VelesElement | VelesComponent;
|
|
245
|
+
|
|
246
|
+
declare function Fragment({ children }: {
|
|
247
|
+
children: VelesChildren;
|
|
248
|
+
}): VelesComponent | VelesElement;
|
|
249
|
+
|
|
250
|
+
export { Fragment as F, type VelesElement as V, type VelesComponent as a, type VelesStringElement as b, createElement as c };
|