@girs/cvc-1.0 5.1.0 → 5.3.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,7 +4,7 @@
4
4
  ![version](https://img.shields.io/npm/v/@girs/cvc-1.0)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/cvc-1.0)
6
6
 
7
- GJS TypeScript type definitions for Cvc-1.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v5.1.0.
7
+ GJS TypeScript type definitions for Cvc-1.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v5.3.0.
8
8
 
9
9
  This package contains type declarations only. It ships no runtime code, so it adds
10
10
  nothing to your program and works with any bundler or none at all.
@@ -26,6 +26,7 @@ type packages.
26
26
  | `@girs/cvc-1.0/ambient` | only the `gi://` module declarations |
27
27
  | `@girs/cvc-1.0/import` | only the `imports.gi` declarations |
28
28
  | `@girs/cvc-1.0/cvc-1.0` | the namespace, without the side-effecting declarations |
29
+ | `@girs/cvc-1.0/vocabulary` | GIR-derived widget data: settable properties, enum nicks, slot candidates |
29
30
 
30
31
  ## Three ways to import
31
32
 
@@ -67,6 +68,24 @@ GJS's global object works the same way, via `@girs/cvc-1.0/import`:
67
68
  const Cvc = imports.gi.Cvc;
68
69
  ```
69
70
 
71
+ ## Widget vocabulary
72
+
73
+ `cvc-1.0` declares widgets, so it also carries what the GIR says about them, as
74
+ types and as values a test can read:
75
+
76
+ ```ts
77
+ import type { Widgets, PropsOf } from '@girs/cvc-1.0/vocabulary';
78
+ import { OWN_PROPS, ENUM_NICKS, PROVENANCE } from '@girs/cvc-1.0/vocabulary';
79
+ ```
80
+
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".
85
+
86
+ This subpath answers what the GIR says, not what the installed library has. For the
87
+ second question, ask the library.
88
+
70
89
  ## Building
71
90
 
72
91
  The declarations need no build step. If you bundle, every bundler works, since there is
@@ -0,0 +1,445 @@
1
+ /**
2
+ * The GIR-derived widget VOCABULARY for Cvc-1.0.
3
+ *
4
+ * GENERATED — do not edit. Provenance: Cvc-1.0 — prop(s) no TypeScript value satisfies: Cvc.MixerCard.pa-context Cvc.MixerStream.pa-context Cvc.MixerUIDevice.card
5
+ *
6
+ * 9 instantiable GTypes (of which 0 concrete widgets), 10 declarations, 3 enum nick unions, 0 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 Cvc from './cvc-1.0.js';
28
+ import type { GObjectConstructOnly, GObjectProps } from '@girs/gobject-2.0/vocabulary';
29
+
30
+ // ---------------------------------------------------------------------------
31
+ // Enum nicks — the string vocabulary GObject registered, from GIR's `glib:nick`.
32
+ //
33
+ // Not derived from the member name. Substituting underscores for dashes is not a law:
34
+ // some nicks keep an underscore the substitution would have replaced, and only the
35
+ // attribute knows which. Gtk-4.0 and Adw-1 contradict no derivation at all, which is
36
+ // how a derived nick passes review and breaks elsewhere.
37
+ // Re-measure with `scripts/check-nick-derivation.mjs` in ts-for-gir.
38
+ // ---------------------------------------------------------------------------
39
+
40
+ export type GvcMixerControlStateNick = 'closed' | 'ready' | 'connecting' | 'failed';
41
+ export type GvcMixerStreamStateNick = 'invalid' | 'running' | 'idle' | 'suspended';
42
+ export type GvcMixerUIDeviceDirectionNick = 'input' | 'output';
43
+
44
+ // ---------------------------------------------------------------------------
45
+ // Property surfaces — one interface per GIR DECLARATION, mirroring GIR's own
46
+ // inheritance rather than flattening per widget.
47
+ //
48
+ // The interfaces are load-bearing, not tidiness: `GtkBox` declares four properties
49
+ // of its own and `orientation` is not among them — it lives on `Gtk.Orientable`,
50
+ // because GObject installs interface properties on the implementor at runtime while
51
+ // GIR keeps them once, on the interface.
52
+ // ---------------------------------------------------------------------------
53
+
54
+ export interface GvcChannelMapProps extends GObjectProps {
55
+ }
56
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
57
+ export type GvcChannelMapConstructOnly = GObjectConstructOnly;
58
+
59
+ export interface GvcMixerCardProps extends GObjectProps {
60
+ /** @default NULL */
61
+ 'icon-name'?: string;
62
+ /** @default 0 */
63
+ id?: bigint | number;
64
+ /** @default 0 */
65
+ index?: bigint | number;
66
+ /** @default NULL */
67
+ name?: string;
68
+ 'pa-context'?: never;
69
+ /** @default NULL */
70
+ profile?: string;
71
+ }
72
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
73
+ export type GvcMixerCardConstructOnly = GObjectConstructOnly | 'id' | 'index' | 'pa-context';
74
+
75
+ export interface GvcMixerControlProps extends GObjectProps {
76
+ /** @default NULL */
77
+ name?: string;
78
+ }
79
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
80
+ export type GvcMixerControlConstructOnly = GObjectConstructOnly | 'name';
81
+
82
+ export interface GvcMixerEventRoleProps extends GvcMixerStreamProps {
83
+ /** @default NULL */
84
+ device?: string;
85
+ }
86
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
87
+ export type GvcMixerEventRoleConstructOnly = GvcMixerStreamConstructOnly;
88
+
89
+ export interface GvcMixerSinkProps extends GvcMixerStreamProps {
90
+ }
91
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
92
+ export type GvcMixerSinkConstructOnly = GvcMixerStreamConstructOnly;
93
+
94
+ export interface GvcMixerSinkInputProps extends GvcMixerStreamProps {
95
+ }
96
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
97
+ export type GvcMixerSinkInputConstructOnly = GvcMixerStreamConstructOnly;
98
+
99
+ export interface GvcMixerSourceProps extends GvcMixerStreamProps {
100
+ }
101
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
102
+ export type GvcMixerSourceConstructOnly = GvcMixerStreamConstructOnly;
103
+
104
+ export interface GvcMixerSourceOutputProps extends GvcMixerStreamProps {
105
+ }
106
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
107
+ export type GvcMixerSourceOutputConstructOnly = GvcMixerStreamConstructOnly;
108
+
109
+ export interface GvcMixerStreamProps extends GObjectProps {
110
+ /** @default NULL */
111
+ 'application-id'?: string;
112
+ /** @default FALSE */
113
+ 'can-decibel'?: boolean;
114
+ /** @default 4294967295 */
115
+ 'card-index'?: bigint | number;
116
+ 'channel-map'?: Cvc.ChannelMap;
117
+ /** @default 0.000000 */
118
+ decibel?: number;
119
+ /** @default NULL */
120
+ description?: string;
121
+ /** @default NULL */
122
+ 'form-factor'?: string;
123
+ /** @default NULL */
124
+ 'icon-name'?: string;
125
+ /** @default 0 */
126
+ id?: bigint | number;
127
+ /** @default 0 */
128
+ index?: bigint | number;
129
+ /** @default FALSE */
130
+ 'is-event-stream'?: boolean;
131
+ /** @default FALSE */
132
+ 'is-muted'?: boolean;
133
+ /** @default FALSE */
134
+ 'is-virtual'?: boolean;
135
+ /** @default NULL */
136
+ name?: string;
137
+ 'pa-context'?: never;
138
+ /** @default NULL */
139
+ port?: string;
140
+ /** @default GVC_STREAM_STATE_INVALID */
141
+ state?: GvcMixerStreamStateNick | Cvc.MixerStreamState;
142
+ /** @default NULL */
143
+ 'sysfs-path'?: string;
144
+ /** @default 0 */
145
+ volume?: bigint | number;
146
+ }
147
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
148
+ export type GvcMixerStreamConstructOnly = GObjectConstructOnly | 'id' | 'index' | 'pa-context';
149
+
150
+ export interface GvcMixerUIDeviceProps extends GObjectProps {
151
+ card?: never;
152
+ /** @default no-name-set */
153
+ description?: string;
154
+ /** @default NULL */
155
+ 'icon-name'?: string;
156
+ /** @default no-name-set */
157
+ origin?: string;
158
+ /** @default FALSE */
159
+ 'port-available'?: boolean;
160
+ /** @default NULL */
161
+ 'port-name'?: string;
162
+ /** @default 0 */
163
+ 'stream-id'?: number;
164
+ /** @default 0 */
165
+ type?: number;
166
+ }
167
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
168
+ export type GvcMixerUIDeviceConstructOnly = GObjectConstructOnly;
169
+
170
+ // ---------------------------------------------------------------------------
171
+ // The GType-keyed widget map.
172
+ //
173
+ // Keyed by GType because that is also the GtkBuilder XML key and the typelib key. A
174
+ // consumer maps GTypes to tags in ITS convention — kebab for JSX intrinsics, Pascal
175
+ // for a Vue `GlobalComponents`, the class itself for a renderer whose element type
176
+ // is the class. None of those is baked in here.
177
+ //
178
+ // `slotCandidates` is a candidate list and never an answer: derived from methods
179
+ // taking exactly one widget argument. The GIR cannot tell adoption from reference —
180
+ // `set_title_widget` parents its argument and `set_activatable_widget` does not, and
181
+ // both are `void f(GtkWidget*)` at `transfer-ownership="none"`. Curation decides;
182
+ // this is what notices when a release adds a candidate.
183
+ // ---------------------------------------------------------------------------
184
+
185
+ export interface Widgets {
186
+
187
+ }
188
+
189
+ /**
190
+ * Every GType this namespace can create AND put on screen. A consumer derives its own
191
+ * tag map. For everything a UI file can instantiate — layout managers, event
192
+ * controllers, cell renderers, `GtkSizeGroup` — read `DECLS` below.
193
+ */
194
+ export type WidgetGType = keyof Widgets;
195
+
196
+ // ---------------------------------------------------------------------------
197
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
198
+ //
199
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
200
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
201
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
202
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
203
+ // more rows in `Widgets`: concatenate them when you mean both.
204
+ // ---------------------------------------------------------------------------
205
+
206
+ export interface ChildHolders {
207
+
208
+ }
209
+
210
+ /** Every GType this namespace holds a child in without it being a widget. */
211
+ export type ChildHolderGType = keyof ChildHolders;
212
+
213
+ /** The writable, optional, GObject-keyed property surface of one GType. */
214
+ export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
215
+
216
+ /** The signal table this package already emits, reached by GType. */
217
+ export type SignalsOf<G extends WidgetGType> = Widgets[G]['signals'];
218
+
219
+ /** The instance type — what a `ref`-shaped prop should infer. */
220
+ export type InstanceOf<G extends WidgetGType> = Widgets[G]['class'];
221
+
222
+ /** Property names that can only be set at construction. */
223
+ export type ConstructOnlyOf<G extends WidgetGType> = Widgets[G]['constructOnly'];
224
+
225
+ /** Candidate child slots — see the note above; curation decides. */
226
+ export type SlotCandidatesOf<G extends WidgetGType> = keyof Widgets[G]['slotCandidates'];
227
+
228
+ /**
229
+ * The same facts as runtime data, for a consumer that CHECKS them.
230
+ *
231
+ * Types are erased, so a spec that asks the installed GTK whether every property
232
+ * here is a writable ParamSpec, every signal resolvable by `GObject.signal_lookup`
233
+ * and every nick resolvable through an enum lookup cannot read the interfaces
234
+ * above. Emitted headlessly with no GTK present, which is exactly why the checking
235
+ * belongs to the consumer and the DATA belongs here.
236
+ */
237
+ export const PROVENANCE: {
238
+ readonly namespace: string;
239
+ readonly version: string;
240
+ /** The version the LIBRARY states, or null where it states none. Never the namespace's. */
241
+ readonly libraryVersion: string | null;
242
+ readonly childHolders: number;
243
+ readonly droppedBases: readonly string[];
244
+ readonly inlinedBases: readonly string[];
245
+ /** `<decl>.<prop>` for every property printed `never` because TypeScript has no value for it. */
246
+ readonly unsettableProps: readonly string[];
247
+ /**
248
+ * `<decl>.<prop>: <Ns>.<Name>` for every property printed `never` because the model
249
+ * could not resolve its type across a namespace boundary — two independently released
250
+ * GIRs disagreeing, which is what the main emitter answers `never` for as well.
251
+ */
252
+ readonly unresolvedProps: readonly string[];
253
+ /**
254
+ * `c:identifier-prefixes` from the GIR, verbatim and in order — `['G']` for Gio.
255
+ *
256
+ * The C prefix a type REFERENCE needs: resolving `Gio.Icon` means producing `GIcon`,
257
+ * and nothing else in this package states that `Gio` spells itself `G`. Carried rather
258
+ * than derived because GIR carries it, and a derivation over the `DECLS` keys is wrong
259
+ * wherever the C prefix is not a prefix of the type NAMES: gdkx11-4.0 and gdkwayland-4.0
260
+ * both state `Gdk` while every key they declare begins `GdkX11`/`GdkWayland`.
261
+ *
262
+ * Empty where the GIR states none — 17 of the 627 emitting namespaces — because
263
+ * inventing the namespace name there is a confident wrong answer in place of a missing
264
+ * one. A LIST because 20 of them state more than one, which no single string expresses.
265
+ */
266
+ readonly identifierPrefixes: readonly string[];
267
+ /**
268
+ * Sibling vocabularies this one's DECLARATIONS come from, as import specifiers.
269
+ *
270
+ * A chain link with no `OWN_PROPS` row is ambiguous on its own — `GtkSeparator` has no
271
+ * settable property, `GApplication` has its properties in another package — and this
272
+ * list is what tells the two apart. Enum and bitfield NUMBERS are not here: those are
273
+ * carried in this file, because a `PROP_ENUMS` row naming a foreign GType gives a
274
+ * consumer nothing to load and a `.ui` file using the property never names its owner.
275
+ */
276
+ readonly requiredVocabularies: readonly string[];
277
+ };
278
+
279
+ /** Declaration GType -> its own settable properties, as GObject registered them. */
280
+ export const OWN_PROPS: Readonly<Record<string, readonly string[]>>;
281
+
282
+ /**
283
+ * Declaration GType -> the signals it registers itself, never its parents'.
284
+ *
285
+ * Keyed like `OWN_PROPS`, so both are read at every link of a `DECLS` chain. An
286
+ * abstract base has no `Widgets` row and still owns signals — `GtkWidget` owns 13.
287
+ */
288
+ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
289
+
290
+ /**
291
+ * Instantiable GType -> every declaration its members come from, self first.
292
+ *
293
+ * The key set is what a UI description file can NAME: every registered, non-abstract
294
+ * class this namespace declares. GtkBuilder resolves a `<object class="…">` through
295
+ * `g_type_from_name`, which knows nothing about widgets, so this is wider than
296
+ * `Widgets` by design — `GtkSizeGroup`, `GtkTextTag`, every `GtkEventController`
297
+ * and every `GtkCellRenderer` are here and are not widgets.
298
+ *
299
+ * `Widgets` and `CHILD_HOLDERS` are the narrower questions and answer them unchanged.
300
+ */
301
+ export const DECLS: Readonly<Record<string, readonly string[]>>;
302
+
303
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
304
+ export const CHILD_HOLDERS: readonly string[];
305
+
306
+ /** Enum GType -> the nicks this surface offers. */
307
+ export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
308
+
309
+ /**
310
+ * `<enum GType>.<nick>` -> the integer GObject registers for it, from GIR's `value`.
311
+ *
312
+ * Position in `ENUM_NICKS` is NOT this number. Counting is wrong on 6 of the 137 enums a
313
+ * GTK 4 vocabulary carries -- 112 in Gtk-4.0 and 25 in Adw-1: `GtkResponseType` runs -1 to -11, `GtkTextWindowType` starts
314
+ * at 1, `GtkOrdering` and `GtkConstraintRelation` are -1/0/1, `GtkAlign` has two names
315
+ * on one value, and `GtkConstraintStrength.required` is 1001001000 where counting says 0.
316
+ *
317
+ * Read from the same GIR as the nicks, deliberately. A consumer reading the numbers off an
318
+ * installed typelib instead has two provenances for one table, and then cannot tell a
319
+ * missing number from a host older than the vocabulary.
320
+ */
321
+ export const ENUM_VALUES: Readonly<Record<string, number>>;
322
+
323
+ /**
324
+ * The `<enum GType>.<nick>` entries GIR marks `deprecated="1"`.
325
+ *
326
+ * Two names on one value is how GObject spells an alias -- `GTK_ALIGN_BASELINE` and
327
+ * `GTK_ALIGN_BASELINE_FILL` are both 4, and both keep a `ENUM_VALUES` entry. The pairing
328
+ * is visible in the numbers; which name is the old one is not, and this is that fact --
329
+ * where GIR states it. It usually does not: 4 registered-enum members across the 718 GIRs
330
+ * carry the attribute, and 179 of the 182 value-sharing pairs carry it on neither half, so
331
+ * absence from this list means GIR is silent, not that the nick is the current one.
332
+ */
333
+ export const ENUM_DEPRECATED: readonly string[];
334
+
335
+ /**
336
+ * `<enum GType>.<nick>` -> the raw GIR `value` no number could be read from.
337
+ *
338
+ * The declared remainder, so that every nick in `ENUM_NICKS` is in `ENUM_VALUES` or in
339
+ * here and a drop cannot be silent. Two shapes reach it: a symbolic or absent value (Vala
340
+ * writes `(null)`, a char enum writes a letter) and an integer past
341
+ * `Number.MAX_SAFE_INTEGER`, where a literal would lose precision and stop being the
342
+ * GIR's number. Empty for Gtk, Adw, GLib and Gio.
343
+ */
344
+ export const ENUM_VALUES_UNREADABLE: Readonly<Record<string, string>>;
345
+
346
+ /**
347
+ * `<bitfield GType>.<nick>` -> the integer GObject registers for that one member.
348
+ *
349
+ * `ENUM_NICKS` carries no bitfield, because GObject cannot resolve a nick SET; that says
350
+ * nothing about a single member's number, and the number is what a host without GI needs.
351
+ * 23 settable properties in Gtk-4.0 and Adw-1 are bitfield-typed and are declared bare
352
+ * `number` -- `GtkEntry:input-hints`, `GtkPopoverMenu:flags`, `AdwTabView:shortcuts`,
353
+ * `GtkDropTarget:actions` among them. Counting is worst here: 119 of the 156 Gtk-4.0
354
+ * bitfield members this vocabulary carries disagree with their declaration position,
355
+ * against 29 of 672 enumeration members.
356
+ *
357
+ * Combine with `|` as GObject does. There is no nick table to pair this with, so a name
358
+ * here is resolvable and a SET still is not.
359
+ */
360
+ export const FLAG_VALUES: Readonly<Record<string, number>>;
361
+
362
+ /** `<bitfield GType>.<nick>` -> the raw GIR `value` no number could be read from. */
363
+ export const FLAG_VALUES_UNREADABLE: Readonly<Record<string, string>>;
364
+
365
+ /**
366
+ * `<declaration GType>.<property>` -> the GType of that property's enum or bitfield.
367
+ *
368
+ * The join the value tables need and nothing else here carries. A host with no GI has a
369
+ * property name and a nick and needs a number; `ENUM_VALUES` is keyed by ENUM GType, and
370
+ * only this says which enum a property is. Keyed by DECLARATION like `OWN_PROPS`, so it is
371
+ * read at every link of a `DECLS` chain — `orientation` belongs to `GtkOrientable`, not
372
+ * to the `GtkBox` a caller starts from.
373
+ *
374
+ * Present only where the property's OWN type is the enum: an array of them, or a union that
375
+ * merely mentions one, would be an entry a consumer resolves wrongly.
376
+ *
377
+ * The GType named here is not always one THIS module gives numbers for. A nick vocabulary is
378
+ * emitted once, by the namespace that owns the enum, so `AdwComboRow.search-match-mode` names
379
+ * `GtkStringFilterMatchMode` and its rows are in `@girs/gtk-4.0/vocabulary` — 83 of the 909
380
+ * entries in a full run resolve only with the owner's vocabulary loaded beside this one. An
381
+ * owner with no vocabulary of its own (Gdk, Pango) is inlined here instead, so every entry
382
+ * resolves against SOME module.
383
+ */
384
+ export const PROP_ENUMS: Readonly<Record<string, string>>;
385
+
386
+ /**
387
+ * The kinds of value a GTK accessible property, relation or state takes.
388
+ *
389
+ * `enum` is the one that needs a second lookup: `ARIA_VALUE_ENUMS` names the enum GType,
390
+ * and `ENUM_NICKS` and `ENUM_VALUES` answer from there.
391
+ */
392
+ export type AriaValueType = 'string' | 'integer' | 'double' | 'boolean' | 'reference' | 'enum';
393
+
394
+ /**
395
+ * `<enum GType>.<nick>` -> the kind of value that ARIA slot takes.
396
+ *
397
+ * The one table in this file that is not a fact about a ParamSpec. A GtkBuilder or
398
+ * Blueprint `accessibility { … }` block is typed by GTK's ARIA table, not by the widget,
399
+ * and the two disagree where it costs most: `orientation` is settable on a `GtkLabel`
400
+ * that implements no `GtkOrientable`, and `checked` is a `GtkAccessibleTristate`, so
401
+ * `checked: true` is the number 1 rather than a boolean. Typing those slots from the
402
+ * widget's properties gets both wrong and raises nothing.
403
+ *
404
+ * Keyed like `ENUM_VALUES` because the ARIA names ARE enum members — of
405
+ * `GtkAccessibleProperty`, `GtkAccessibleRelation` and `GtkAccessibleState` — so
406
+ * `ENUM_NICKS` already lists them and one key parser reads both.
407
+ *
408
+ * Read from each member's own GIR documentation. `gtk_accessible_property_init_value()`
409
+ * is the C half of this table and is not introspectable; the doc sentence is, and states
410
+ * the type for 52 of the 53 members in gtk4 4.23.3. Complete or absent, never partial: a
411
+ * member the generator cannot answer for fails the build and names itself.
412
+ */
413
+ export const ARIA_VALUE_TYPES: Readonly<Record<string, AriaValueType>>;
414
+
415
+ /**
416
+ * The same keys, for the `'enum'` rows only -> the GType of that enum.
417
+ *
418
+ * A table of its own for the reason `PROP_ENUMS` is one: folded in, the values of
419
+ * `ARIA_VALUE_TYPES` would be six reserved words mixed with arbitrary GTypes and telling
420
+ * them apart would be the consumer's problem. Apart, `ARIA_VALUE_TYPES[k] === 'enum'` is
421
+ * the whole test and `ENUM_NICKS[ARIA_VALUE_ENUMS[k]]` is the nick list.
422
+ */
423
+ export const ARIA_VALUE_ENUMS: Readonly<Record<string, string>>;
424
+
425
+ /** Widget GType -> slot name -> the method that may adopt a child there. */
426
+ export const SLOT_CANDIDATES: Readonly<Record<string, Readonly<Record<string, string>>>>;
427
+
428
+ /**
429
+ * `Type`, `Type.property` and `Type::signal` -> the release that introduced it.
430
+ *
431
+ * What keeps a runtime cross-check honest across a version gap without an
432
+ * allowlist: a name the installed library lacks is a defect UNLESS the version
433
+ * here is newer than the one running.
434
+ *
435
+ * ALL THREE key shapes, because that test only works for the names it covers. A
436
+ * property-only map leaves a consumer no way to explain a missing SIGNAL, which is
437
+ * a correct vocabulary reported as 18 defects; a member-only map leaves it no way to
438
+ * explain a missing CLASS, and that one fails as a bare
439
+ * `TypeError: can't access property "$gtype", ctor() is undefined` that does not
440
+ * even name the GType.
441
+ *
442
+ * A key is present only where the GIR states a version — sparse by nature (`version`
443
+ * sits on 29 of the 301 classes and interfaces in Gtk-4.0), never inferred.
444
+ */
445
+ export const SINCE: Readonly<Record<string, string>>;
@@ -0,0 +1,187 @@
1
+ // The widget vocabulary of Cvc-1.0 as runtime data.
2
+ //
3
+ // GENERATED — do not edit. Provenance: Cvc-1.0 — prop(s) no TypeScript value satisfies: Cvc.MixerCard.pa-context Cvc.MixerStream.pa-context Cvc.MixerUIDevice.card
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: 'Cvc',
11
+ version: '1.0',
12
+ libraryVersion: null,
13
+ childHolders: 0,
14
+ droppedBases: [],
15
+ inlinedBases: [],
16
+ unsettableProps: ['Cvc.MixerCard.pa-context', 'Cvc.MixerStream.pa-context', 'Cvc.MixerUIDevice.card'],
17
+ unresolvedProps: [],
18
+ identifierPrefixes: ['Gvc'],
19
+ requiredVocabularies: ['@girs/gobject-2.0/vocabulary'],
20
+ };
21
+
22
+ export const OWN_PROPS = {
23
+ GvcMixerCard: ['icon-name', 'id', 'index', 'name', 'pa-context', 'profile'],
24
+ GvcMixerControl: ['name'],
25
+ GvcMixerEventRole: ['device'],
26
+ GvcMixerStream: ['application-id', 'can-decibel', 'card-index', 'channel-map', 'decibel', 'description', 'form-factor', 'icon-name', 'id', 'index', 'is-event-stream', 'is-muted', 'is-virtual', 'name', 'pa-context', 'port', 'state', 'sysfs-path', 'volume'],
27
+ GvcMixerUIDevice: ['card', 'description', 'icon-name', 'origin', 'port-available', 'port-name', 'stream-id', 'type'],
28
+ };
29
+
30
+ export const OWN_SIGNALS = {
31
+ GvcChannelMap: ['volume-changed'],
32
+ GvcMixerControl: ['active-input-update', 'active-output-update', 'audio-device-selection-needed', 'card-added', 'card-removed', 'default-sink-changed', 'default-source-changed', 'input-added', 'input-removed', 'output-added', 'output-removed', 'state-changed', 'stream-added', 'stream-changed', 'stream-removed'],
33
+ GvcMixerStream: ['monitor-suspend', 'monitor-update'],
34
+ };
35
+
36
+ // Every GType this namespace can INSTANTIATE -> the declarations its members come from.
37
+ //
38
+ // The key set is what a UI description file can name: a registered, non-abstract class.
39
+ // Not "every widget" — GtkBuilder resolves a name through `g_type_from_name`, which knows
40
+ // nothing about widgets, and a `.ui` file is full of `GtkSizeGroup`, `GtkTextTag`,
41
+ // `GtkEventController*` and `GtkCellRenderer*`. Use `Widgets` and `CHILD_HOLDERS`
42
+ // below for the narrower questions; they did not move.
43
+ export const DECLS = {
44
+ GvcChannelMap: ['GvcChannelMap', 'GObject'],
45
+ GvcMixerCard: ['GvcMixerCard', 'GObject'],
46
+ GvcMixerControl: ['GvcMixerControl', 'GObject'],
47
+ GvcMixerEventRole: ['GvcMixerEventRole', 'GvcMixerStream', 'GObject'],
48
+ GvcMixerSink: ['GvcMixerSink', 'GvcMixerStream', 'GObject'],
49
+ GvcMixerSinkInput: ['GvcMixerSinkInput', 'GvcMixerStream', 'GObject'],
50
+ GvcMixerSource: ['GvcMixerSource', 'GvcMixerStream', 'GObject'],
51
+ GvcMixerSourceOutput: ['GvcMixerSourceOutput', 'GvcMixerStream', 'GObject'],
52
+ GvcMixerUIDevice: ['GvcMixerUIDevice', 'GObject'],
53
+ };
54
+
55
+ // The GTypes above that ARE widgets are the `Widgets` map in the sibling `.d.ts`; these
56
+ // are the ones that merely HOLD one, through `set_child`/`get_child`, descending from
57
+ // `GObject.Object`. A renderer places them like a container; a check asking "is this a
58
+ // widget" must not count them. Derived from the accessor pair, never from a list — the
59
+ // count is in the provenance line above.
60
+ export const CHILD_HOLDERS = [];
61
+
62
+ export const ENUM_NICKS = {
63
+ GvcMixerControlState: ['closed', 'ready', 'connecting', 'failed'],
64
+ GvcMixerStreamState: ['invalid', 'running', 'idle', 'suspended'],
65
+ GvcMixerUIDeviceDirection: ['input', 'output'],
66
+ };
67
+
68
+ // The number behind each of those nicks, read from GIR's own `value` attribute.
69
+ //
70
+ // It ships because position in `ENUM_NICKS` is not the value and a consumer with no
71
+ // typelib has no other way to learn it: a surface without GI still has to hand GObject an
72
+ // integer. The alternative a consumer reaches for first is counting, and counting is wrong
73
+ // on 6 of the 137 enums a GTK 4 vocabulary carries (112 in Gtk-4.0, 25 in Adw-1) --
74
+ // `GtkResponseType` runs -1 down to
75
+ // -11, `GtkTextWindowType` starts at 1, and `GtkConstraintStrength.required` is
76
+ // 1001001000 where counting answers 0.
77
+ //
78
+ // Same provenance as the nicks above, which is the point: a consumer that reads the numbers
79
+ // from an INSTALLED library instead gets two provenances for one table, and a member the
80
+ // vocabulary describes but the host predates then looks like a missing number rather than a
81
+ // version gap.
82
+ export const ENUM_VALUES = {
83
+ 'GvcMixerControlState.closed': 0,
84
+ 'GvcMixerControlState.connecting': 2,
85
+ 'GvcMixerControlState.failed': 3,
86
+ 'GvcMixerControlState.ready': 1,
87
+ 'GvcMixerStreamState.idle': 2,
88
+ 'GvcMixerStreamState.invalid': 0,
89
+ 'GvcMixerStreamState.running': 1,
90
+ 'GvcMixerStreamState.suspended': 3,
91
+ 'GvcMixerUIDeviceDirection.input': 0,
92
+ 'GvcMixerUIDeviceDirection.output': 1,
93
+ };
94
+
95
+ // The nicks GIR marks `deprecated="1"`.
96
+ //
97
+ // Two members of one enum may share a value -- that is how GObject spells an alias, and
98
+ // `GTK_ALIGN_BASELINE` and `GTK_ALIGN_BASELINE_FILL` are both 4. `ENUM_VALUES` keeps
99
+ // both names, so nothing is lost, and this is what says which of the two a number should be
100
+ // spelled back as. Stated rather than derived: the pairing is visible in the values, the
101
+ // DIRECTION is not.
102
+ //
103
+ // Read it as evidence, not as a negative: 4 registered-enum members in the 718 GIRs carry
104
+ // the attribute at all, and 179 of the 182 value-sharing pairs carry it on neither half.
105
+ // A nick missing from here is a nick GIR says nothing about, not a nick GIR calls current.
106
+ export const ENUM_DEPRECATED = [];
107
+
108
+ // The declared remainder: nicks whose GIR `value` is not a number this can carry.
109
+ //
110
+ // Every nick in `ENUM_NICKS` is in `ENUM_VALUES` or here -- a nick in neither would be a
111
+ // silent drop. GIR carries two shapes no integer holds: a symbolic or absent value (Vala
112
+ // writes `(null)`, a char enum writes a letter) and an integer past
113
+ // `Number.MAX_SAFE_INTEGER`. The value kept here is the raw attribute, so the entry says
114
+ // WHAT was unreadable rather than only that something was. Measured over the 718 GIRs in
115
+ // ts-for-gir's `girs/`: 32 of 34096 registered-enum members, none in Gtk, Adw, GLib or Gio.
116
+ export const ENUM_VALUES_UNREADABLE = {};
117
+
118
+ // The number behind each member of a registered BITFIELD, keyed the same way.
119
+ //
120
+ // `ENUM_NICKS` refuses a bitfield because GObject cannot resolve a nick SET, and that
121
+ // reason says nothing about one member's number. 23 settable properties in Gtk-4.0 and
122
+ // Adw-1 are bitfield-typed -- `GtkEntry:input-hints`, `GtkPopoverMenu:flags`,
123
+ // `AdwTabView:shortcuts`, `GtkDropTarget:actions`, ... -- and they are typed bare
124
+ // `number`, so a host without GI has nothing to compute one from. Counting is worst
125
+ // exactly here: 119 of the 156 Gtk-4.0 bitfield members this vocabulary carries disagree
126
+ // with their declaration position, against 29 of 672 enumeration members.
127
+ //
128
+ // A table of its own rather than more rows in `ENUM_VALUES`, so that "every nick in
129
+ // `ENUM_NICKS` has a number or a declared reason" stays a claim about one set.
130
+ export const FLAG_VALUES = {
131
+ 'GvcHeadsetPortChoice.headphones': 1,
132
+ 'GvcHeadsetPortChoice.headset': 2,
133
+ 'GvcHeadsetPortChoice.mic': 4,
134
+ 'GvcHeadsetPortChoice.none': 0,
135
+ };
136
+
137
+ // The same declared remainder for the bitfields. Every one of the 13 members in ts-for-gir's
138
+ // `girs/` whose value is past `Number.MAX_SAFE_INTEGER` is a bitfield member (Fwupd, Qmi),
139
+ // so this is the table that shape actually reaches.
140
+ export const FLAG_VALUES_UNREADABLE = {};
141
+
142
+ // Declaration GType + property name -> the GType of that property's enum or bitfield.
143
+ //
144
+ // Without it the value tables above are half an answer. A host with no GI knows it must set
145
+ // `orientation` to the number behind the nick `vertical`; `ENUM_VALUES` is keyed
146
+ // `GtkOrientation.vertical`, and nothing else says that `orientation` is a
147
+ // `GtkOrientation`. Deriving it is not available: `never` is a member of several Gtk enums,
148
+ // and choosing between them produces a wrong number rather than a missing one.
149
+ //
150
+ // Only where the property's OWN type is the enum. An array of them and a union that mentions
151
+ // one are both entries a consumer would resolve wrongly, so neither is written.
152
+ //
153
+ // A GType named here has numbers in SOME vocabulary, not necessarily this one: the namespace
154
+ // that OWNS an enum publishes it, so 83 of the 909 entries a full run emits want the owner's
155
+ // vocabulary loaded too. Owners that emit none (Gdk, Pango) are inlined into the tables above.
156
+ export const PROP_ENUMS = {
157
+ 'GvcMixerStream.state': 'GvcMixerStreamState',
158
+ };
159
+
160
+ // `<enum GType>.<nick>` -> the kind of value that ARIA slot takes.
161
+ //
162
+ // The one table here that is not about a ParamSpec. A GtkBuilder or Blueprint
163
+ // `accessibility { … }` block is typed by GTK's ARIA table instead, and the two disagree
164
+ // where it matters: `orientation` is settable on a `GtkLabel` that implements no
165
+ // `GtkOrientable` and has no such property, and `checked` is a `GtkAccessibleTristate`, so
166
+ // `checked: true` means the number 1 and not the boolean. A consumer typing those slots
167
+ // from the widget gets both wrong, silently.
168
+ //
169
+ // Read from each member's own documentation, which is where GTK keeps the table --
170
+ // `gtk_accessible_property_init_value()` is the C half and is not introspectable, the
171
+ // sentence is. Complete or absent, never partial: a member whose documentation states no
172
+ // value type fails generation and names itself, because a missing row is indistinguishable
173
+ // from "GTK has no such name" and the plausible fallback emits `true` where GTK means 1.
174
+ export const ARIA_VALUE_TYPES = {};
175
+
176
+ // The same keys, for the `'enum'` rows only -> the GType of the enum.
177
+ //
178
+ // The join on from a kind to a number, and a table of its own for the reason `PROP_ENUMS`
179
+ // is one: folding the GType into `ARIA_VALUE_TYPES` would make its values a mix of six
180
+ // reserved words and arbitrary GTypes, and telling them apart would be the consumer's
181
+ // problem. With this, `ARIA_VALUE_TYPES[k] === 'enum'` is the whole test, and
182
+ // `ENUM_NICKS[ARIA_VALUE_ENUMS[k]]` is the nick list.
183
+ export const ARIA_VALUE_ENUMS = {};
184
+
185
+ export const SLOT_CANDIDATES = {};
186
+
187
+ export const SINCE = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/cvc-1.0",
3
- "version": "5.1.0",
3
+ "version": "5.3.0",
4
4
  "description": "GJS TypeScript type definitions for Cvc-1.0",
