incajs 0.0.21 → 0.0.23

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 (39) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/hooks-N7NnMPKd.js +1 -0
  3. package/dist/chunks/rendererCore-B3-0H_IR.d.ts +385 -0
  4. package/dist/chunks/rendererCore-b4ytjgR8.js +1 -0
  5. package/dist/chunks/rolldown-runtime-DK3Fl9T5.js +1 -0
  6. package/dist/chunks/window-DD6KfOr9.d.ts +691 -0
  7. package/dist/index.d.ts +12 -0
  8. package/dist/index.js +1 -3
  9. package/dist/rendererCore.d.ts +3 -0
  10. package/dist/rendererCore.js +1 -4
  11. package/dist/vue-runtime.d.ts +3 -0
  12. package/dist/vue-runtime.js +1 -2
  13. package/dist/{vue/createApp.d.mts → vue.d.ts} +6 -4
  14. package/dist/vue.js +2 -179
  15. package/package.json +6 -18
  16. package/dist/callbacks.d.mts +0 -31
  17. package/dist/chunks/handle-DdYIkUcm.js +0 -215
  18. package/dist/chunks/hooks-D1NFQN8Q.js +0 -205
  19. package/dist/chunks/rendererCore-NnTAUL80.js +0 -110
  20. package/dist/element/eventHandlers.d.mts +0 -12
  21. package/dist/element/geometry.d.mts +0 -61
  22. package/dist/element/handle.d.mts +0 -19
  23. package/dist/element/lifecycle.d.mts +0 -51
  24. package/dist/element/scroll.d.mts +0 -42
  25. package/dist/element/shadowTree.d.mts +0 -64
  26. package/dist/element/types.d.mts +0 -132
  27. package/dist/eventTarget.d.mts +0 -10
  28. package/dist/events.d.mts +0 -73
  29. package/dist/index.d.mts +0 -6
  30. package/dist/native.d.mts +0 -41
  31. package/dist/rendererCore.d.mts +0 -14
  32. package/dist/targets.d.mts +0 -1
  33. package/dist/tree.d.mts +0 -157
  34. package/dist/types.d.mts +0 -415
  35. package/dist/vue/index.d.mts +0 -2
  36. package/dist/vue/nodeOps.d.mts +0 -29
  37. package/dist/vue/patchProp.d.mts +0 -79
  38. package/dist/vue/runtime.d.mts +0 -2
  39. package/dist/window.d.mts +0 -13
