@girs/gd-1.0 4.3.0 → 4.5.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 CHANGED
@@ -4,82 +4,96 @@
4
4
  ![version](https://img.shields.io/npm/v/@girs/gd-1.0)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gd-1.0)
6
6
 
7
+ GJS TypeScript type definitions for Gd-1.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.5.0.
7
8
 
8
- GJS TypeScript type definitions for Gd-1.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.3.0.
9
+ This package contains type declarations only. It ships no runtime code, so it adds
10
+ nothing to your program and works with any bundler or none at all.
9
11
 
10
12
  ## Install
11
13
 
12
- Install the type definitions with npm:
13
14
  ```bash
14
15
  npm install @girs/gd-1.0
15
16
  ```
16
17
 
17
- ## Usage
18
+ Any package manager works. The package has no dependencies beyond other `@girs/*`
19
+ type packages.
20
+
21
+ ## What it exports
22
+
23
+ | Import | What you get |
24
+ |---|---|
25
+ | `@girs/gd-1.0` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/gd-1.0/ambient` | only the `gi://` module declarations |
27
+ | `@girs/gd-1.0/import` | only the `imports.gi` declarations |
28
+ | `@girs/gd-1.0/gd-1.0` | the namespace, without the side-effecting declarations |
29
+ | `@girs/gd-1.0/vocabulary` | GIR-derived widget data: settable properties, enum nicks, slot candidates |
30
+
31
+ ## Three ways to import
32
+
33
+ Which one you use depends on how you write imports elsewhere, not on your toolchain.
34
+
35
+ ### As a module
18
36
 
19
- Import it like any other module:
20
37
  ```ts
21
38
  import Gd from '@girs/gd-1.0';
22
39
  ```
23
40
 
24
- ### Ambient Modules
41
+ ### As `gi://`
25
42
 
26
- [Ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) let you write the same import you would in plain JavaScript.
27
- For this you need to include `@girs/gd-1.0` or `@girs/gd-1.0/ambient` in your `tsconfig` or entry point Typescript file:
43
+ GJS resolves `gi://` at runtime. To give it types, reference the package once, either
44
+ from your entry point or from `tsconfig.json`:
28
45
 
29
- `index.ts`:
30
46
  ```ts
31
- import '@girs/gd-1.0'
47
+ import '@girs/gd-1.0';
32
48
  ```
33
49
 
34
- `tsconfig.json`:
35
50
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/gd-1.0"],
41
- ...
42
- }
51
+ { "include": ["@girs/gd-1.0"] }
43
52
  ```
44
53
 
45
- The ambient module now resolves with types:
54
+ Then the runtime spelling type-checks:
46
55
 
47
56
  ```ts
48
57
  import Gd from 'gi://Gd?version=1.0';
49
58
  ```
50
59
 
51
- ### Global import
60
+ Referencing `@girs/gd-1.0/ambient` instead pulls in these declarations
61
+ alone. See [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules).
62
+
63
+ ### As `imports.gi`
52
64
 
53
- GJS's global `imports.gi` works too, with types.
54
- For this you need to include `@girs/gd-1.0` or `@girs/gd-1.0/import` in your `tsconfig` or entry point Typescript file:
65
+ GJS's global object works the same way, via `@girs/gd-1.0/import`:
55
66
 
56
- `index.ts`:
57
67
  ```ts
58
- import '@girs/gd-1.0'
68
+ const Gd = imports.gi.Gd;
59
69
  ```
60
70
 
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/gd-1.0"],
68
- ...
69
- }
70
- ```
71
+ ## Widget vocabulary
71
72
 
72
- That form carries types as well:
73
+ `gd-1.0` declares widgets, so it also carries what the GIR says about them, as
74
+ types and as values a test can read:
73
75
 
74
76
  ```ts
75
- const Gd = imports.gi.Gd;
77
+ import type { Widgets, PropsOf } from '@girs/gd-1.0/vocabulary';
78
+ import { OWN_PROPS, ENUM_NICKS, PROVENANCE } from '@girs/gd-1.0/vocabulary';
76
79
  ```
77
80
 
