incajs 0.0.22 → 0.0.24

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 (38) hide show
  1. package/dist/chunks/hooks-DK2feJxZ.js +1 -0
  2. package/dist/chunks/rendererCore-Ezb4FOC9.js +1 -0
  3. package/dist/chunks/rendererCore-qq38UzW-.d.ts +388 -0
  4. package/dist/chunks/rolldown-runtime-DK3Fl9T5.js +1 -0
  5. package/dist/chunks/window-BtaK1Znc.d.ts +703 -0
  6. package/dist/index.d.ts +12 -0
  7. package/dist/index.js +1 -1
  8. package/dist/rendererCore.d.ts +3 -0
  9. package/dist/rendererCore.js +1 -3
  10. package/dist/vue-runtime.d.ts +3 -0
  11. package/dist/vue-runtime.js +1 -2
  12. package/dist/{vue/createApp.d.mts → vue.d.ts} +6 -4
  13. package/dist/vue.js +2 -178
  14. package/package.json +16 -17
  15. package/dist/callbacks.d.mts +0 -31
  16. package/dist/chunks/hooks-TbLjfN0c.js +0 -417
  17. package/dist/chunks/rendererCore-BUNTDvYu.js +0 -110
  18. package/dist/document.d.mts +0 -11
  19. package/dist/element/eventHandlers.d.mts +0 -12
  20. package/dist/element/geometry.d.mts +0 -61
  21. package/dist/element/handle.d.mts +0 -29
  22. package/dist/element/lifecycle.d.mts +0 -51
  23. package/dist/element/scroll.d.mts +0 -42
  24. package/dist/element/shadowTree.d.mts +0 -64
  25. package/dist/element/types.d.mts +0 -149
  26. package/dist/eventTarget.d.mts +0 -11
  27. package/dist/events.d.mts +0 -105
  28. package/dist/index.d.mts +0 -6
  29. package/dist/native.d.mts +0 -46
  30. package/dist/rendererCore.d.mts +0 -14
  31. package/dist/targets.d.mts +0 -1
  32. package/dist/tree.d.mts +0 -157
  33. package/dist/types.d.mts +0 -454
  34. package/dist/vue/index.d.mts +0 -2
  35. package/dist/vue/nodeOps.d.mts +0 -29
  36. package/dist/vue/patchProp.d.mts +0 -79
  37. package/dist/vue/runtime.d.mts +0 -2
  38. package/dist/window.d.mts +0 -13