package/dist/types.d.mts DELETED
@@ -1,415 +0,0 @@
1
- /**
2
- * Stable handle to a node in the native retained tree, returned by `createNode`
3
- * and used in every later call that touches that node.
4
- */
5
- export type NodeId = number;
6
- /**
7
- * Id assigned to one registered event listener. Managed internally by
8
- * `addEventListener`/`removeEventListener`/`destroyNode`.
9
- */
10
- export type CallbackId = number;
11
- /**
12
- * A value `setAttribute`/`setStyle` can take. Any other value raises a catchable
13
- * exception.
14
- */
15
- export type AttributeValue = string | number | boolean;
16
- /**
17
- * Element kind passed to `createNode`. `"text"` is the only tag with
18
- * dedicated rendering behavior: it renders its `"value"` attribute followed
19
- * by its descendants' text. Any other string is a generic styled
20
- * container; the `string & {}` half of this type keeps `"text"`'s
21
- * autocomplete while still accepting an arbitrary tag name.
22
- */
23
- export type TagName = "text" | (string & {});
24
- /** Where `scrollIntoView` aligns a node on one axis. */
25
- export type ScrollAlignment = "start" | "center" | "end" | "nearest";
26
- /** One overflow value; `"auto"` is an alias of `"scroll"`. */
27
- export type Overflow = "visible" | "hidden" | "clip" | "scroll" | "auto";
28
- /**
29
- * Style properties, in their snake_case spelling, that `setStyle`'s typed
30
- * overload checks. A deliberately incomplete, v1 layout/paint vocabulary. The
31
- * renderer also reads the camelCase and kebab-case spellings. An unrecognized
32
- * key or a value shape that doesn't parse (e.g. a malformed enum string) is
33
- * ignored by the renderer, and the host prints a warning line on stderr for
34
- * it (an empty string `''` prints none).
35
- */
36
- export interface StyleProps {
37
- /** Layout mode for this node's children. `"none"` skips both layout and rendering for the whole subtree. */
38
- display?: "flex" | "block" | "grid" | "none";
39
- /** Main-axis direction for a `"flex"` container. */
40
- flex_direction?: "row" | "column" | "row_reverse" | "column_reverse";
41
- /** Main-axis alignment of children within this container. */
42
- justify_content?: "start" | "end" | "center" | "stretch";
43
- /** Cross-axis alignment of children within this container. */
44
- align_items?: "start" | "end" | "center" | "stretch";
45
- /** Uniform spacing, in px (`>= 0`), between children, applied on both axes. */
46
- gap?: number;
47
- /** Fixed width in px (`>= 0`), or `"auto"` to size to content. */
48
- width?: number | "auto";
49
- /** Fixed height in px (`>= 0`), or `"auto"` to size to content. */
50
- height?: number | "auto";
51
- /** Uniform border width in px (`>= 0`), applied to all four sides. */
52
- border_width?: number;
53
- /** Fill color, as a hex number (`0xRRGGBB`) or a CSS-style string (`"#rrggbb"`/`"#rgb"`). */
54
- background?: number | string;
55
- /** Border color. Accepts the same formats as {@link StyleProps.background}. */
56
- border_color?: number | string;
57
- /** 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. */
58
- text_color?: number | string;
59
- /** Uniform corner radius in px (`>= 0`), applied to all four corners. */
60
- corner_radius?: number;
61
- /** Font size in px (`>= 0`) for this container's own text. Cascades to descendant text leaves, same as {@link StyleProps.text_color}. */
62
- text_size?: number;
63
- /** 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}. */
64
- overflow?: Overflow | `${Overflow} ${Overflow}`;
65
- /** Horizontal overflow; wins over {@link StyleProps.overflow}. */
66
- overflow_x?: Overflow;
67
- /** Vertical overflow; wins over {@link StyleProps.overflow}. */
68
- overflow_y?: Overflow;
69
- /** 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. */
70
- padding?: number;
71
- /** Horizontal inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
72
- padding_x?: number;
73
- /** Vertical inner spacing in px (`>= 0`); wins over {@link StyleProps.padding}. */
74
- padding_y?: number;
75
- /** Top inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_y}. */
76
- padding_top?: number;
77
- /** Right inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_x}. */
78
- padding_right?: number;
79
- /** Bottom inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_y}. */
80
- padding_bottom?: number;
81
- /** Left inner spacing in px (`>= 0`); wins over {@link StyleProps.padding_x}. */
82
- padding_left?: number;
83
- /** 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. */
84
- margin?: number | "auto";
85
- /** Horizontal outer spacing; wins over {@link StyleProps.margin}. */
86
- margin_x?: number | "auto";
87
- /** Vertical outer spacing; wins over {@link StyleProps.margin}. */
88
- margin_y?: number | "auto";
89
- /** Top outer spacing; wins over {@link StyleProps.margin_y}. */
90
- margin_top?: number | "auto";
91
- /** Right outer spacing; wins over {@link StyleProps.margin_x}. */
92
- margin_right?: number | "auto";
93
- /** Bottom outer spacing; wins over {@link StyleProps.margin_y}. */
94
- margin_bottom?: number | "auto";
95
- /** Left outer spacing; wins over {@link StyleProps.margin_x}. */
96
- margin_left?: number | "auto";
97
- /** Share (`>= 0`) of the free space in the parent's main axis this node takes. */
98
- flex_grow?: number;
99
- /** Share (`>= 0`) of the overflow in the parent's main axis this node gives up. */
100
- flex_shrink?: number;
101
- /** Opacity from `0` to `1`, applied to this node and its descendants; values outside are clamped. */
102
- opacity?: number;
103
- /** Minimum width in px (`>= 0`), or `"auto"` for the default minimum. */
104
- min_width?: number | "auto";
105
- /** Minimum height in px (`>= 0`), or `"auto"` for the default minimum. */
106
- min_height?: number | "auto";
107
- /** Maximum width in px (`>= 0`), or `"auto"` for no limit. */
108
- max_width?: number | "auto";
109
- /** Maximum height in px (`>= 0`), or `"auto"` for no limit. */
110
- max_height?: number | "auto";
111
- }
112
- /**
113
- * An event built in this runtime with `Event`, `CustomEvent` or another
114
- * event constructor. The host throws a `TypeError` for any other value.
115
- */
116
- export interface EventLike {
117
- readonly type: string;
118
- }
119
- /**
120
- * How a listener registered via `addEventListener` takes part in an event.
121
- */
122
- export interface ListenerOptions {
123
- /** Listen while the event travels from the root down to the target. The default listens while it travels back up. */
124
- capture?: boolean;
125
- /** `preventDefault()` calls inside the listener are ignored. */
126
- passive?: boolean;
127
- /** The listener is removed before it first runs. */
128
- once?: boolean;
129
- }
130
- /**
131
- * The listener methods of an object that receives events, such as the
132
- * `window` export and a template `ref`. A registration is identified by the
133
- * event name, the listener and `capture`. `removeEventListener` takes the
134
- * same listener that `addEventListener` received.
135
- */
136
- export interface IncaEventTarget {
137
- /**
138
- * Registers `listener` for `type`. Registering the same listener for the
139
- * same `type` and `capture` again changes nothing. A `null` listener is
140
- * ignored.
141
- * @param type - the event name (e.g. `"keydown"`)
142
- * @param listener - a function, called with the event's `currentTarget` as
143
- * `this`, or an object whose `handleEvent` method is called with the object
144
- * as `this` when the event fires
145
- * @param options - a {@link ListenerOptions}, or a boolean for `capture`
146
- */
147
- addEventListener<K extends keyof IncaEventMap>(type: K, listener: EventListenerOrObject<IncaEventMap[K], this> | null, options?: boolean | ListenerOptions): void;
148
- addEventListener<E = IncaEvent>(type: string, listener: EventListenerOrObject<E, this> | null, options?: boolean | ListenerOptions): void;
149
- /**
150
- * Drops the registration of `listener` for `type` with the same `capture`.
151
- * A call that matches no registration changes nothing.
152
- * @param type - the event name
153
- * @param listener - the listener that was registered
154
- * @param options - an object with `capture`, or a boolean for `capture`
155
- */
156
- removeEventListener<K extends keyof IncaEventMap>(type: K, listener: EventListenerOrObject<IncaEventMap[K], this> | null, options?: boolean | Pick<ListenerOptions, "capture">): void;
157
- removeEventListener<E = IncaEvent>(type: string, listener: EventListenerOrObject<E, this> | null, options?: boolean | Pick<ListenerOptions, "capture">): void;
158
- /**
159
- * Dispatches an event built with an event constructor at the target.
160
- * @param event - the event to dispatch
161
- * @returns `false` when a listener canceled a cancelable event, else `true`
162
- * @throws TypeError when `event` is not an event built with an event constructor
163
- * @throws DOMException named `InvalidStateError` when `event` is being dispatched
164
- */
165
- dispatchEvent(event: EventLike): boolean;
166
- }
167
- /**
168
- * The fields every event carries. {@link IncaEventMap} gives the event type of
169
- * each name the host dispatches, and a listener for any other name receives
170
- * this type.
171
- *
172
- * See https://incajs.tom96da.com/reference/events for the event names the
173
- * host dispatches and their fields.
174
- */
175
- export interface IncaEvent {
176
- /** The event's name. */
177
- readonly type: string;
178
- /** `0`, the {@link IncaEvent.eventPhase} outside a dispatch. */
179
- readonly NONE: 0;
180
- /** `1`, the {@link IncaEvent.eventPhase} on an ancestor while the event travels down. */
181
- readonly CAPTURING_PHASE: 1;
182
- /** `2`, the {@link IncaEvent.eventPhase} on the target. */
183
- readonly AT_TARGET: 2;
184
- /** `3`, the {@link IncaEvent.eventPhase} on an ancestor while the event travels up. */
185
- readonly BUBBLING_PHASE: 3;
186
- /**
187
- * The element the event is about, or `window`. It is the deepest element
188
- * under the pointer for pointer events, the nearest common ancestor of the
189
- * press and the release for `click`, `dblclick` and `auxclick`, and the
190
- * focused element for key events. With no such element it is `window`.
191
- */
192
- readonly target: IncaEventTarget;
193
- /** The same object as {@link IncaEvent.target}. */
194
- readonly srcElement: IncaEventTarget;
195
- /**
196
- * The element or `window` whose listener is running, and `null` once the
197
- * event has been handled. A listener function runs with it as `this`.
198
- */
199
- readonly currentTarget: IncaEventTarget | null;
200
- /**
201
- * Whether the event travels up from `target`. Fixed per event name for the
202
- * events the host dispatches.
203
- */
204
- readonly bubbles: boolean;
205
- /**
206
- * Whether `preventDefault()` can cancel the event. Fixed per event name for
207
- * the events the host dispatches.
208
- */
209
- readonly cancelable: boolean;
210
- /** Fixed per event name for the events the host dispatches. */
211
- readonly composed: boolean;
212
- /**
213
- * 1 on the ancestors of `target` while the event travels down, 2 where
214
- * `currentTarget` is `target`, 3 on the ancestors while it travels up, and 0
215
- * once the event has been handled.
216
- */
217
- readonly eventPhase: 0 | 1 | 2 | 3;
218
- /** `true` once a listener called `preventDefault()` on a cancelable event. */
219
- readonly defaultPrevented: boolean;
220
- /** `true` for events the host dispatches and `false` for events a script dispatches. */
221
- readonly isTrusted: boolean;
222
- /** Milliseconds since the host started. */
223
- readonly timeStamp: number;
224
- /** A number that grows with each event and is the same on every node that event reaches. */
225
- readonly eventId: number;
226
- /** Assigning `true` while the event is dispatched stops it like `stopPropagation()`. */
227
- cancelBubble: boolean;
228
- /** The opposite of `defaultPrevented`. Assigning `false` cancels a cancelable event like `preventDefault()`. */
229
- returnValue: boolean;
230
- /** Stops the event from reaching the listeners of later nodes on its path. */
231
- stopPropagation(): void;
232
- /** Stops the event from reaching any later listener. */
233
- stopImmediatePropagation(): void;
234
- /** Cancels the event when it is cancelable and the listener is not passive. */
235
- preventDefault(): void;
236
- /**
237
- * `target` and its ancestors, ending with `window`, and an empty array once
238
- * the event has been handled.
239
- */
240
- composedPath(): IncaEventTarget[];
241
- /**
242
- * Sets the type, `bubbles` and `cancelable` of an event that is not being
243
- * dispatched, clears its stop and cancel flags and makes it untrusted. While
244
- * the event is dispatched it does nothing.
245
- */
246
- initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
247
- }
248
- /**
249
- * The event object of a mouse, wheel, keyboard or focus event.
250
- */
251
- export interface IncaUIEvent extends IncaEvent {
252
- /**
253
- * On the events the host dispatches, the click count of `mousedown`,
254
- * `mouseup`, `click`, `dblclick` and `auxclick`, and `0` on the others.
255
- */
256
- readonly detail: number;
257
- /** Always `null`. */
258
- readonly view: null;
259
- /**
260
- * On the events the host dispatches: for `mousedown`, `mouseup`, `click`,
261
- * `dblclick`, `auxclick` and `contextmenu`, `button + 1`. For `wheel`, `0`.
262
- * For the other mouse events, the lowest held button plus 1, or `0` with no
263
- * button held. For a keyboard event, `keyCode`. For a focus event, `0`.
264
- */
265
- readonly which: number;
266
- }
267
- /** The event object of `focus`, `blur`, `focusin` and `focusout`. */
268
- export interface IncaFocusEvent extends IncaUIEvent {
269
- /**
270
- * The element gaining focus for `blur` and `focusout`, the element losing
271
- * it for `focus` and `focusin`, or `null`.
272
- */
273
- readonly relatedTarget: IncaEventTarget | null;
274
- }
275
- /** The event object of the mouse events. */
276
- export interface IncaMouseEvent extends IncaUIEvent {
277
- readonly screenX: number;
278
- readonly screenY: number;
279
- /** The pointer's position in the window. */
280
- readonly clientX: number;
281
- /** The pointer's position in the window. */
282
- readonly clientY: number;
283
- /** The same as {@link IncaMouseEvent.clientX}. */
284
- readonly pageX: number;
285
- /** The same as {@link IncaMouseEvent.clientY}. */
286
- readonly pageY: number;
287
- /** The same as {@link IncaMouseEvent.clientX}. */
288
- readonly x: number;
289
- /** The same as {@link IncaMouseEvent.clientY}. */
290
- readonly y: number;
291
- /** On the events the host dispatches, the pointer's position from the padding edge of `target`. */
292
- readonly offsetX: number;
293
- /** On the events the host dispatches, the pointer's position from the padding edge of `target`. */
294
- readonly offsetY: number;
295
- /** On the events the host dispatches, the pointer's travel since the previous `mousemove`, and `0` on other events. */
296
- readonly movementX: number;
297
- /** On the events the host dispatches, the pointer's travel since the previous `mousemove`, and `0` on other events. */
298
- readonly movementY: number;
299
- /** The button the event is about: `0` left, `1` middle, `2` right, `3` back, `4` forward. */
300
- readonly button: number;
301
- /** Every button held, as a bitmask: `1` left, `2` right, `4` middle, `8` back, `16` forward. */
302
- readonly buttons: number;
303
- readonly ctrlKey: boolean;
304
- readonly shiftKey: boolean;
305
- readonly altKey: boolean;
306
- readonly metaKey: boolean;
307
- /**
308
- * The element the pointer came from for `mouseover` and `mouseenter`, the
309
- * element it went to for `mouseout` and `mouseleave`, or `null`.
310
- */
311
- readonly relatedTarget: IncaEventTarget | null;
312
- /**
313
- * Whether the modifier `key` is held: `"Control"`, `"Shift"`, `"Alt"`,
314
- * `"Meta"`, or `"Accel"` (Meta on macOS, Control elsewhere). Any other name
315
- * gives `false`.
316
- */
317
- getModifierState(key: string): boolean;
318
- }
319
- /** The event object of `click`, `auxclick` and `contextmenu`. */
320
- export interface IncaPointerEvent extends IncaMouseEvent {
321
- /** On the events the host dispatches, `1` for the mouse and `-1` for the click of a key. */
322
- readonly pointerId: number;
323
- readonly width: number;
324
- readonly height: number;
325
- /** On the events the host dispatches, `0.5` while a button is held, else `0`. */
326
- readonly pressure: number;
327
- /** On the events the host dispatches, `"mouse"`, or `""` for the click of a key. */
328
- readonly pointerType: string;
329
- /** On the events the host dispatches, `true` for the mouse and `false` for the click of a key. */
330
- readonly isPrimary: boolean;
331
- }
332
- /** The event object of `wheel`. */
333
- export interface IncaWheelEvent extends IncaMouseEvent {
334
- readonly deltaX: number;
335
- readonly deltaY: number;
336
- /** `0` on the events the host dispatches. */
337
- readonly deltaZ: number;
338
- /** `0` for pixels, `1` for lines. */
339
- readonly deltaMode: number;
340
- readonly DOM_DELTA_PIXEL: 0;
341
- readonly DOM_DELTA_LINE: 1;
342
- readonly DOM_DELTA_PAGE: 2;
343
- }
344
- /** The event object of `keydown` and `keyup`. */
345
- export interface IncaKeyboardEvent extends IncaUIEvent {
346
- /** The key's name, such as `"Enter"`, `"F5"` or the typed character. */
347
- readonly key: string;
348
- /** `""` on the events the host dispatches. */
349
- readonly code: string;
350
- /** `0` on the events the host dispatches. */
351
- readonly location: number;
352
- /** Whether the key press is an auto-repeat. */
353
- readonly repeat: boolean;
354
- /** `false` on the events the host dispatches. */
355
- readonly isComposing: boolean;
356
- /** The key's code on a US keyboard layout, and `0` for a key outside it. */
357
- readonly keyCode: number;
358
- /** `0` on the events the host dispatches. */
359
- readonly charCode: number;
360
- readonly ctrlKey: boolean;
361
- readonly shiftKey: boolean;
362
- readonly altKey: boolean;
363
- readonly metaKey: boolean;
364
- readonly DOM_KEY_LOCATION_STANDARD: 0;
365
- readonly DOM_KEY_LOCATION_LEFT: 1;
366
- readonly DOM_KEY_LOCATION_RIGHT: 2;
367
- readonly DOM_KEY_LOCATION_NUMPAD: 3;
368
- /**
369
- * Whether the modifier `key` is held: `"Control"`, `"Shift"`, `"Alt"`,
370
- * `"Meta"`, or `"Accel"` (Meta on macOS, Control elsewhere). Any other name
371
- * gives `false`.
372
- */
373
- getModifierState(key: string): boolean;
374
- }
375
- /** The event object of each event name the host dispatches. */
376
- export interface IncaEventMap {
377
- auxclick: IncaPointerEvent;
378
- blur: IncaFocusEvent;
379
- click: IncaPointerEvent;
380
- contextmenu: IncaPointerEvent;
381
- dblclick: IncaMouseEvent;
382
- focus: IncaFocusEvent;
383
- focusin: IncaFocusEvent;
384
- focusout: IncaFocusEvent;
385
- keydown: IncaKeyboardEvent;
386
- keyup: IncaKeyboardEvent;
387
- mousedown: IncaMouseEvent;
388
- mouseenter: IncaMouseEvent;
389
- mouseleave: IncaMouseEvent;
390
- mousemove: IncaMouseEvent;
391
- mouseout: IncaMouseEvent;
392
- mouseover: IncaMouseEvent;
393
- mouseup: IncaMouseEvent;
394
- scroll: IncaEvent;
395
- wheel: IncaWheelEvent;
396
- }
397
- /**
398
- * Signature of a callback registered via `addEventListener`. It receives the
399
- * event, an {@link IncaEvent} unless the parameter declares another type, and
400
- * runs with the event's `currentTarget`, the target it was registered on, as
401
- * `this`.
402
- */
403
- export type EventListener<E = IncaEvent, T = IncaEventTarget> = (this: T, event: E) => void;
404
- /**
405
- * An object whose `handleEvent` method receives the events, called with the
406
- * object as `this`. It takes the event an {@link EventListener} takes.
407
- */
408
- export interface EventListenerObject<E = IncaEvent> {
409
- handleEvent(event: E): void;
410
- }
411
- /**
412
- * What `addEventListener` accepts as a listener: an {@link EventListener} or
413
- * an {@link EventListenerObject}.
414
- */
415
- 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
- * `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 { IncaEventTarget } from './types.mts';
2
- /**
3
- * The event target at the top of the app. Every event path ends at it.
4
- * Bubble listeners on it run for every bubbling event, and capture listeners
5
- * run for every event dispatched in the app, including events that do not
6
- * bubble. Key events reach it while nothing is focused, with `window` as
7
- * `target`. A `wheel` listener is passive unless its options say
8
- * `passive: false`.
9
- *
10
- * It has the listener methods `addEventListener`, `removeEventListener` and
11
- * `dispatchEvent`.
12
- */
13
- export declare const window: IncaEventTarget;