@gjsify/gtk-host 0.53.0 → 0.55.0
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/lib/esm/capabilities.js +1 -0
- package/lib/esm/conformance/index.js +1 -1
- package/lib/esm/conformance/shared-tree-builder.js +1 -1
- package/lib/esm/descriptors/gtk.js +1 -1
- package/lib/esm/fonts.js +1 -1
- package/lib/esm/policies.js +1 -1
- package/lib/types/adapters/react.d.ts +24 -39
- package/lib/types/attrs.d.ts +47 -51
- package/lib/types/capabilities.d.ts +2 -0
- package/lib/types/conformance/shared-tree-builder.d.ts +1 -1
- package/lib/types/construct-vectors.spec.d.ts +2 -0
- package/lib/types/fonts.d.ts +30 -44
- package/lib/types/host.d.ts +56 -78
- package/lib/types/policies.d.ts +159 -202
- package/lib/types/props.d.ts +23 -36
- package/lib/types/react-jsx-runtime.d.ts +2 -2
- package/lib/types/types.d.ts +94 -86
- package/package.json +9 -5
package/lib/types/host.d.ts
CHANGED
|
@@ -24,23 +24,22 @@ export declare function setEventHandler(el: HostElement, prop: string, next: ((.
|
|
|
24
24
|
/**
|
|
25
25
|
* The ARIA object, diffed against the one it replaces.
|
|
26
26
|
*
|
|
27
|
-
* ONE GROUPED PROP RATHER THAN 53 FLAT `aria*` ONES,
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* `
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* mechanism — so this adds one reserved key to the host, not 53.
|
|
27
|
+
* ONE GROUPED PROP RATHER THAN 53 FLAT `aria*` ONES, for measured reasons. (1)
|
|
28
|
+
* TypeScript exempts every hyphen-containing JSX attribute from excess-property checking —
|
|
29
|
+
* the measurement `emit-types.mts` already records for the kebab property spellings — so a
|
|
30
|
+
* flat `aria-labell` would be accepted in silence, while a key inside a fresh object literal
|
|
31
|
+
* IS checked. (2) The ARIA names collide with the widget's own properties: `label`,
|
|
32
|
+
* `orientation`, `checked`, `expanded` and `selected` are all both, and `orientation` is
|
|
33
|
+
* settable on a `GtkLabel` that implements no `GtkOrientable` at all — one object keeps the
|
|
34
|
+
* two vocabularies apart by construction instead of by prefix. (3) The other surface over
|
|
35
|
+
* this vocabulary already spells it this way: a `.blp` author writes `accessibility {
|
|
36
|
+
* label: "…"; }` (ADR 0034). (4) `setProp` already has this shape for `layout`, so this adds
|
|
37
|
+
* one reserved key to the host, not 53.
|
|
39
38
|
*
|
|
40
39
|
* REFUSED ON THE CLASS, not on the widget: every framework builds bottom-up, so props are
|
|
41
40
|
* authored long before materialisation, and asking the instance would report
|
|
42
|
-
* `<gtk-string-list accessibility={…}>` from inside a later `materialize` rather than at
|
|
43
|
-
* call that wrote it.
|
|
41
|
+
* `<gtk-string-list accessibility={…}>` from inside a later `materialize` rather than at
|
|
42
|
+
* the call that wrote it.
|
|
44
43
|
*
|
|
45
44
|
* The plan is built BEFORE anything is recorded, for the reason the property path states:
|
|
46
45
|
* `el.accessibility` is replayed verbatim by `replayInto`, so a refused value kept there
|
|
@@ -55,32 +54,23 @@ export declare function insert(node: HostNode, parent: HostElement, anchor?: Hos
|
|
|
55
54
|
/**
|
|
56
55
|
* TWO facts, not one: it says it is an element, and it carries a descriptor.
|
|
57
56
|
*
|
|
58
|
-
* `kind` alone is a plain string a GObject wrapper could carry; the descriptor is
|
|
59
|
-
*
|
|
60
|
-
*
|
|
57
|
+
* `kind` alone is a plain string a GObject wrapper could carry; the descriptor is what
|
|
58
|
+
* every host op actually dereferences. Checking both keeps the refusal from being either
|
|
59
|
+
* paranoid or fooled.
|
|
61
60
|
*
|
|
62
|
-
* Exported because the Vue adapter
|
|
63
|
-
*
|
|
64
|
-
* from the raw widget `<Teleport :to="el">` hands through. A predicate stated in
|
|
65
|
-
* two places is a predicate that can disagree with itself about what a node is.
|
|
61
|
+
* Exported because the Vue adapter needs the question before `adopt`, to tell a host
|
|
62
|
+
* parent from the raw widget `<Teleport :to="el">` hands through.
|
|
66
63
|
*/
|
|
67
64
|
export declare function isHostElement(value: unknown): value is HostElement;
|
|
68
65
|
/**
|
|
69
66
|
* Name a foreign value the way its owner would recognise it.
|
|
70
67
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* ORDER IS LOAD-BEARING, and it is measured rather than reasoned: under gjs
|
|
79
|
-
* 1.88.1 `({}).constructor.$gtype` EXISTS and `GObject.type_name` calls it
|
|
80
|
-
* `JSObject`. So a `$gtype`-first version names every object literal — and every
|
|
81
|
-
* DOM-ish stub, which is an object literal — `JSObject`, and the host's own
|
|
82
|
-
* documented `a plain object` fallback was unreachable for exactly the shape it
|
|
83
|
-
* names. `tagName` first, and `JSObject` treated as the absence of a GType.
|
|
68
|
+
* ORDER IS LOAD-BEARING, and it is measured rather than reasoned: under gjs 1.88.1
|
|
69
|
+
* `({}).constructor.$gtype` EXISTS and `GObject.type_name` calls it `JSObject`. A
|
|
70
|
+
* `$gtype`-first version would therefore name every object literal — and every DOM-ish
|
|
71
|
+
* stub, which is an object literal — `JSObject`, and the `a plain object` fallback would be
|
|
72
|
+
* unreachable for exactly the shape it names. `tagName` first, `JSObject` treated as the
|
|
73
|
+
* absence of a GType.
|
|
84
74
|
*/
|
|
85
75
|
export declare function describeValue(value: unknown): string;
|
|
86
76
|
/** Detach only — reversible. Frameworks move nodes; `remove` must not destroy one. */
|
|
@@ -88,30 +78,25 @@ export declare function remove(node: HostNode): void;
|
|
|
88
78
|
/**
|
|
89
79
|
* Destroy every child of `parent`, bounded.
|
|
90
80
|
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* list. Unbounded, that is a hang rather than GTK's usual exit 0.
|
|
97
|
-
*
|
|
98
|
-
* This replaces a `clearContainer` that had no callers anywhere and DETACHED rather
|
|
99
|
-
* than destroyed — the wrong half for every caller that wanted it, and a name React's
|
|
100
|
-
* own HostConfig already uses for the destroying kind.
|
|
81
|
+
* Every walk over `next` goes through `childSnapshot` so the bound cannot be forgotten at a
|
|
82
|
+
* new call site, and this is the walk where the malformed link actually appears: `insert(
|
|
83
|
+
* node, parent, node)` is a defined DOM no-op, so Solid's adjacent-swap fast path emits it
|
|
84
|
+
* against a CONTAINER's child list. Unbounded, that is a hang rather than GTK's usual
|
|
85
|
+
* exit 0.
|
|
101
86
|
*/
|
|
102
87
|
export declare function destroyChildren(parent: HostElement): void;
|
|
103
88
|
/**
|
|
104
89
|
* Disconnect a node's handlers WITHOUT touching the tree.
|
|
105
90
|
*
|
|
106
|
-
* The narrow half of `destroy`, and it exists because a framework can tell us "this
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
91
|
+
* The narrow half of `destroy`, and it exists because a framework can tell us "this node is
|
|
92
|
+
* gone" while still holding its sibling links: Solid disposes a per-node scope BEFORE its
|
|
93
|
+
* reconciler runs, and `reconcileArrays` opens with `getNextSibling(last)`. Unlinking there
|
|
94
|
+
* made every trailing insertion append at the end of the parent instead of before the
|
|
95
|
+
* marker.
|
|
111
96
|
*
|
|
112
|
-
* The leak this closes is about handlers, not links — GJS blocks JS callbacks
|
|
113
|
-
*
|
|
114
|
-
*
|
|
97
|
+
* The leak this closes is about handlers, not links — GJS blocks JS callbacks during GC, so
|
|
98
|
+
* an undisconnected handler outlives its widget. The framework's own `removeNode` still
|
|
99
|
+
* does the unlinking, in its own order.
|
|
115
100
|
*/
|
|
116
101
|
export declare function disconnectHandlers(el: HostElement): void;
|
|
117
102
|
/**
|
|
@@ -128,43 +113,36 @@ export declare function destroy(node: HostNode): void;
|
|
|
128
113
|
/**
|
|
129
114
|
* Put a host tree inside an existing GTK container the application owns.
|
|
130
115
|
*
|
|
131
|
-
* The container is resolved through the SAME table as every other parent
|
|
132
|
-
* `
|
|
133
|
-
* `
|
|
134
|
-
* method name here would be the generic `add` that GTK4 deliberately removed.
|
|
116
|
+
* The container is resolved through the SAME table as every other parent, so an
|
|
117
|
+
* application's own `GObject.registerClass` subclass inherits its ancestor's policy.
|
|
118
|
+
* Guessing a method name here would be the generic `add` that GTK4 deliberately removed.
|
|
135
119
|
*/
|
|
136
120
|
export declare function mountRoot(el: HostElement, container: GObject.Object): void;
|
|
137
121
|
/**
|
|
138
122
|
* The materialised widget of a host node — for a `ref`, or for a test.
|
|
139
123
|
*
|
|
140
|
-
* ONE implementation
|
|
141
|
-
*
|
|
142
|
-
* no supported way to reach a widget at all and its only route was
|
|
143
|
-
* `materialize()`, which is exactly the call the `destroyed` guard below exists to
|
|
144
|
-
* intercept.
|
|
124
|
+
* ONE implementation, because a caller reaching `materialize()` directly is exactly what the
|
|
125
|
+
* `destroyed` guard below exists to intercept.
|
|
145
126
|
*
|
|
146
|
-
* The flag is exact and the obvious heuristic is not: `materialize` would happily
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
127
|
+
* The flag is exact and the obvious heuristic is not: `materialize` would happily build a
|
|
128
|
+
* fresh, propertyless, unparented widget for a destroyed node — `destroy` clears `props`
|
|
129
|
+
* and `layout` precisely so one cannot look re-materialisable — and "no widget, not
|
|
130
|
+
* attached, no props" also describes a brand-new element.
|
|
150
131
|
*/
|
|
151
132
|
export declare function widgetOf(node: HostNode): Gtk.Widget;
|
|
152
133
|
/**
|
|
153
134
|
* An off-screen container the host owns — the analogue of the DOM's detached `<div>`.
|
|
154
135
|
*
|
|
155
|
-
* `<KeepAlive>` and `<Suspense>` ask a renderer for one: `KeepAliveImpl.setup`
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* `
|
|
159
|
-
* `
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
* (`makeDetachedContainer`), and this op is what leaves the adapter with nothing to
|
|
166
|
-
* know: the deactivated subtree is really unparented from the visible tree and
|
|
167
|
-
* really held alive, so reactivating it moves the SAME widgets back.
|
|
136
|
+
* `<KeepAlive>` and `<Suspense>` ask a renderer for one: `KeepAliveImpl.setup` opens with
|
|
137
|
+
* `createElement("div")` and `SuspenseImpl` does the same for its `hiddenContainer`.
|
|
138
|
+
* Forwarded as a TAG, "div" reached `lookupWidget` and threw `unknown-tag` inside
|
|
139
|
+
* `callWithErrorHandling`, whose production arm is `console.error` with no rethrow:
|
|
140
|
+
* `mount()` returned normally, the container held zero children, GTK said nothing, exit 0.
|
|
141
|
+
*
|
|
142
|
+
* Which widget backs it is the table's business (`makeDetachedContainer`), and this op is
|
|
143
|
+
* what leaves the adapter with nothing to know — the widget knowledge ADR 0027 § 7 forbids.
|
|
144
|
+
* The deactivated subtree is really unparented from the visible tree and really held
|
|
145
|
+
* alive, so reactivating it moves the SAME widgets back.
|
|
168
146
|
*/
|
|
169
147
|
export declare const createDetachedContainer: () => HostElement;
|
|
170
148
|
/**
|