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
@@ -1,132 +0,0 @@
1
- import { IncaEvent, IncaEventMap, IncaEventTarget } from '../types.mts';
2
- import { HANDLER_EVENTS } from './eventHandlers.mts';
3
- import { RectLike } from './geometry.mts';
4
- import { ScrollIntoViewOptions, ScrollOptions } from './scroll.mts';
5
- /** A function an event handler property holds, called with the element as `this` and the event. */
6
- export type EventHandler<E = IncaEvent> = (this: IncaElement, event: E) => unknown;
7
- /**
8
- * The event handler properties, such as `onclick`, of the events the host dispatches, `focusin` and
9
- * `focusout` excepted.
10
- */
11
- export type EventHandlers = {
12
- [K in (typeof HANDLER_EVENTS)[number] as `on${K}`]: EventHandler<IncaEventMap[K]> | object | null;
13
- };
14
- /**
15
- * A container node: either a real element or the hidden stand-in that
16
- * `createCommentNode` makes. It is the only node type that can act as a
17
- * parent. `parent` and `children` read the node's current position in the
18
- * tree.
19
- *
20
- * After the node is removed, `addEventListener()` and `removeEventListener()`
21
- * ignore the call, an assignment to a handler property does nothing, and
22
- * `dispatchEvent()` returns `true`.
23
- */
24
- export interface IncaElement extends IncaEventTarget, EventHandlers {
25
- /**
26
- * The `id` attribute, or an empty string when it is unset. Assigning sets
27
- * the attribute to the value as a string. After the node is removed,
28
- * reading gives an empty string and assigning does nothing.
29
- */
30
- id: string;
31
- /**
32
- * `"comment"` for the hidden stand-in `createCommentNode` makes;
33
- * `"element"` for every other container.
34
- */
35
- readonly kind: "element" | "comment";
36
- /** The current parent, or `null` if this node isn't attached to the tree. */
37
- parent: IncaElement | null;
38
- /** This node's children, in render order. */
39
- children: IncaNode[];
40
- /**
41
- * Focuses this node next frame. The node needs a `tabindex` attribute. A
42
- * `true` `preventScroll` keeps every scroll container where it is. After
43
- * the node is removed, the call does nothing.
44
- */
45
- focus(options?: {
46
- preventScroll?: boolean;
47
- }): void;
48
- /** Unfocuses this node next frame, if it is the focused one. */
49
- blur(): void;
50
- /**
51
- * Fires an untrusted `click` at this node. A disabled `button` and a node
52
- * whose own click is still running ignore the call. After the node is
53
- * removed, the call does nothing.
54
- */
55
- click(): void;
56
- /**
57
- * Whether `other` is this node or one of its descendants in the tree as
58
- * rendered. `null` and `undefined` give `false`, and any other value that is
59
- * not a node throws a `TypeError`. After the node is removed, it still answers
60
- * for the subtree it keeps.
61
- */
62
- contains(other: IncaNode | null): boolean;
63
- /**
64
- * Assigning sets the `tabindex` attribute to the value's integer part,
65
- * wrapped to 32 bits. Reading returns the `tabindex` attribute as an
66
- * integer, or `-1` (`0` for a `button`) when it is unset or invalid.
67
- * After the node is removed, reading gives that default and assigning does
68
- * nothing.
69
- */
70
- tabIndex: number;
71
- /**
72
- * The box this node was drawn at in the last frame, in window logical
73
- * pixels. A node created in the same task reads all zeros.
74
- */
75
- getBoundingClientRect(): RectLike;
76
- /** The box width from the last frame, rounded. `0` until a frame draws the node. */
77
- readonly offsetWidth: number;
78
- /** The box height from the last frame, rounded. `0` until a frame draws the node. */
79
- readonly offsetHeight: number;
80
- /** The box's left edge from the last frame, relative to {@link offsetParent}. Stays fixed while the parent scrolls. */
81
- readonly offsetLeft: number;
82
- /** The box's top edge from the last frame, relative to {@link offsetParent}. Stays fixed while the parent scrolls. */
83
- readonly offsetTop: number;
84
- /**
85
- * The parent, when this node and the parent both have a box from the last frame.
86
- * `null` when either lacks a box or there is no parent.
87
- */
88
- readonly offsetParent: IncaElement | null;
89
- /** The box width less both borders, rounded, at least `0`. */
90
- readonly clientWidth: number;
91
- /** The box height less both borders, rounded, at least `0`. */
92
- readonly clientHeight: number;
93
- /** The border width, rounded. */
94
- readonly clientLeft: number;
95
- /** The border width, rounded. */
96
- readonly clientTop: number;
97
- /** The horizontal scroll offset. Assigning moves it at once, and reads are clamped to the last frame's maximum. */
98
- scrollLeft: number;
99
- /** The vertical scroll offset. Assigning moves it at once, and reads are clamped to the last frame's maximum. */
100
- scrollTop: number;
101
- /** The content width: {@link clientWidth} plus the largest horizontal offset. */
102
- readonly scrollWidth: number;
103
- /** The content height: {@link clientHeight} plus the largest vertical offset. */
104
- readonly scrollHeight: number;
105
- /** Sets the offset to `(left, top)`, or to the options object's `left` and `top`. */
106
- scrollTo(left?: number, top?: number): void;
107
- scrollTo(options: ScrollOptions): void;
108
- /** Adds `(left, top)` to the offset, or the options object's `left` and `top`. */
109
- scrollBy(left?: number, top?: number): void;
110
- scrollBy(options: ScrollOptions): void;
111
- /**
112
- * Scrolls each scroll container around this node so the node shows. `true`
113
- * or no argument aligns to the start and `false` to the end. An options
114
- * object sets `block` (default `"start"`) and `inline` (default `"nearest"`);
115
- * `behavior` is accepted and ignored. After the node is removed, the call
116
- * does nothing.
117
- */
118
- scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;
119
- }
120
- /** A text leaf node. */
121
- export interface IncaText {
122
- /** Discriminates this node within the {@link IncaNode} union. */
123
- readonly kind: "text";
124
- /** The current parent, or `null` if this node isn't attached to the tree. */
125
- parent: IncaElement | null;
126
- /**
127
- * The text content, mirroring the value pushed to the native node.
128
- */
129
- text: string;
130
- }
131
- /** Any node the shadow tree holds: an element, comment, or text leaf. */
132
- export type IncaNode = IncaElement | IncaText;
@@ -1,10 +0,0 @@
1
- import { IncaEventTarget, NodeId } from './types.mts';
2
- /**
3
- * Builds the listener methods of an event target that stands for one node.
4
- * @param nodeId - resolves the node when a method runs
5
- * @param passiveByDefault - event names whose listeners are passive unless
6
- * their options say `passive: false`
7
- * @returns the target's `addEventListener`, `removeEventListener` and
8
- * `dispatchEvent`
9
- */
10
- export declare function createEventTarget(nodeId: () => NodeId, passiveByDefault?: readonly string[]): IncaEventTarget;
package/dist/events.d.mts DELETED
@@ -1,73 +0,0 @@
1
- import { EventLike, EventListenerOrObject, ListenerOptions, NodeId } from './types.mts';
2
- /**
3
- * @returns the `eventId` of the newest event any registered listener has
4
- * received, or 0 before the first. Ids grow with each event, and every
5
- * listener of one event receives the same id.
6
- */
7
- export declare function latestEventId(): number;
8
- /**
9
- * Registers `listener` for `event` on `nodeId`. Registering the same listener
10
- * for the same node, event and `capture` again changes nothing, and the first
11
- * registration keeps its other options. A `null` listener is ignored.
12
- *
13
- * Any event name is accepted, and it fires when the host dispatches that name.
14
- * `IncaEventMap` gives the event type of each name the host dispatches.
15
- * @param nodeId - the node to listen on
16
- * @param event - the event name (e.g. `"click"`)
17
- * @param listener - a function, called with the event's `currentTarget` as
18
- * `this`, or an object whose `handleEvent` method is called with the object
19
- * as `this` when the event fires
20
- * @param options - `capture` listens while the event travels down to the
21
- * target, `passive` ignores `preventDefault()` calls in `listener`, and
22
- * `once` removes the listener before it first runs
23
- * @throws TypeError when `nodeId` is malformed
24
- * @throws TypeError when `nodeId` names no node
25
- * @throws RangeError when the host has issued its last callback id
26
- */
27
- export declare function addEventListener(nodeId: NodeId, event: string, listener: EventListenerOrObject<never, never> | null, options?: ListenerOptions): void;
28
- /**
29
- * Drops the registration {@link addEventListener} made for `listener` on
30
- * `nodeId` with the same `event` and `capture`. A no-op if there is none.
31
- * @param nodeId - the node to stop listening on
32
- * @param event - the event name
33
- * @param listener - the listener that was registered
34
- * @param options - `capture` of the registration to drop
35
- */
36
- export declare function removeEventListener(nodeId: NodeId, event: string, listener: EventListenerOrObject<never, never> | null, options?: Pick<ListenerOptions, "capture">): void;
37
- /**
38
- * Dispatches `event` at `nodeId` along the path to the root.
39
- * @param nodeId - the node to dispatch at
40
- * @param event - the event to dispatch
41
- * @returns `false` when a listener canceled a cancelable event, else `true`
42
- * @throws TypeError when `nodeId` is malformed
43
- * @throws TypeError when `nodeId` names no node
44
- * @throws TypeError when `event` is not an event built with an event constructor
45
- * @throws DOMException named `InvalidStateError` when `event` is being dispatched
46
- */
47
- export declare function dispatchEvent(nodeId: NodeId, event: EventLike): boolean;
48
- /**
49
- * Fires an untrusted `click` at `nodeId`. A disabled `button` and a node whose
50
- * own click is still running ignore the call.
51
- * @param nodeId - the node to click
52
- * @throws TypeError when `nodeId` is malformed
53
- * @throws TypeError when `nodeId` names no node
54
- */
55
- export declare function click(nodeId: NodeId): void;
56
- /**
57
- * Requests that `nodeId` become focused. Takes effect on the next frame,
58
- * dispatching `"blur"`/`"focus"` for whatever actually changed. The node
59
- * needs a `tabindex` attribute to take focus, and a listener for either event
60
- * is optional. The scroll containers around the node scroll it into view.
61
- * @param nodeId - the node to focus
62
- * @param preventScroll - `true` to leave the scroll containers in place; omitted or `false` scrolls the node into view
63
- * @throws TypeError when `nodeId` is malformed
64
- * @throws TypeError when `nodeId` names no node
65
- */
66
- export declare function focus(nodeId: NodeId, preventScroll?: boolean): void;
67
- /**
68
- * Requests that `nodeId` become unfocused, the way `element.blur()` does.
69
- * Takes effect on the next frame; a no-op if `nodeId` isn't the focused node
70
- * when it runs.
71
- * @param nodeId - the node to unfocus
72
- */
73
- export declare function blur(nodeId: NodeId): void;
package/dist/index.d.mts DELETED
@@ -1,6 +0,0 @@
1
- export { activeElement } from './element/handle.mts';
2
- export { window } from './window.mts';
3
- export type { RectLike, RectValues } from './element/geometry.mts';
4
- export type { ScrollIntoViewOptions, ScrollOptions } from './element/scroll.mts';
5
- export type { IncaElement, IncaNode } from './element/types.mts';
6
- export type { AttributeValue, CallbackId, EventLike, EventListener, EventListenerObject, EventListenerOrObject, IncaEvent, IncaEventMap, IncaEventTarget, IncaFocusEvent, IncaKeyboardEvent, IncaMouseEvent, IncaPointerEvent, IncaUIEvent, IncaWheelEvent, ListenerOptions, NodeId, StyleProps, TagName, } from './types.mts';
package/dist/native.d.mts DELETED
@@ -1,41 +0,0 @@
1
- import { AttributeValue, CallbackId, EventLike, NodeId, ScrollAlignment } from './types.mts';
2
- /**
3
- * The host-injected object every wrapper in this package forwards to. Not part of the public
4
- * surface.
5
- */
6
- interface IncaNative {
7
- rootNodeId(): NodeId;
8
- createNode(tag: string): NodeId;
9
- appendChild(parentId: NodeId, childId: NodeId): void;
10
- insertBefore(parentId: NodeId, childId: NodeId, anchorId: NodeId | null): void;
11
- removeChild(parentId: NodeId, childId: NodeId): void;
12
- setAttribute(nodeId: NodeId, key: string, value: AttributeValue): void;
13
- getAttribute(nodeId: NodeId, key: string): AttributeValue | null;
14
- removeAttribute(nodeId: NodeId, key: string): void;
15
- setStyle(nodeId: NodeId, key: string, value: AttributeValue): void;
16
- removeStyle(nodeId: NodeId, key: string): void;
17
- addEventListener(nodeId: NodeId, event: string, capture?: boolean, passive?: boolean): CallbackId;
18
- removeEventListener(nodeId: NodeId, event: string, callbackId: CallbackId): boolean;
19
- destroyNode(nodeId: NodeId): CallbackId[];
20
- holdNode(nodeId: NodeId): void;
21
- releaseNode(nodeId: NodeId): void;
22
- focusNode(nodeId: NodeId, preventScroll?: boolean): void;
23
- blurNode(nodeId: NodeId): void;
24
- focusedNode(): NodeId | null;
25
- layoutOf(nodeId: NodeId): readonly [number, number, number, number, number, number, number] | null;
26
- scrollOf(nodeId: NodeId): readonly [number, number, number, number] | null;
27
- scrollNode(nodeId: NodeId, left: number | null, top: number | null): void;
28
- scrollIntoViewNode(nodeId: NodeId, block: ScrollAlignment, inline: ScrollAlignment): void;
29
- dispatchEvent(nodeId: NodeId, event: EventLike): boolean;
30
- click(nodeId: NodeId): void;
31
- }
32
- /** What the host calls: it passes the event object as the first argument. */
33
- export type HostCallback = (...args: unknown[]) => void;
34
- declare global {
35
- var __inca_native__: IncaNative;
36
- var __inca_callbacks__: Record<CallbackId, HostCallback>;
37
- var __inca_released__: (nodeIds: NodeId[], callbackIds: CallbackId[]) => void;
38
- var __inca_targets__: (nodeIds: NodeId[]) => unknown[];
39
- }
40
- export declare function native(): IncaNative;
41
- export {};
@@ -1,14 +0,0 @@
1
- export { createEventTarget } from './eventTarget.mts';
2
- export { window } from './window.mts';
3
- export { addEventListener, removeEventListener, latestEventId, focus, blur, dispatchEvent, click, } from './events.mts';
4
- export { focusedNode, appendChild, createNode, destroyNode, holdNode, releaseNode, insertBefore, removeChild, rootNodeId, setAttribute, getAttribute, layoutOf, scrollOf, scrollNode, scrollIntoViewNode, removeAttribute, setStyle, removeStyle, } from './tree.mts';
5
- export { createIncaElement } from './element/handle.mts';
6
- export { isDestroyed } from './element/lifecycle.mts';
7
- export { createCommentNode, createElementNode, createTextNode, insert, nextSibling, parentNode, remove, setElementText, setText, } from './element/shadowTree.mts';
8
- export type * from './types.mts';
9
- export type * from './element/types.mts';
10
- /**
11
- * What a custom renderer (`incajs/vue`) drives the host through: the tree and
12
- * event calls, the element handles and the shadow tree.
13
- */
14
- export type IncaCore = typeof import('./rendererCore.mts');
@@ -1 +0,0 @@
1
- export {};
package/dist/tree.d.mts DELETED
@@ -1,157 +0,0 @@
1
- import { AttributeValue, NodeId, ScrollAlignment, StyleProps, TagName } from './types.mts';
2
- /**
3
- * Returns the host-allocated root container's id, the node an app attaches
4
- * itself under. The host allocates it with the tree, so this resolves from
5
- * the first call and names the same node for the engine's lifetime.
6
- * @returns the root node's id
7
- */
8
- export declare function rootNodeId(): NodeId;
9
- /**
10
- * Allocates a new node of kind `tag` in the native tree. The node starts out
11
- * detached. Attach it with {@link appendChild}/{@link insertBefore}. The host
12
- * frees the node at the start of the next frame unless it is inserted or held
13
- * with {@link holdNode} by then.
14
- * @param tag - the node's element kind
15
- * @returns the new node's id
16
- */
17
- export declare function createNode(tag: TagName): NodeId;
18
- /**
19
- * Attaches `childId` as the last child of `parentId`. A thin wrapper over
20
- * {@link insertBefore} with no anchor.
21
- * @param parentId - the container to attach to
22
- * @param childId - the node being attached
23
- */
24
- export declare function appendChild(parentId: NodeId, childId: NodeId): void;
25
- /**
26
- * Attaches `childId` as a child of `parentId`, positioned before `anchorId`
27
- * (or at the end, if `anchorId` is `null`). If `anchorId` names a real node
28
- * that just isn't currently a child of `parentId`, this falls back to
29
- * appending at the end. Only a wholly unknown `anchorId` raises.
30
- * @param parentId - the container to attach to
31
- * @param childId - the node being attached
32
- * @param anchorId - the sibling to insert before, or `null` to append at the end
33
- */
34
- export declare function insertBefore(parentId: NodeId, childId: NodeId, anchorId: NodeId | null): void;
35
- /**
36
- * Detaches `childId` from `parentId`. The detached node keeps its own children
37
- * and is freed at the start of the next frame unless it is inserted or held
38
- * with {@link holdNode} by then. Use {@link destroyNode} to free it at once.
39
- * @param parentId - the current container
40
- * @param childId - the node being detached
41
- */
42
- export declare function removeChild(parentId: NodeId, childId: NodeId): void;
43
- /**
44
- * Frees `nodeId` and its whole subtree, detaching it first, and drops every
45
- * event listener registered anywhere in it. Destroying an already-destroyed
46
- * node does nothing. The host's own root cannot be destroyed and raises.
47
- *
48
- * Also drops the hold of {@link holdNode}.
49
- * @param nodeId - the node that isn't coming back
50
- */
51
- export declare function destroyNode(nodeId: NodeId): void;
52
- /**
53
- * Keeps `nodeId` and its subtree alive while it has no parent. The host frees
54
- * a parentless node that is neither held nor inserted by the start of the next
55
- * frame. Holding a held or attached node changes nothing visible.
56
- * @param nodeId - the node to keep
57
- * @throws {TypeError} when `nodeId` names no node
58
- */
59
- export declare function holdNode(nodeId: NodeId): void;
60
- /**
61
- * Ends the hold of {@link holdNode}. A node with no parent is freed at the
62
- * start of the next frame. An unknown id does nothing.
63
- * @param nodeId - the node to let go
64
- */
65
- export declare function releaseNode(nodeId: NodeId): void;
66
- /**
67
- * Sets a non-style attribute/prop on `nodeId`. See {@link setStyle} for
68
- * layout/paint properties, which live in a separate map.
69
- * @param nodeId - the node to update
70
- * @param key - the attribute name
71
- * @param value - the attribute value
72
- */
73
- export declare function setAttribute(nodeId: NodeId, key: string, value: AttributeValue): void;
74
- /**
75
- * Returns the attribute/prop stored on `nodeId` under `key`, or `null` when unset.
76
- * @param nodeId - the node to read
77
- * @param key - the attribute name
78
- * @returns the stored value, or `null`
79
- * @throws {TypeError} when `nodeId` names no node
80
- */
81
- export declare function getAttribute(nodeId: NodeId, key: string): AttributeValue | null;
82
- /**
83
- * Returns the box `nodeId` was drawn at in the last frame, in window logical
84
- * pixels, or `null` if the node has no recorded box.
85
- * @param nodeId - the node to read
86
- * @returns `[x, y, width, height, border, scrollX, scrollY]`, or `null`. `border` is one uniform
87
- * width on all sides. `scrollX` and `scrollY` are the positive scroll offset the parent applied
88
- * to the box.
89
- * @throws {TypeError} when `nodeId` names no node
90
- */
91
- export declare function layoutOf(nodeId: NodeId): readonly [number, number, number, number, number, number, number] | null;
92
- /**
93
- * Returns the scroll offset of `nodeId` in window logical pixels. A write made
94
- * since the last draw is included, clamped to the maximum of the last drawn
95
- * frame.
96
- * @param nodeId - the node to read
97
- * @returns `[left, top, maxLeft, maxTop]`, or `null` for a node whose `overflow` is
98
- * `visible` or `clip` on both axes. The maxima are the largest offsets the node can take, as
99
- * of the last drawn frame.
100
- * @throws {TypeError} when `nodeId` names no node
101
- */
102
- export declare function scrollOf(nodeId: NodeId): readonly [number, number, number, number] | null;
103
- /**
104
- * Sets the scroll offset of `nodeId` on one or both axes. A `null` axis keeps
105
- * its current offset. The host clamps each value to the scrollable range on
106
- * the next frame. A node whose `overflow` is `visible` or `clip` on both axes ignores the call.
107
- * @param nodeId - the node to scroll
108
- * @param left - the horizontal offset, or `null` to keep it
109
- * @param top - the vertical offset, or `null` to keep it
110
- * @throws {TypeError} when `nodeId` names no node
111
- */
112
- export declare function scrollNode(nodeId: NodeId, left: number | null, top: number | null): void;
113
- /**
114
- * Scrolls each scroll container around `nodeId` so the node shows.
115
- * @param nodeId - the node to bring into view
116
- * @param block - the vertical alignment: `"start"`, `"center"`, `"end"` or `"nearest"`
117
- * @param inline - the horizontal alignment: `"start"`, `"center"`, `"end"` or `"nearest"`
118
- * @throws {TypeError} when `nodeId` names no node
119
- * @throws {TypeError} when `block` or `inline` is not an alignment name
120
- */
121
- export declare function scrollIntoViewNode(nodeId: NodeId, block: ScrollAlignment, inline: ScrollAlignment): void;
122
- /**
123
- * Removes a non-style attribute/prop from `nodeId`. Removing an attribute
124
- * that isn't set does nothing.
125
- * @param nodeId - the node to update
126
- * @param key - the attribute name
127
- */
128
- export declare function removeAttribute(nodeId: NodeId, key: string): void;
129
- /**
130
- * Sets a style property on `nodeId`. A snake_case key from {@link StyleProps}
131
- * gets compile-time checking on its value's shape. Any other string key, such
132
- * as a camelCase or kebab-case spelling or a property the types do not list,
133
- * forwards as a raw {@link AttributeValue}.
134
- *
135
- * A key takes any of three spellings: kebab-case (`flex-direction`),
136
- * camelCase (`flexDirection`) or snake_case (`flex_direction`). All three
137
- * name the same property, and the value set most recently applies.
138
- * @param nodeId - the node to update
139
- * @param key - the style property name in any of the three spellings
140
- * @param value - the style property value
141
- */
142
- export declare function setStyle<K extends keyof StyleProps>(nodeId: NodeId, key: K, value: NonNullable<StyleProps[K]>): void;
143
- export declare function setStyle(nodeId: NodeId, key: string, value: AttributeValue): void;
144
- /**
145
- * Removes a style property from `nodeId`, so it renders as if never set.
146
- * Removing a property that isn't set does nothing. The key takes any of the
147
- * three spellings {@link setStyle} accepts, and removes the property whichever
148
- * spelling set it.
149
- * @param nodeId - the node to update
150
- * @param key - the style property name in any of the three spellings
151
- */
152
- export declare function removeStyle(nodeId: NodeId, key: string): void;
153
- /**
154
- * Returns the id of the focused node.
155
- * @returns the focused node's id, or `null` when no node has focus
156
- */
157
- export declare function focusedNode(): NodeId | null;