@gjsify/gtk-host 0.41.0 → 0.43.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/README.md +454 -6
- package/lib/esm/adapters/react.js +1 -0
- package/lib/esm/adapters/solid.js +1 -0
- package/lib/esm/adapters/vue.js +1 -0
- package/lib/esm/attrs.js +0 -0
- package/lib/esm/conformance/diagnostics.js +2 -2
- package/lib/esm/conformance/index.js +2 -2
- package/lib/esm/descriptors/index.js +1 -1
- package/lib/esm/errors.js +1 -1
- package/lib/esm/generated/props.js +0 -0
- package/lib/esm/generated/widgets.js +1 -0
- package/lib/esm/host.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/jsx-runtime.js +1 -0
- package/lib/esm/policies.js +1 -1
- package/lib/esm/probe.js +1 -0
- package/lib/esm/props.js +1 -1
- package/lib/esm/react-jsx-runtime.js +1 -0
- package/lib/esm/registry.js +1 -1
- package/lib/esm/signals.js +1 -1
- package/lib/esm/tags.js +2 -0
- package/lib/esm/vue-components.js +0 -0
- package/lib/types/adapters/react.d.ts +175 -0
- package/lib/types/adapters/react.spec.d.ts +2 -0
- package/lib/types/adapters/solid.d.ts +78 -0
- package/lib/types/adapters/solid.spec.d.ts +2 -0
- package/lib/types/adapters/vue.d.ts +24 -0
- package/lib/types/adapters/vue.spec.d.ts +2 -0
- package/lib/types/attrs.d.ts +102 -0
- package/lib/types/buildable.spec.d.ts +2 -0
- package/lib/types/conformance/diagnostics.d.ts +14 -0
- package/lib/types/conformance/index.d.ts +24 -1
- package/lib/types/conformance/vectors.d.mts +34 -0
- package/lib/types/descriptors/index.d.ts +52 -1
- package/lib/types/errors.d.ts +21 -0
- package/lib/types/generated/props.d.ts +5505 -0
- package/lib/types/generated/surface-data.d.mts +22 -0
- package/lib/types/generated/widgets.d.ts +3 -0
- package/lib/types/generated.spec.d.ts +4 -0
- package/lib/types/generator/emit-types.d.mts +54 -0
- package/lib/types/generator/emit.d.mts +50 -0
- package/lib/types/generator/gir.d.mts +156 -0
- package/lib/types/generator/main.d.mts +23 -0
- package/lib/types/generator/mini.fixture.d.mts +30 -0
- package/lib/types/generator/surface.d.mts +62 -0
- package/lib/types/generator/tsmap.d.mts +73 -0
- package/lib/types/generator.spec.d.ts +2 -0
- package/lib/types/host.d.ts +102 -1
- package/lib/types/index.d.ts +6 -3
- package/lib/types/jsx-runtime.d.ts +70 -0
- package/lib/types/policies.d.ts +58 -0
- package/lib/types/probe.d.ts +58 -0
- package/lib/types/props.d.ts +49 -2
- package/lib/types/react-jsx-runtime.d.ts +108 -0
- package/lib/types/registry.d.ts +1 -1
- package/lib/types/signals.d.ts +16 -1
- package/lib/types/tags.d.ts +25 -0
- package/lib/types/testing/gate.d.mts +2 -0
- package/lib/types/types.d.ts +56 -3
- package/lib/types/vue-components.d.ts +46 -0
- package/package.json +77 -7
|
@@ -1,5 +1,56 @@
|
|
|
1
|
+
import type { GeneratedWidget, WidgetDescriptor } from '../types.js';
|
|
1
2
|
export { GTK_DESCRIPTORS } from './gtk.js';
|
|
2
3
|
export { ADW_DESCRIPTORS } from './adw.js';
|
|
3
|
-
export
|
|
4
|
+
export { GENERATED_PROVENANCE, GENERATED_WIDGETS } from '../generated/widgets.js';
|
|
5
|
+
/**
|
|
6
|
+
* The hand-measured table: every widget whose PLACEMENT RULE is known.
|
|
7
|
+
*
|
|
8
|
+
* Kept separate from `BUILTIN_DESCRIPTORS` because the generator's gates take it
|
|
9
|
+
* as their input. Merging first and then checking would make G1 ("every curated
|
|
10
|
+
* gtype is in the GIR") and G3 ("every method a policy names exists") trivially
|
|
11
|
+
* true — the generated rows come from the GIR by construction and name no method,
|
|
12
|
+
* so a gate fed the merged table would pass while checking nothing.
|
|
13
|
+
*/
|
|
14
|
+
export declare const CURATED_DESCRIPTORS: readonly WidgetDescriptor[];
|
|
15
|
+
/**
|
|
16
|
+
* Construct-only properties a GType ABORTS the process without.
|
|
17
|
+
*
|
|
18
|
+
* Not an exception: `adw_layout_slot_constructed` calls `g_error()`, which is
|
|
19
|
+
* fatal by contract — no catch, no diagnostic, SIGABRT and a core dump. A table
|
|
20
|
+
* that merely LISTS such a tag hands a renderer a way to kill the process, and
|
|
21
|
+
* `descriptorProblems()` cannot see it because it never instantiates anything.
|
|
22
|
+
*
|
|
23
|
+
* MEASURED bare-constructing all 164 generated rows on gjs 1.88.1 / GTK 4.22.4 /
|
|
24
|
+
* Adw 1.10, resuming past each abort: **163 construct, one does not**, and not a
|
|
25
|
+
* single row throws. So this map is one entry rather than a policy — and
|
|
26
|
+
* `constructsEveryDescriptor` in `generated.spec.ts` is what keeps it one entry.
|
|
27
|
+
*
|
|
28
|
+
* CURATED, like every other placement fact: the GIR says `id` is construct-only
|
|
29
|
+
* and nullable, which is exactly what it says about properties that construct
|
|
30
|
+
* fine. Only running it tells them apart (ADR 0028 § 1).
|
|
31
|
+
*/
|
|
32
|
+
export declare const REQUIRED_CONSTRUCT_PROPS: Readonly<Record<string, readonly string[]>>;
|
|
33
|
+
export declare function mergeGenerated(curated: readonly WidgetDescriptor[], generated: readonly GeneratedWidget[]): WidgetDescriptor[];
|
|
34
|
+
/**
|
|
35
|
+
* Curated placement rules, plus a tag for every other widget in the GIR.
|
|
36
|
+
*
|
|
37
|
+
* The direction is one-way and enforced by shape rather than by review: a
|
|
38
|
+
* `GeneratedWidget` carries no `children`, no `textSink` and no `eventAliases`, so
|
|
39
|
+
* the generator CANNOT contradict a curated descriptor — it can only add a gtype
|
|
40
|
+
* that was not there. A generated-only row gets `children: { kind: 'uncurated' }`,
|
|
41
|
+
* which means the widget can be created, given properties and given handlers,
|
|
42
|
+
* while inserting a child into it raises an error naming the tag that needs a
|
|
43
|
+
* curated policy. Guessing an adder is the one thing not on offer: `add`, `append`
|
|
44
|
+
* and `set_child` all exist somewhere in GTK, and calling the wrong one is a
|
|
45
|
+
* warning at exit 0.
|
|
46
|
+
*/
|
|
47
|
+
export declare const BUILTIN_DESCRIPTORS: readonly WidgetDescriptor[];
|
|
4
48
|
/** Install the built-in table. Idempotent — registration is keyed on the GType name. */
|
|
5
49
|
export declare function registerBuiltinWidgets(): void;
|
|
50
|
+
/** What the shipped table is made of, for a diagnostic or an about box. */
|
|
51
|
+
export declare const tableProvenance: () => {
|
|
52
|
+
gir: "Gtk-4.0 Adw-1";
|
|
53
|
+
curated: number;
|
|
54
|
+
generated: number;
|
|
55
|
+
total: number;
|
|
56
|
+
};
|
package/lib/types/errors.d.ts
CHANGED
|
@@ -16,11 +16,26 @@ export declare class GtkHostError extends Error {
|
|
|
16
16
|
}
|
|
17
17
|
export declare const err: {
|
|
18
18
|
unknownTag: (tag: string) => GtkHostError;
|
|
19
|
+
missingConstructProp: (tag: string, prop: string) => GtkHostError;
|
|
19
20
|
unknownProp: (tag: string, prop: string) => GtkHostError;
|
|
20
21
|
readOnlyProp: (tag: string, prop: string) => GtkHostError;
|
|
21
22
|
badEnum: (tag: string, prop: string, nick: string, gtypeName: string) => GtkHostError;
|
|
22
23
|
unknownSignal: (tag: string, prop: string, signal: string) => GtkHostError;
|
|
23
24
|
signalTaken: (tag: string, prop: string, other: string, signal: string) => GtkHostError;
|
|
25
|
+
/**
|
|
26
|
+
* A DOM event-phase modifier has no GObject translation, so it is named, not guessed.
|
|
27
|
+
*
|
|
28
|
+
* `capture` selects a phase of DOM tree propagation and a GObject signal does not
|
|
29
|
+
* propagate through a tree at all — it is emitted on ONE object. `passive` is a
|
|
30
|
+
* promise not to call `preventDefault`, which no GObject signal has. Kebabing
|
|
31
|
+
* either into the signal name produced `emits no signal "clicked-capture"`, i.e.
|
|
32
|
+
* this host blaming the user's spelling for a concept it simply does not carry.
|
|
33
|
+
*
|
|
34
|
+
* It lived in `signals.ts` as a bare `new GtkHostError` for its whole life, which
|
|
35
|
+
* made this file's claim to BE the list false: the code existed, and the only
|
|
36
|
+
* place that enumerates the codes did not know it.
|
|
37
|
+
*/
|
|
38
|
+
eventModifier: (prop: string, modifier: string) => GtkHostError;
|
|
24
39
|
badString: (tag: string, prop: string, got: string) => GtkHostError;
|
|
25
40
|
badBoolean: (tag: string, prop: string, value: string) => GtkHostError;
|
|
26
41
|
badFlags: (tag: string, prop: string, value: string, gtypeName: string) => GtkHostError;
|
|
@@ -29,5 +44,11 @@ export declare const err: {
|
|
|
29
44
|
unclaimedChild: (parentTag: string, childTag: string) => GtkHostError;
|
|
30
45
|
unknownSlot: (parentTag: string, slot: string, known: string[]) => GtkHostError;
|
|
31
46
|
rejectedChild: (parentTag: string, childTag: string, reason: string) => GtkHostError;
|
|
47
|
+
uncuratedPlacement: (parentTag: string, childTag: string) => GtkHostError;
|
|
48
|
+
siblingCycle: (parentTag: string) => GtkHostError;
|
|
32
49
|
notAWidget: (tag: string) => GtkHostError;
|
|
50
|
+
occupiedSlot: (parentTag: string, childTag: string, setter: string) => GtkHostError;
|
|
51
|
+
notAnElement: (kind: string) => GtkHostError;
|
|
52
|
+
destroyedNode: (tag: string) => GtkHostError;
|
|
53
|
+
notAHostParent: (got: string) => GtkHostError;
|
|
33
54
|
};
|