5
5
  "type": "module",
6
6
  "module": "cvc-1.0.js",
@@ -16,6 +16,11 @@
16
16
  "import": "./cvc-1.0-import.js",
17
17
  "default": "./cvc-1.0-import.js"
18
18
  },
19
+ "./vocabulary": {
20
+ "types": "./cvc-1.0-vocabulary.d.ts",
21
+ "import": "./cvc-1.0-vocabulary.js",
22
+ "default": "./cvc-1.0-vocabulary.js"
23
+ },
19
24
  "./cvc-1.0": {
20
25
  "types": "./cvc-1.0.d.ts",
21
26
  "import": "./cvc-1.0.js",
@@ -31,11 +36,11 @@
31
36
  "test": "tsc --project tsconfig.json"
32
37
  },
33
38
  "dependencies": {
34
- "@girs/gjs": "^5.1.0",
35
- "@girs/gio-2.0": "^5.1.0",
36
- "@girs/gobject-2.0": "^5.1.0",
37
- "@girs/glib-2.0": "^5.1.0",
38
- "@girs/gmodule-2.0": "^5.1.0" },
39
+ "@girs/gjs": "^5.3.0",
40
+ "@girs/gio-2.0": "^5.3.0",
41
+ "@girs/gobject-2.0": "^5.3.0",
42
+ "@girs/glib-2.0": "^5.3.0",
43
+ "@girs/gmodule-2.0": "^5.3.0" },
39
44
  "devDependencies": {
40
45
  "typescript": "*"
41
46
  },
package/tsconfig.json CHANGED
@@ -35,7 +35,7 @@
35
35
  ]
36
36
  }
37
37
  },
38
- "include": ["./cvc-1.0.d.ts"]
38
+ "include": ["./cvc-1.0.d.ts","./cvc-1.0-vocabulary.d.ts"]
39
39
  }
40
40
 
41
41