78
- ### Bundle
81
+ Properties are keyed the way GObject registered them, writable-only and optional, so they
82
+ match `g_object_set`, GtkBuilder XML and Blueprint. `PROVENANCE.libraryVersion` names the
83
+ library release this was generated from, which lets a check tell "newer than what is
84
+ installed" from "wrong".
79
85
 
80
- Most projects want a bundler. [esbuild](https://esbuild.github.io/) is the smallest thing that works; the [examples directory](https://github.com/gjsify/ts-for-gir/tree/main/examples) has setups for several others.
86
+ This subpath answers what the GIR says, not what the installed library has. For the
87
+ second question, ask the library.
88
+
89
+ ## Building
90
+
91
+ The declarations need no build step. If you bundle, every bundler works, since there is
92
+ no runtime code to resolve. The [examples](https://github.com/gjsify/ts-for-gir/tree/main/examples)
93
+ show working setups for several.
81
94
 
82
95
  ## Other packages
83
96
 
84
- All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
97
+ Every pre-generated package is at [gjsify/types](https://github.com/gjsify/types).
98
+
85
99
 
@@ -271,6 +271,23 @@ export interface Widgets {
271
271
  /** Every GType this namespace can create. A consumer derives its own tag map. */
272
272
  export type WidgetGType = keyof Widgets;
273
273
 
274
+ // ---------------------------------------------------------------------------
275
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
276
+ //
277
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
278
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
279
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
280
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
281
+ // more rows in `Widgets`: concatenate them when you mean both.
282
+ // ---------------------------------------------------------------------------
283
+
284
+ export interface ChildHolders {
285
+
286
+ }
287
+
288
+ /** Every GType this namespace holds a child in without it being a widget. */
289
+ export type ChildHolderGType = keyof ChildHolders;
290
+
274
291
  /** The writable, optional, GObject-keyed property surface of one GType. */
275
292
  export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
276
293
 
@@ -306,6 +323,9 @@ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
306
323
  /** Widget GType -> every declaration its members come from, self first. */
307
324
  export const DECLS: Readonly<Record<string, readonly string[]>>;
308
325
 
326
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
327
+ export const CHILD_HOLDERS: readonly string[];
328
+
309
329
  /** Enum GType -> the nicks this surface offers. */
310
330
  export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
311
331
 
package/gd-1.0-surface.js CHANGED
@@ -40,6 +40,12 @@ export const DECLS = {
40
40
  GdTaggedEntry: ['GdTaggedEntry', 'GtkSearchEntry', 'GtkEntry', 'GtkWidget', 'GtkBuildable', 'GtkCellEditable', 'GtkEditable'],
41
41
  };
42
42
 
43
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
44
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
45
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
46
+ // from a list — the count is in the provenance line above.
47
+ export const CHILD_HOLDERS = [];
48
+
43
49
  export const ENUM_NICKS = {};
44
50
 
45
51
  export const SLOT_CANDIDATES = {
@@ -0,0 +1,366 @@
1
+ /**
2
+ * The GIR-derived widget VOCABULARY for Gd-1.0.
3
+ *
4
+ * GENERATED — do not edit. Provenance: Gd-1.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object Atk.ImplementorIface
5
+ *
6
+ * 13 concrete widgets, 15 declarations, 0 enum nick unions, 5 slot candidates.
7
+ *
8
+ * Module-scoped exports only. There is no `JSX` namespace here, no tag spelling and
9
+ * no `on<Signal>` prop name: those are DIALECT, and every framework answers them
10
+ * differently. The shape to avoid is the GLOBAL AUGMENT — a `declare global` on
11
+ * `React.JSX` collides with every other library on a shared tag — while a
12
+ * module-scoped `JSX` behind a `jsxImportSource` does not. This package is used by
13
+ * projects that want nothing to do with JSX, so it emits neither; a consumer declaring
14
+ * a module-scoped namespace over these names is doing it right.
15
+ *
16
+ * Three things this is and `ConstructorProps` is not: WRITABLE-only (measured on
17
+ * Gtk-4.0, `ConstructorProps` offers 150 read-only properties across 68 classes as
18
+ * settable, and GTK's failure mode for writing one is exit 0), OPTIONAL, and keyed
19
+ * by the name GObject actually REGISTERED — the dashed spelling `g_object_set`,
20
+ * GtkBuilder XML and Blueprint all use.
21
+ *
22
+ * Signal handler types are not re-derived: `X.SignalSignatures`, which this package
23
+ * already emits for every class with the parent chain, every implemented interface
24
+ * and the `notify::` keys folded in, is what `Widgets[G]['signals']` points at.
25
+ */
26
+
27
+ import type Gd from './gd-1.0.js';
28
+ import type Gtk from '@girs/gtk-3.0';
29
+ import type { GtkActionableConstructOnly, GtkActionableProps, GtkActivatableConstructOnly, GtkActivatableProps, GtkBinConstructOnly, GtkBinProps, GtkBoxConstructOnly, GtkBoxProps, GtkBuildableConstructOnly, GtkBuildableProps, GtkButtonConstructOnly, GtkButtonProps, GtkCellEditableConstructOnly, GtkCellEditableProps, GtkCellLayoutConstructOnly, GtkCellLayoutProps, GtkCheckButtonConstructOnly, GtkCheckButtonProps, GtkContainerConstructOnly, GtkContainerProps, GtkEditableConstructOnly, GtkEditableProps, GtkEntryConstructOnly, GtkEntryProps, GtkIconViewConstructOnly, GtkIconViewProps, GtkMenuButtonConstructOnly, GtkMenuButtonProps, GtkOrientableConstructOnly, GtkOrientableProps, GtkOrientationNick, GtkRadioButtonConstructOnly, GtkRadioButtonProps, GtkScrollableConstructOnly, GtkScrollableProps, GtkScrolledWindowConstructOnly, GtkScrolledWindowProps, GtkSearchEntryConstructOnly, GtkSearchEntryProps, GtkToggleButtonConstructOnly, GtkToggleButtonProps, GtkToolShellConstructOnly, GtkToolShellProps, GtkToolbarConstructOnly, GtkToolbarProps, GtkTreeViewConstructOnly, GtkTreeViewProps, GtkWidgetConstructOnly, GtkWidgetProps } from '@girs/gtk-3.0/vocabulary';
30
+
31
+ // ---------------------------------------------------------------------------
32
+ // Enum nicks — the string vocabulary GObject registered, from GIR's `glib:nick`.
33
+ //
34
+ // Not derived from the member name. Substituting underscores for dashes is not a law:
35
+ // some nicks keep an underscore the substitution would have replaced, and only the
36
+ // attribute knows which. Gtk-4.0 and Adw-1 contradict no derivation at all, which is
37
+ // how a derived nick passes review and breaks elsewhere.
38
+ // Re-measure with `scripts/check-nick-derivation.mjs` in ts-for-gir.
39
+ // ---------------------------------------------------------------------------
40
+
41
+
42
+
43
+ // ---------------------------------------------------------------------------
44
+ // Property surfaces — one interface per GIR DECLARATION, mirroring GIR's own
45
+ // inheritance rather than flattening per widget.
46
+ //
47
+ // The interfaces are load-bearing, not tidiness: `GtkBox` declares four properties
48
+ // of its own and `orientation` is not among them — it lives on `Gtk.Orientable`,
49
+ // because GObject installs interface properties on the implementor at runtime while
50
+ // GIR keeps them once, on the interface.
51
+ // ---------------------------------------------------------------------------
52
+
53
+ export interface GdHeaderBarProps extends GtkContainerProps, GtkBuildableProps {
54
+ 'custom-title'?: Gtk.Widget;
55
+ hpadding?: number;
56
+ spacing?: number;
57
+ subtitle?: string;
58
+ title?: string;
59
+ vpadding?: number;
60
+ }
61
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
62
+ export type GdHeaderBarConstructOnly = GtkContainerConstructOnly | GtkBuildableConstructOnly;
63
+
64
+ export interface GdHeaderButtonProps extends GtkButtonProps {
65
+ /** The label of the #GdHeaderButton object. */
66
+ label?: string;
67
+ /** The symbolic icon name of the #GdHeaderButton object. */
68
+ 'symbolic-icon-name'?: string;
69
+ /** Whether the label of the #GdHeaderButton object should use markup. */
70
+ 'use-markup'?: boolean;
71
+ }
72
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
73
+ export type GdHeaderButtonConstructOnly = GtkButtonConstructOnly;
74
+
75
+ export interface GdHeaderMenuButtonProps extends GtkMenuButtonProps, GdHeaderButtonProps, GtkActionableProps, GtkActivatableProps, GtkBuildableProps {
76
+ }
77
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
78
+ export type GdHeaderMenuButtonConstructOnly = GtkMenuButtonConstructOnly | GdHeaderButtonConstructOnly | GtkActionableConstructOnly | GtkActivatableConstructOnly | GtkBuildableConstructOnly;
79
+
80
+ export interface GdHeaderRadioButtonProps extends GtkRadioButtonProps, GdHeaderButtonProps, GtkActionableProps, GtkActivatableProps, GtkBuildableProps {
81
+ }
82
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
83
+ export type GdHeaderRadioButtonConstructOnly = GtkRadioButtonConstructOnly | GdHeaderButtonConstructOnly | GtkActionableConstructOnly | GtkActivatableConstructOnly | GtkBuildableConstructOnly;
84
+
85
+ export interface GdHeaderSimpleButtonProps extends GtkButtonProps, GdHeaderButtonProps, GtkActionableProps, GtkActivatableProps, GtkBuildableProps {
86
+ }
87
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
88
+ export type GdHeaderSimpleButtonConstructOnly = GtkButtonConstructOnly | GdHeaderButtonConstructOnly | GtkActionableConstructOnly | GtkActivatableConstructOnly | GtkBuildableConstructOnly;
89
+
90
+ export interface GdHeaderToggleButtonProps extends GtkToggleButtonProps, GdHeaderButtonProps, GtkActionableProps, GtkActivatableProps, GtkBuildableProps {
91
+ }
92
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
93
+ export type GdHeaderToggleButtonConstructOnly = GtkToggleButtonConstructOnly | GdHeaderButtonConstructOnly | GtkActionableConstructOnly | GtkActivatableConstructOnly | GtkBuildableConstructOnly;
94
+
95
+ export interface GdMainIconViewProps extends GtkIconViewProps, GdMainViewGenericProps, GtkBuildableProps, GtkCellLayoutProps, GtkScrollableProps {
96
+ }
97
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
98
+ export type GdMainIconViewConstructOnly = GtkIconViewConstructOnly | GdMainViewGenericConstructOnly | GtkBuildableConstructOnly | GtkCellLayoutConstructOnly | GtkScrollableConstructOnly;
99
+
100
+ export interface GdMainListViewProps extends GtkTreeViewProps, GdMainViewGenericProps, GtkBuildableProps, GtkScrollableProps {
101
+ }
102
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
103
+ export type GdMainListViewConstructOnly = GtkTreeViewConstructOnly | GdMainViewGenericConstructOnly | GtkBuildableConstructOnly | GtkScrollableConstructOnly;
104
+
105
+ export interface GdMainToolbarProps extends GtkToolbarProps, GtkBuildableProps, GtkOrientableProps, GtkToolShellProps {
106
+ 'show-modes'?: boolean;
107
+ }
108
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
109
+ export type GdMainToolbarConstructOnly = GtkToolbarConstructOnly | GtkBuildableConstructOnly | GtkOrientableConstructOnly | GtkToolShellConstructOnly;
110
+
111
+ export interface GdMainViewProps extends GtkScrolledWindowProps, GtkBuildableProps {
112
+ model?: Gtk.TreeModel;
113
+ 'selection-mode'?: boolean;
114
+ 'view-type'?: number;
115
+ }
116
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
117
+ export type GdMainViewConstructOnly = GtkScrolledWindowConstructOnly | GtkBuildableConstructOnly;
118
+
119
+ export interface GdMainViewGenericProps extends GtkWidgetProps {
120
+ }
121
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
122
+ export type GdMainViewGenericConstructOnly = GtkWidgetConstructOnly;
123
+
124
+ export interface GdRevealerProps extends GtkBinProps, GtkBuildableProps {
125
+ orientation?: GtkOrientationNick | Gtk.Orientation;
126
+ 'reveal-child'?: boolean;
127
+ 'transition-duration'?: number;
128
+ }
129
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
130
+ export type GdRevealerConstructOnly = GtkBinConstructOnly | GtkBuildableConstructOnly;
131
+
132
+ export interface GdStackProps extends GtkContainerProps, GtkBuildableProps {
133
+ homogeneous?: boolean;
134
+ 'transition-duration'?: number;
135
+ 'transition-type'?: number;
136
+ 'visible-child'?: Gtk.Widget;
137
+ 'visible-child-name'?: string;
138
+ }
139
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
140
+ export type GdStackConstructOnly = GtkContainerConstructOnly | GtkBuildableConstructOnly;
141
+
142
+ export interface GdStackSwitcherProps extends GtkBoxProps, GtkBuildableProps, GtkOrientableProps {
143
+ stack?: Gd.Stack;
144
+ }
145
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
146
+ export type GdStackSwitcherConstructOnly = GtkBoxConstructOnly | GtkBuildableConstructOnly | GtkOrientableConstructOnly;
147
+
148
+ export interface GdTaggedEntryProps extends GtkSearchEntryProps, GtkBuildableProps, GtkCellEditableProps, GtkEditableProps {
149
+ 'tag-close-visible'?: boolean;
150
+ }
151
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
152
+ export type GdTaggedEntryConstructOnly = GtkSearchEntryConstructOnly | GtkBuildableConstructOnly | GtkCellEditableConstructOnly | GtkEditableConstructOnly;
153
+
154
+ // ---------------------------------------------------------------------------
155
+ // The GType-keyed widget map.
156
+ //
157
+ // Keyed by GType because that is also the GtkBuilder XML key and the typelib key. A
158
+ // consumer maps GTypes to tags in ITS convention — kebab for JSX intrinsics, Pascal
159
+ // for a Vue `GlobalComponents`, the class itself for a renderer whose element type
160
+ // is the class. None of those is baked in here.
161
+ //
162
+ // `slotCandidates` is a candidate list and never an answer: derived from methods
163
+ // taking exactly one widget argument. The GIR cannot tell adoption from reference —
164
+ // `set_title_widget` parents its argument and `set_activatable_widget` does not, and
165
+ // both are `void f(GtkWidget*)` at `transfer-ownership="none"`. Curation decides;
166
+ // this is what notices when a release adds a candidate.
167
+ // ---------------------------------------------------------------------------
168
+
169
+ export interface Widgets {
170
+ GdHeaderBar: {
171
+ class: Gd.HeaderBar;
172
+ props: GdHeaderBarProps;
173
+ signals: Gd.HeaderBar.SignalSignatures;
174
+ constructOnly: GdHeaderBarConstructOnly;
175
+ slotCandidates: {
176
+ 'custom-title': 'set_custom_title';
177
+ 'end': 'pack_end';
178
+ 'start': 'pack_start';
179
+ };
180
+ };
181
+ GdHeaderMenuButton: {
182
+ class: Gd.HeaderMenuButton;
183
+ props: GdHeaderMenuButtonProps;
184
+ signals: Gd.HeaderMenuButton.SignalSignatures;
185
+ constructOnly: GdHeaderMenuButtonConstructOnly;
186
+ slotCandidates: {};
187
+ };
188
+ GdHeaderRadioButton: {
189
+ class: Gd.HeaderRadioButton;
190
+ props: GdHeaderRadioButtonProps;
191
+ signals: Gd.HeaderRadioButton.SignalSignatures;
192
+ constructOnly: GdHeaderRadioButtonConstructOnly;
193
+ slotCandidates: {};
194
+ };
195
+ GdHeaderSimpleButton: {
196
+ class: Gd.HeaderSimpleButton;
197
+ props: GdHeaderSimpleButtonProps;
198
+ signals: Gd.HeaderSimpleButton.SignalSignatures;
199
+ constructOnly: GdHeaderSimpleButtonConstructOnly;
200
+ slotCandidates: {};
201
+ };
202
+ GdHeaderToggleButton: {
203
+ class: Gd.HeaderToggleButton;
204
+ props: GdHeaderToggleButtonProps;
205
+ signals: Gd.HeaderToggleButton.SignalSignatures;
206
+ constructOnly: GdHeaderToggleButtonConstructOnly;
207
+ slotCandidates: {};
208
+ };
209
+ GdMainIconView: {
210
+ class: Gd.MainIconView;
211
+ props: GdMainIconViewProps;
212
+ signals: Gd.MainIconView.SignalSignatures;
213
+ constructOnly: GdMainIconViewConstructOnly;
214
+ slotCandidates: {};
215
+ };
216
+ GdMainListView: {
217
+ class: Gd.MainListView;
218
+ props: GdMainListViewProps;
219
+ signals: Gd.MainListView.SignalSignatures;
220
+ constructOnly: GdMainListViewConstructOnly;
221
+ slotCandidates: {};
222
+ };
223
+ GdMainToolbar: {
224
+ class: Gd.MainToolbar;
225
+ props: GdMainToolbarProps;
226
+ signals: Gd.MainToolbar.SignalSignatures;
227
+ constructOnly: GdMainToolbarConstructOnly;
228
+ slotCandidates: {};
229
+ };
230
+ GdMainView: {
231
+ class: Gd.MainView;
232
+ props: GdMainViewProps;
233
+ signals: Gd.MainView.SignalSignatures;
234
+ constructOnly: GdMainViewConstructOnly;
235
+ slotCandidates: {};
236
+ };
237
+ GdRevealer: {
238
+ class: Gd.Revealer;
239
+ props: GdRevealerProps;
240
+ signals: Gd.Revealer.SignalSignatures;
241
+ constructOnly: GdRevealerConstructOnly;
242
+ slotCandidates: {};
243
+ };
244
+ GdStack: {
245
+ class: Gd.Stack;
246
+ props: GdStackProps;
247
+ signals: Gd.Stack.SignalSignatures;
248
+ constructOnly: GdStackConstructOnly;
249
+ slotCandidates: {
250
+ 'visible-child': 'set_visible_child';
251
+ };
252
+ };
253
+ GdStackSwitcher: {
254
+ class: Gd.StackSwitcher;
255
+ props: GdStackSwitcherProps;
256
+ signals: Gd.StackSwitcher.SignalSignatures;
257
+ constructOnly: GdStackSwitcherConstructOnly;
258
+ slotCandidates: {
259
+ 'stack': 'set_stack';
260
+ };
261
+ };
262
+ GdTaggedEntry: {
263
+ class: Gd.TaggedEntry;
264
+ props: GdTaggedEntryProps;
265
+ signals: Gd.TaggedEntry.SignalSignatures;
266
+ constructOnly: GdTaggedEntryConstructOnly;
267
+ slotCandidates: {};
268
+ };
269
+ }
270
+
271
+ /** Every GType this namespace can create. A consumer derives its own tag map. */
272
+ export type WidgetGType = keyof Widgets;
273
+
274
+ // ---------------------------------------------------------------------------
275
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
276
+ //
277
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
278
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
279
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
280
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
281
+ // more rows in `Widgets`: concatenate them when you mean both.
282
+ // ---------------------------------------------------------------------------
283
+
284
+ export interface ChildHolders {
285
+
286
+ }
287
+
288
+ /** Every GType this namespace holds a child in without it being a widget. */
289
+ export type ChildHolderGType = keyof ChildHolders;
290
+
291
+ /** The writable, optional, GObject-keyed property surface of one GType. */
292
+ export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
293
+
294
+ /** The signal table this package already emits, reached by GType. */
295
+ export type SignalsOf<G extends WidgetGType> = Widgets[G]['signals'];
296
+
297
+ /** The instance type — what a `ref`-shaped prop should infer. */
298
+ export type InstanceOf<G extends WidgetGType> = Widgets[G]['class'];
299
+
300
+ /** Property names that can only be set at construction. */
301
+ export type ConstructOnlyOf<G extends WidgetGType> = Widgets[G]['constructOnly'];
302
+
303
+ /** Candidate child slots — see the note above; curation decides. */
304
+ export type SlotCandidatesOf<G extends WidgetGType> = keyof Widgets[G]['slotCandidates'];
305
+
306
+ /**
307
+ * The same facts as runtime data, for a consumer that CHECKS them.
308
+ *
309
+ * Types are erased, so a spec that asks the installed GTK whether every property
310
+ * here is a writable ParamSpec, every signal resolvable by `GObject.signal_lookup`
311
+ * and every nick resolvable through an enum lookup cannot read the interfaces
312
+ * above. Emitted headlessly with no GTK present, which is exactly why the checking
313
+ * belongs to the consumer and the DATA belongs here.
314
+ */
315
+ export const PROVENANCE: {
316
+ readonly namespace: string;
317
+ readonly version: string;
318
+ /** The version the LIBRARY states, or null where it states none. Never the namespace's. */
319
+ readonly libraryVersion: string | null;
320
+ readonly childHolders: number;
321
+ readonly droppedBases: readonly string[];
322
+ readonly inlinedBases: readonly string[];
323
+ readonly unsettableProps: readonly string[];
324
+ };
325
+
326
+ /** Declaration GType -> its own settable properties, as GObject registered them. */
327
+ export const OWN_PROPS: Readonly<Record<string, readonly string[]>>;
328
+
329
+ /**
330
+ * Declaration GType -> the signals it registers itself, never its parents'.
331
+ *
332
+ * Keyed like `OWN_PROPS`, so both are read at every link of a `DECLS` chain. An
333
+ * abstract base has no `Widgets` row and still owns signals — `GtkWidget` owns 13.
334
+ */
335
+ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
336
+
337
+ /** Widget GType -> every declaration its members come from, self first. */
338
+ export const DECLS: Readonly<Record<string, readonly string[]>>;
339
+
340
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
341
+ export const CHILD_HOLDERS: readonly string[];
342
+
343
+ /** Enum GType -> the nicks this surface offers. */
344
+ export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
345
+
346
+ /** Widget GType -> slot name -> the method that may adopt a child there. */
347
+ export const SLOT_CANDIDATES: Readonly<Record<string, Readonly<Record<string, string>>>>;
348
+
349
+ /**
350
+ * `Type`, `Type.property` and `Type::signal` -> the release that introduced it.
351
+ *
352
+ * What keeps a runtime cross-check honest across a version gap without an
353
+ * allowlist: a name the installed library lacks is a defect UNLESS the version
354
+ * here is newer than the one running.
355
+ *
356
+ * ALL THREE key shapes, because that test only works for the names it covers. A
357
+ * property-only map leaves a consumer no way to explain a missing SIGNAL, which is
358
+ * a correct vocabulary reported as 18 defects; a member-only map leaves it no way to
359
+ * explain a missing CLASS, and that one fails as a bare
360
+ * `TypeError: can't access property "$gtype", ctor() is undefined` that does not
361
+ * even name the GType.
362
+ *
363
+ * A key is present only where the GIR states a version — sparse by nature (`version`
364
+ * sits on 29 of the 301 classes and interfaces in Gtk-4.0), never inferred.
365
+ */
366
+ export const SINCE: Readonly<Record<string, string>>;
@@ -0,0 +1,73 @@
1
+ // The widget vocabulary of Gd-1.0 as runtime data.
2
+ //
3
+ // GENERATED — do not edit. Provenance: Gd-1.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object Atk.ImplementorIface
4
+ //
5
+ // The type half of this subpath is the sibling `.d.ts`. This file exists because
6
+ // types are erased: a consumer that wants to ask the installed library whether every
7
+ // name here is real needs values, not declarations.
8
+
9
+ export const PROVENANCE = {
10
+ namespace: 'Gd',
11
+ version: '1.0',
12
+ libraryVersion: null,
13
+ childHolders: 0,
14
+ droppedBases: ['GObject.InitiallyUnowned', 'GObject.Object', 'Atk.ImplementorIface'],
15
+ inlinedBases: [],
16
+ unsettableProps: [],
17
+ };
18
+
19
+ export const OWN_PROPS = {
20
+ GdHeaderBar: ['custom-title', 'hpadding', 'spacing', 'subtitle', 'title', 'vpadding'],
21
+ GdHeaderButton: ['label', 'symbolic-icon-name', 'use-markup'],
22
+ GdMainToolbar: ['show-modes'],
23
+ GdMainView: ['model', 'selection-mode', 'view-type'],
24
+ GdRevealer: ['orientation', 'reveal-child', 'transition-duration'],
25
+ GdStack: ['homogeneous', 'transition-duration', 'transition-type', 'visible-child', 'visible-child-name'],
26
+ GdStackSwitcher: ['stack'],
27
+ GdTaggedEntry: ['tag-close-visible'],
28
+ };
29
+
30
+ export const OWN_SIGNALS = {
31
+ GdMainView: ['item-activated', 'selection-mode-request', 'view-selection-changed'],
32
+ GdTaggedEntry: ['tag-button-clicked', 'tag-clicked'],
33
+ };
34
+
35
+ export const DECLS = {
36
+ GdHeaderBar: ['GdHeaderBar', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
37
+ GdHeaderMenuButton: ['GdHeaderMenuButton', 'GtkMenuButton', 'GtkToggleButton', 'GtkButton', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GdHeaderButton', 'GtkActionable', 'GtkActivatable', 'GtkBuildable'],
38
+ GdHeaderRadioButton: ['GdHeaderRadioButton', 'GtkRadioButton', 'GtkCheckButton', 'GtkToggleButton', 'GtkButton', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GdHeaderButton', 'GtkActionable', 'GtkActivatable', 'GtkBuildable'],
39
+ GdHeaderSimpleButton: ['GdHeaderSimpleButton', 'GtkButton', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GdHeaderButton', 'GtkActionable', 'GtkActivatable', 'GtkBuildable'],
40
+ GdHeaderToggleButton: ['GdHeaderToggleButton', 'GtkToggleButton', 'GtkButton', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GdHeaderButton', 'GtkActionable', 'GtkActivatable', 'GtkBuildable'],
41
+ GdMainIconView: ['GdMainIconView', 'GtkIconView', 'GtkContainer', 'GtkWidget', 'GdMainViewGeneric', 'GtkBuildable', 'GtkCellLayout', 'GtkScrollable'],
42
+ GdMainListView: ['GdMainListView', 'GtkTreeView', 'GtkContainer', 'GtkWidget', 'GdMainViewGeneric', 'GtkBuildable', 'GtkScrollable'],
43
+ GdMainToolbar: ['GdMainToolbar', 'GtkToolbar', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkOrientable', 'GtkToolShell'],
44
+ GdMainView: ['GdMainView', 'GtkScrolledWindow', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
45
+ GdRevealer: ['GdRevealer', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
46
+ GdStack: ['GdStack', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
47
+ GdStackSwitcher: ['GdStackSwitcher', 'GtkBox', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkOrientable'],
48
+ GdTaggedEntry: ['GdTaggedEntry', 'GtkSearchEntry', 'GtkEntry', 'GtkWidget', 'GtkBuildable', 'GtkCellEditable', 'GtkEditable'],
49
+ };
50
+
51
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
52
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
53
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
54
+ // from a list — the count is in the provenance line above.
55
+ export const CHILD_HOLDERS = [];
56
+
57
+ export const ENUM_NICKS = {};
58
+
59
+ export const SLOT_CANDIDATES = {
60
+ GdHeaderBar: {
61
+ 'custom-title': 'set_custom_title',
62
+ 'end': 'pack_end',
63
+ 'start': 'pack_start',
64
+ },
65
+ GdStack: {
66
+ 'visible-child': 'set_visible_child',
67
+ },
68
+ GdStackSwitcher: {
69
+ 'stack': 'set_stack',
70
+ },
71
+ };
72
+
73
+ export const SINCE = {};