package/dist/types.d.mts DELETED
@@ -1,454 +0,0 @@
1
- import { EventHandlers, IncaElement } from './element/types.mts';
2
- /**
3
- * Stable handle to a node in the native retained tree, returned by `createNode`
4
- * and used in every later call that touches that node.
5
- */
6
- export type NodeId = number;
7
- /**
8
- * Id assigned to one registered event listener. Managed internally by
9
- * `addEventListener`/`removeEventListener`/`destroyNode`.
10
- */
11
- export type CallbackId = number;
12
- /**
13
- * A value `setAttribute`/`setStyle` can take. Any other value raises a catchable
14
- * exception.
15
- */
16
- export type AttributeValue = string | number | boolean;
17
- /**
18
- * Element kind passed to `createNode`. `"text"` is the only tag with
19
- * dedicated rendering behavior: it renders its `"value"` attribute followed
20
- * by its descendants' text. Any other string is a generic styled
21
- * container; the `string & {}` half of this type keeps `"text"`'s
22
- * autocomplete while still accepting an arbitrary tag name.
23
- */
24
- export type TagName = "text" | (string & {});
25
- /** Where `scrollIntoView` aligns a node on one axis. */
26
- export type ScrollAlignment = "start" | "center" | "end" | "nearest";
27
- /** One overflow value; `"auto"` is an alias of `"scroll"`. */
28
- export type Overflow = "visible" | "hidden" | "clip" | "scroll" | "auto";
29
- /**
30
- * Style properties, in their snake_case spelling, that `setStyle`'s typed
31
- * overload checks. A deliberately incomplete, v1 layout/paint vocabulary. The
32
- * renderer also reads the camelCase and kebab-case spellings. An unrecognized
33
- * key or a value shape that doesn't parse (e.g. a malformed enum string) is
34
- * ignored by the renderer, and the host prints a warning line on stderr for
35
- * it (an empty string `''` prints none).
36
- */
37
- export interface StyleProps {
38
- /** Layout mode for this node's children. `"none"` skips both layout and rendering for the whole subtree. */
39
- display?: "flex" | "block" | "grid" | "none";
40
- /** Main-axis direction for a `"flex"` container. */
41
- flex_direction?: "row" | "column" | "row_reverse" | "column_reverse";
42
- /** Main-axis alignment of children within this container. */
43
- justify_content?: "start" | "end" | "center" | "stretch";
44
- /** Cross-axis alignment of children within this container. */
45
- align_items?: "start" | "end" | "center" | "stretch";
46
- /** Uniform spacing, in px (`>= 0`), between children, applied on both axes. */
47
- gap?: number;
48
- /** Fixed width in px (`>= 0`), or `"auto"` to size to content. */
49
- width?: number | "auto";
50
- /** Fixed height in px (`>= 0`), or `"auto"` to size to content. */
51
- height?: number | "auto";
52
- /** Uniform border width in px (`>= 0`), applied to all four sides. */
53
- border_width?: number;
54
- /** Fill color, as a hex number (`0xRRGGBB`) or a CSS-style string (`"#rrggbb"`/`"#rgb"`). */
55
- background?: number | string;
56
- /** Border color. Accepts the same formats as {@link StyleProps.background}. */
57
- border_color?: number | string;
58
- /** Color for this container's own text. Cascades to descendant text leaves, same as {@link StyleProps.text_size}; there's no separate per-leaf text styling. */
59
- text_color?: number | string;
60
- /** Uniform corner radius in px (`>= 0`), applied to all four corners. */
61
- corner_radius?: number;
62
- /** Font size in px (`>= 0`) for this container's own text. Cascades to descendant text leaves, same as {@link StyleProps.text_color}. */
63
- text_size?: number;
64
- /** Overflow on both axes, or `"<x> <y>"` per axis; `"scroll"` (alias `"auto"`) makes the container scroll with the wheel. Overridden per axis by {@link StyleProps.overflow_x}/{@link StyleProps.overflow_y}. */
65
- overflow?: Overflow | `${Overflow} ${Overflow}`;
66
- /** Horizontal overflow; wins over {@link StyleProps.overflow}. */
67
- overflow_x?: Overflow;
68
- /** Vertical overflow; wins over {@link StyleProps.overflow}. */
69
- overflow_y?: Overflow;
70
- /** Inner spacing in px (`>= 0`) on all four sides. Overridden per axis by {@link StyleProps.padding_x}/{@link StyleProps.padding_y} and per side by the `padding_*` side keys. */
71
- padding?: number;
72
- /** Horizontal inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
73
- padding_x?: number;
74
- /** Vertical inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
75
- padding_y?: number;
76
- /** Top inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_y}. */
77
- padding_top?: number;
78
- /** Right inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_x}. */
79
- padding_right?: number;
80
- /** Bottom inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_y}. */
81
- padding_bottom?: number;
82
- /** Left inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_x}. */
83
- padding_left?: number;
84
- /** Outer spacing in px (negative allowed) or `"auto"` on all four sides. Overridden per axis by {@link StyleProps.margin_x}/{@link StyleProps.margin_y} and per side by the `margin_*` side keys. */
85
- margin?: number | "auto";
86
- /** Horizontal outer spacing; wins over {@link StyleProps.margin}. */
87
- margin_x?: number | "auto";
88
- /** Vertical outer spacing; wins over {@link StyleProps.margin}. */
89
- margin_y?: number | "auto";
90
- /** Top outer spacing; wins over {@link StyleProps.margin_y}. */
91
- margin_top?: number | "auto";
92
- /** Right outer spacing; wins over {@link StyleProps.margin_x}. */
93
- margin_right?: number | "auto";
94
- /** Bottom outer spacing; wins over {@link StyleProps.margin_y}. */
95
- margin_bottom?: number | "auto";
96
- /** Left outer spacing; wins over {@link StyleProps.margin_x}. */
97
- margin_left?: number | "auto";
98
- /** Share (`>= 0`) of the free space in the parent's main axis this node takes. */
99
- flex_grow?: number;
100
- /** Share (`>= 0`) of the overflow in the parent's main axis this node gives up. */
101
- flex_shrink?: number;
102
- /** Opacity from `0` to `1`, applied to this node and its descendants; values outside are clamped. */
103
- opacity?: number;
104
- /** Minimum width in px (`>= 0`), or `"auto"` for the default minimum. */
105
- min_width?: number | "auto";
106
- /** Minimum height in px (`>= 0`), or `"auto"` for the default minimum. */
107
- min_height?: number | "auto";
108
- /** Maximum width in px (`>= 0`), or `"auto"` for no limit. */
109
- max_width?: number | "auto";
110
- /** Maximum height in px (`>= 0`), or `"auto"` for no limit. */
111
- max_height?: number | "auto";
112
- }
113
- /**
114
- * An event built in this runtime with `Event`, `CustomEvent` or another
115
- * event constructor. The host throws a `TypeError` for any other value.
116
- */
117
- export interface EventLike {
118
- readonly type: string;
119
- }
120
- /**
121
- * How a listener registered via `addEventListener` takes part in an event.
122
- */
123
- export interface ListenerOptions {
124
- /**
125
- * Listen while the event travels from `window` down to the target. The default listens while it
126
- * travels back up.
127
- */
128
- capture?: boolean;
129
- /** `preventDefault()` calls inside the listener are ignored. */
130
- passive?: boolean;
131
- /** The listener is removed before it first runs. */
132
- once?: boolean;
133
- }
134
- /**
135
- * The listener methods of an object that receives events, such as the
136
- * `window` and `document` exports and a template `ref`. A registration is identified by the
137
- * event name, the listener and `capture`. `removeEventListener` takes the
138
- * same listener that `addEventListener` received.
139
- */
140
- export interface IncaEventTarget {
141
- /**
142
- * Registers `listener` for `type`. Registering the same listener for the
143
- * same `type` and `capture` again changes nothing. A `null` listener is
144
- * ignored.
145
- * @param type - the event name (e.g. `"keydown"`)
146
- * @param listener - a function, called with the event's `currentTarget` as
147
- * `this`, or an object whose `handleEvent` method is called with the object
148
- * as `this` when the event fires
149
- * @param options - a {@link ListenerOptions}, or a boolean for `capture`
150
- */
151
- addEventListener<K extends keyof IncaEventMap>(type: K, listener: EventListenerOrObject<IncaEventMap[K], this> | null, options?: boolean | ListenerOptions): void;
152
- addEventListener<E = IncaEvent>(type: string, listener: EventListenerOrObject<E, this> | null, options?: boolean | ListenerOptions): void;
153
- /**
154
- * Drops the registration of `listener` for `type` with the same `capture`.
155
- * A call that matches no registration changes nothing.
156
- * @param type - the event name
157
- * @param listener - the listener that was registered
158
- * @param options - an object with `capture`, or a boolean for `capture`
159
- */
160
- removeEventListener<K extends keyof IncaEventMap>(type: K, listener: EventListenerOrObject<IncaEventMap[K], this> | null, options?: boolean | Pick<ListenerOptions, "capture">): void;
161
- removeEventListener<E = IncaEvent>(type: string, listener: EventListenerOrObject<E, this> | null, options?: boolean | Pick<ListenerOptions, "capture">): void;
162
- /**
163
- * Dispatches an event built with an event constructor at the target.
164
- * @param event - the event to dispatch
165
- * @returns `false` when a listener canceled a cancelable event, else `true`
166
- * @throws TypeError when `event` is not an event built with an event constructor
167
- * @throws DOMException named `InvalidStateError` when `event` is being dispatched
168
- */
169
- dispatchEvent(event: EventLike): boolean;
170
- }
171
- /**
172
- * The event target between the elements and `window`.
173
- */
174
- export interface IncaDocument extends IncaEventTarget, EventHandlers<IncaDocument> {
175
- /** The element that has focus, or `null` when no element has focus. */
176
- readonly activeElement: IncaElement | null;
177
- }
178
- /**
179
- * The event target at the top of every event path.
180
- */
181
- export interface IncaWindow extends IncaEventTarget, EventHandlers<IncaWindow> {
182
- }
183
- /**
184
- * The fields every event carries. {@link IncaEventMap} gives the event type of
185
- * each name the host dispatches, and a listener for any other name receives
186
- * this type.
187
- *
188
- * See https://incajs.tom96da.com/reference/events for the event names the
189
- * host dispatches and their fields.
190
- */
191
- export interface IncaEvent {
192
- /** The event's name. */
193
- readonly type: string;
194
- /** `0`, the {@link IncaEvent.eventPhase} outside a dispatch. */
195
- readonly NONE: 0;
196
- /** `1`, the {@link IncaEvent.eventPhase} on an ancestor while the event travels down. */
197
- readonly CAPTURING_PHASE: 1;
198
- /** `2`, the {@link IncaEvent.eventPhase} on the target. */
199
- readonly AT_TARGET: 2;
200
- /** `3`, the {@link IncaEvent.eventPhase} on an ancestor while the event travels up. */
201
- readonly BUBBLING_PHASE: 3;
202
- /**
203
- * The element the event is about. It is the deepest element under the pointer for pointer
204
- * events (the capturing element while the pointer is captured), the nearest common ancestor of
205
- * the press and the release for `click`, `dblclick` and `auxclick`, and the focused element for
206
- * key events. With no such element it is the mount container's element. A script dispatch at
207
- * `document` or `window` gives that object.
208
- */
209
- readonly target: IncaEventTarget;
210
- /** The same object as {@link IncaEvent.target}. */
211
- readonly srcElement: IncaEventTarget;
212
- /**
213
- * The element, `document` or `window` whose listener is running, and `null` once the
214
- * event has been handled. A listener function runs with it as `this`.
215
- */
216
- readonly currentTarget: IncaEventTarget | null;
217
- /**
218
- * Whether the event travels up from `target`. Fixed per event name for the
219
- * events the host dispatches.
220
- */
221
- readonly bubbles: boolean;
222
- /**
223
- * Whether `preventDefault()` can cancel the event. Fixed per event name for
224
- * the events the host dispatches.
225
- */
226
- readonly cancelable: boolean;
227
- /** Fixed per event name for the events the host dispatches. */
228
- readonly composed: boolean;
229
- /**
230
- * 1 on the ancestors of `target` while the event travels down, 2 where
231
- * `currentTarget` is `target`, 3 on the ancestors while it travels up, and 0
232
- * once the event has been handled.
233
- */
234
- readonly eventPhase: 0 | 1 | 2 | 3;
235
- /** `true` once a listener called `preventDefault()` on a cancelable event. */
236
- readonly defaultPrevented: boolean;
237
- /** `true` for events the host dispatches and `false` for events a script dispatches. */
238
- readonly isTrusted: boolean;
239
- /** Milliseconds since the host started. */
240
- readonly timeStamp: number;
241
- /** A number that grows with each event and is the same on every node that event reaches. */
242
- readonly eventId: number;
243
- /** Assigning `true` while the event is dispatched stops it like `stopPropagation()`. */
244
- cancelBubble: boolean;
245
- /** The opposite of `defaultPrevented`. Assigning `false` cancels a cancelable event like `preventDefault()`. */
246
- returnValue: boolean;
247
- /** Stops the event from reaching the listeners of later nodes on its path. */
248
- stopPropagation(): void;
249
- /** Stops the event from reaching any later listener. */
250
- stopImmediatePropagation(): void;
251
- /** Cancels the event when it is cancelable and the listener is not passive. */
252
- preventDefault(): void;
253
- /**
254
- * `target` and its ancestors, then `document` and `window`, and an empty
255
- * array once the event has been handled.
256
- */
257
- composedPath(): IncaEventTarget[];
258
- /**
259
- * Sets the type, `bubbles` and `cancelable` of an event that is not being
260
- * dispatched, clears its stop and cancel flags and makes it untrusted. While
261
- * the event is dispatched it does nothing.
262
- */
263
- initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
264
- }
265
- /**
266
- * The event object of a mouse, wheel, keyboard or focus event.
267
- */
268
- export interface IncaUIEvent extends IncaEvent {
269
- /**
270
- * On the events the host dispatches, the click count of `mousedown`,
271
- * `mouseup`, `click`, `dblclick` and `auxclick`, and `0` on the others.
272
- */
273
- readonly detail: number;
274
- /** Always `null`. */
275
- readonly view: null;
276
- /**
277
- * On the events the host dispatches: for `mousedown`, `mouseup`, `click`,
278
- * `dblclick`, `auxclick` and `contextmenu`, `button + 1`. For `wheel`, `0`.
279
- * For the other mouse events, the lowest held button plus 1, or `0` with no
280
- * button held. For the pointer events, `button + 1`, so `0` when `button` is `-1`. For a
281
- * keyboard event, `keyCode`. For a focus event, `0`.
282
- */
283
- readonly which: number;
284
- }
285
- /** The event object of `focus`, `blur`, `focusin` and `focusout`. */
286
- export interface IncaFocusEvent extends IncaUIEvent {
287
- /**
288
- * The element gaining focus for `blur` and `focusout`, the element losing
289
- * it for `focus` and `focusin`, or `null`.
290
- */
291
- readonly relatedTarget: IncaEventTarget | null;
292
- }
293
- /** The event object of the mouse events. */
294
- export interface IncaMouseEvent extends IncaUIEvent {
295
- readonly screenX: number;
296
- readonly screenY: number;
297
- /** The pointer's position in the window. */
298
- readonly clientX: number;
299
- /** The pointer's position in the window. */
300
- readonly clientY: number;
301
- /** The same as {@link IncaMouseEvent.clientX}. */
302
- readonly pageX: number;
303
- /** The same as {@link IncaMouseEvent.clientY}. */
304
- readonly pageY: number;
305
- /** The same as {@link IncaMouseEvent.clientX}. */
306
- readonly x: number;
307
- /** The same as {@link IncaMouseEvent.clientY}. */
308
- readonly y: number;
309
- /** On the events the host dispatches, the pointer's position from the padding edge of `target`. */
310
- readonly offsetX: number;
311
- /** On the events the host dispatches, the pointer's position from the padding edge of `target`. */
312
- readonly offsetY: number;
313
- /** On the events the host dispatches, the pointer's travel since the previous `mousemove`, and `0` on other events. */
314
- readonly movementX: number;
315
- /** On the events the host dispatches, the pointer's travel since the previous `mousemove`, and `0` on other events. */
316
- readonly movementY: number;
317
- /**
318
- * The button the event is about: `0` left, `1` middle, `2` right, `3` back, `4` forward. `-1` on
319
- * a pointer event that is about no button.
320
- */
321
- readonly button: number;
322
- /** Every button held, as a bitmask: `1` left, `2` right, `4` middle, `8` back, `16` forward. */
323
- readonly buttons: number;
324
- readonly ctrlKey: boolean;
325
- readonly shiftKey: boolean;
326
- readonly altKey: boolean;
327
- readonly metaKey: boolean;
328
- /**
329
- * The element the pointer came from for `mouseover` and `mouseenter`, the
330
- * element it went to for `mouseout` and `mouseleave`, or `null`.
331
- */
332
- readonly relatedTarget: IncaEventTarget | null;
333
- /**
334
- * Whether the modifier `key` is held: `"Control"`, `"Shift"`, `"Alt"`,
335
- * `"Meta"`, or `"Accel"` (Meta on macOS, Control elsewhere). Any other name
336
- * gives `false`.
337
- */
338
- getModifierState(key: string): boolean;
339
- }
340
- /**
341
- * The event object of the `pointer*` events, `gotpointercapture`, `lostpointercapture`, `click`,
342
- * `auxclick` and `contextmenu`.
343
- */
344
- export interface IncaPointerEvent extends IncaMouseEvent {
345
- /**
346
- * On the events the host dispatches, `1` for the mouse and for the `contextmenu` of a key, and
347
- * `-1` for the click of a key.
348
- */
349
- readonly pointerId: number;
350
- readonly width: number;
351
- readonly height: number;
352
- /** On the pointer events the host dispatches, `0.5` while a button is held, else `0`. */
353
- readonly pressure: number;
354
- /** On the events the host dispatches, `"mouse"`, or `""` for the click of a key. */
355
- readonly pointerType: string;
356
- /**
357
- * On the events the host dispatches, `true` on the pointer events and `false` on `click`,
358
- * `auxclick` and `contextmenu`.
359
- */
360
- readonly isPrimary: boolean;
361
- }
362
- /** The event object of `wheel`. */
363
- export interface IncaWheelEvent extends IncaMouseEvent {
364
- readonly deltaX: number;
365
- readonly deltaY: number;
366
- /** `0` on the events the host dispatches. */
367
- readonly deltaZ: number;
368
- /** `0` for pixels, `1` for lines. */
369
- readonly deltaMode: number;
370
- readonly DOM_DELTA_PIXEL: 0;
371
- readonly DOM_DELTA_LINE: 1;
372
- readonly DOM_DELTA_PAGE: 2;
373
- }
374
- /** The event object of `keydown` and `keyup`. */
375
- export interface IncaKeyboardEvent extends IncaUIEvent {
376
- /** The key's name, such as `"Enter"`, `"F5"` or the typed character. */
377
- readonly key: string;
378
- /** `""` on the events the host dispatches. */
379
- readonly code: string;
380
- /** `0` on the events the host dispatches. */
381
- readonly location: number;
382
- /** Whether the key press is an auto-repeat. */
383
- readonly repeat: boolean;
384
- /** `false` on the events the host dispatches. */
385
- readonly isComposing: boolean;
386
- /** The key's code on a US keyboard layout, and `0` for a key outside it. */
387
- readonly keyCode: number;
388
- /** `0` on the events the host dispatches. */
389
- readonly charCode: number;
390
- readonly ctrlKey: boolean;
391
- readonly shiftKey: boolean;
392
- readonly altKey: boolean;
393
- readonly metaKey: boolean;
394
- readonly DOM_KEY_LOCATION_STANDARD: 0;
395
- readonly DOM_KEY_LOCATION_LEFT: 1;
396
- readonly DOM_KEY_LOCATION_RIGHT: 2;
397
- readonly DOM_KEY_LOCATION_NUMPAD: 3;
398
- /**
399
- * Whether the modifier `key` is held: `"Control"`, `"Shift"`, `"Alt"`,
400
- * `"Meta"`, or `"Accel"` (Meta on macOS, Control elsewhere). Any other name
401
- * gives `false`.
402
- */
403
- getModifierState(key: string): boolean;
404
- }
405
- /** The event object of each event name the host dispatches. */
406
- export interface IncaEventMap {
407
- auxclick: IncaPointerEvent;
408
- blur: IncaFocusEvent;
409
- click: IncaPointerEvent;
410
- contextmenu: IncaPointerEvent;
411
- dblclick: IncaMouseEvent;
412
- focus: IncaFocusEvent;
413
- focusin: IncaFocusEvent;
414
- focusout: IncaFocusEvent;
415
- gotpointercapture: IncaPointerEvent;
416
- keydown: IncaKeyboardEvent;
417
- keyup: IncaKeyboardEvent;
418
- lostpointercapture: IncaPointerEvent;
419
- mousedown: IncaMouseEvent;
420
- mouseenter: IncaMouseEvent;
421
- mouseleave: IncaMouseEvent;
422
- mousemove: IncaMouseEvent;
423
- mouseout: IncaMouseEvent;
424
- mouseover: IncaMouseEvent;
425
- mouseup: IncaMouseEvent;
426
- pointerdown: IncaPointerEvent;
427
- pointerenter: IncaPointerEvent;
428
- pointerleave: IncaPointerEvent;
429
- pointermove: IncaPointerEvent;
430
- pointerout: IncaPointerEvent;
431
- pointerover: IncaPointerEvent;
432
- pointerup: IncaPointerEvent;
433
- scroll: IncaEvent;
434
- wheel: IncaWheelEvent;
435
- }
436
- /**
437
- * Signature of a callback registered via `addEventListener`. It receives the
438
- * event, an {@link IncaEvent} unless the parameter declares another type, and
439
- * runs with the event's `currentTarget`, the target it was registered on, as
440
- * `this`.
441
- */
442
- export type EventListener<E = IncaEvent, T = IncaEventTarget> = (this: T, event: E) => void;
443
- /**
444
- * An object whose `handleEvent` method receives the events, called with the
445
- * object as `this`. It takes the event an {@link EventListener} takes.
446
- */
447
- export interface EventListenerObject<E = IncaEvent> {
448
- handleEvent(event: E): void;
449
- }
450
- /**
451
- * What `addEventListener` accepts as a listener: an {@link EventListener} or
452
- * an {@link EventListenerObject}.
453
- */
454
- export type EventListenerOrObject<E = IncaEvent, T = IncaEventTarget> = EventListener<E, T> | EventListenerObject<E>;
@@ -1,2 +0,0 @@
1
- export { createIncaApp } from './createApp.mts';
2
- export type { IncaApp } from './createApp.mts';
@@ -1,29 +0,0 @@
1
- import { RendererOptions } from '@vue/runtime-core';
2
- import { IncaCore, IncaElement, IncaNode } from '../rendererCore.mts';
3
- /**
4
- * Marks `handle` so that Vue's `reactive()` and `ref()` keep the object itself.
5
- * A template ref then holds the same object the application receives from
6
- * `document.activeElement`.
7
- * @param handle - the node handle to mark
8
- * @returns `handle`
9
- */
10
- export declare function skipReactive<T extends object>(handle: T): T;
11
- /** {@link createNodeOps}'s return shape. */
12
- export type NodeOps = Omit<RendererOptions<IncaNode, IncaElement>, "patchProp">;
13
- /**
14
- * `@vue/runtime-core`'s {@link RendererOptions}`<IncaNode, IncaElement>`,
15
- * minus `patchProp`. This is the host-node lifecycle half of `incajs/vue`'s custom
16
- * renderer.
17
- * @param core - the incajs bindings to drive the native tree through
18
- */
19
- export declare function createNodeOps(core: IncaCore): NodeOps;
20
- type Creators = Pick<NodeOps, "createElement" | "createText">;
21
- /**
22
- * The creators of `ops` that hold the node they create and release the hold
23
- * once the returned handle is collected.
24
- * @param core - the incajs bindings the holds go through
25
- * @param ops - the creators to wrap
26
- * @returns held versions of `createElement` and `createText`
27
- */
28
- export declare function createHeldNodeOps(core: IncaCore, ops: Creators): Creators;
29
- export {};
@@ -1,79 +0,0 @@
1
- import { RendererOptions } from '@vue/runtime-core';
2
- import { IncaCore, IncaElement } from '../rendererCore.mts';
3
- /**
4
- * {@link RendererOptions.patchProp} applies one changed `v-bind`/
5
- * attribute/event prop to a host element.
6
- *
7
- * ### `style`
8
- *
9
- * An object (per `:style="{...}"`) is diffed against the entries already
10
- * sent for this element.
11
- * - `core.setStyle` runs for each entry that is new or changed.
12
- * - `core.removeStyle` runs for each sent entry that is now absent, `null`,
13
- * or not a string/number. After a removal, `core.setStyle` runs again for
14
- * every remaining string/number entry.
15
- * - A string or `null` `style` removes every entry.
16
- * - A key takes any of three spellings: kebab-case (`flex-direction`),
17
- * camelCase (`flexDirection`) or snake_case (`flex_direction`). If an
18
- * object names one property in two spellings, the value set most recently
19
- * applies.
20
- *
21
- * ### `onXxx`
22
- *
23
- * The key registers `nextValue` as a listener for `xxx`, taking a function
24
- * or an array of them. A falsy `nextValue` unbinds that key's listener. Any
25
- * other value keeps a listener that runs nothing, and a development build
26
- * warns about it. A nested array runs its functions. Any other entry that is
27
- * not a function runs nothing, and a development build warns about it when
28
- * the event fires. A falsy entry of the array itself is skipped without a
29
- * warning.
30
- * - Order: each distinct key (`onClick`, `onClickOnce`) is its own listener.
31
- * Keys that share the event, phase and passivity run in the order first
32
- * registered, a re-patch keeps its place, and the host sees one registration
33
- * per element, event, phase and passivity. Capture registrations run before
34
- * every bubble registration, also on the target. Within a pass,
35
- * registrations run in the order the host registered them.
36
- * - Propagation: `stopImmediatePropagation()` stops the listeners after it.
37
- * - Timing: a listener attached while an event is being handled first runs
38
- * for the next event; events are told apart by the `eventId` the host puts
39
- * on each one.
40
- * - Modifiers: a trailing `Once`/`Passive`/`Capture` suffix (from Vue's
41
- * `.once`/`.passive`/`.capture` modifiers) is stripped first. `.once`
42
- * removes the listener after it fires once, and a listener that has fired
43
- * stays spent until its key is removed. `.capture` registers the listener
44
- * for the phase in which the event travels down to the target, and
45
- * `.passive` ignores `preventDefault()` calls inside it.
46
- * - Event names: `onXxx` listens for the hyphenated name (`onMyEvent` listens
47
- * for `my-event`), and `on:xxx` listens for the name after the colon as
48
- * written (`on:myEvent` listens for `myEvent`). The listener runs when the
49
- * host dispatches that name. `IncaEventMap` gives the event type of each
50
- * name the host dispatches.
51
- * - Errors: an error a handler throws, or a rejection of an async handler,
52
- * goes to the `onErrorCaptured` hooks and the app's `errorHandler`. Every
53
- * handler of an event runs even when an earlier one fails, until one calls
54
- * `stopImmediatePropagation()`. An error that no hook or `errorHandler`
55
- * takes is logged to the console in a production build, or raised to the
56
- * host's error report when `throwUnhandledErrorInProduction` is set. A
57
- * development build warns and raises it to the host's error report, once
58
- * per failing handler.
59
- *
60
- * ### `onxxx`
61
- *
62
- * A lowercase key that names a handler property of the element, such as
63
- * `onclick`, assigns `nextValue` to that property. A string `nextValue`
64
- * clears the property and goes to `core.setAttribute` like other props.
65
- *
66
- * ### Other props
67
- *
68
- * A string, number or boolean `nextValue` goes to `core.setAttribute` as it
69
- * is. A `null` or `undefined` `nextValue` goes to `core.removeAttribute`,
70
- * which includes a prop that is absent from the new vnode. So does any falsy
71
- * value other than `""` for a boolean attribute: `disabled`, `hidden`,
72
- * `inert`, and the names Vue treats as boolean attributes, such as
73
- * `readonly`. Any other value (an object, array, function or symbol) goes to
74
- * `core.setAttribute` as `String(nextValue)`. An `onUpdate:` key is a
75
- * component event and sets nothing.
76
- *
77
- * @param core - the incajs bindings to drive the native tree through
78
- */
79
- export declare function createPatchProp(core: IncaCore): RendererOptions<unknown, IncaElement>["patchProp"];
@@ -1,2 +0,0 @@
1
- export * from '@vue/runtime-core';
2
- export { withKeys, withModifiers } from '@vue/runtime-dom';
package/dist/window.d.mts DELETED
@@ -1,13 +0,0 @@
1
- import { IncaWindow } from './types.mts';
2
- /**
3
- * The event target at the top of the app, after `document`. Every event path
4
- * ends at it. Bubble listeners on it run for every bubbling event, and capture
5
- * listeners run for every event dispatched in the app, including events that
6
- * do not bubble. A key event reaches it through the mount container and
7
- * `document`. A `wheel` listener is passive unless its options say
8
- * `passive: false`.
9
- *
10
- * It has the listener methods `addEventListener`, `removeEventListener` and
11
- * `dispatchEvent`, and the event handler properties such as `onkeydown`.
12
- */
13
- export declare const window: IncaWindow;