@girs/gcrui-3 4.4.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/gcrui-3)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gcrui-3)
6
6
 
7
+ GJS TypeScript type definitions for GcrUi-3 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.5.0.
7
8
 
8
- GJS TypeScript type definitions for GcrUi-3 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.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/gcrui-3
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/gcrui-3` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/gcrui-3/ambient` | only the `gi://` module declarations |
27
+ | `@girs/gcrui-3/import` | only the `imports.gi` declarations |
28
+ | `@girs/gcrui-3/gcrui-3` | the namespace, without the side-effecting declarations |
29
+ | `@girs/gcrui-3/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 GcrUi from '@girs/gcrui-3';
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/gcrui-3` or `@girs/gcrui-3/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/gcrui-3'
47
+ import '@girs/gcrui-3';
32
48
  ```
33
49
 
34
- `tsconfig.json`:
35
50
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/gcrui-3"],
41
- ...
42
- }
51
+ { "include": ["@girs/gcrui-3"] }
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 GcrUi from 'gi://GcrUi?version=3';
49
58
  ```
50
59
 
51
- ### Global import
60
+ Referencing `@girs/gcrui-3/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/gcrui-3` or `@girs/gcrui-3/import` in your `tsconfig` or entry point Typescript file:
65
+ GJS's global object works the same way, via `@girs/gcrui-3/import`:
55
66
 
56
- `index.ts`:
57
67
  ```ts
58
- import '@girs/gcrui-3'
68
+ const GcrUi = imports.gi.GcrUi;
59
69
  ```
60
70
 
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/gcrui-3"],
68
- ...
69
- }
70
- ```
71
+ ## Widget vocabulary
71
72
 
72
- That form carries types as well:
73
+ `gcrui-3` 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 GcrUi = imports.gi.GcrUi;
77
+ import type { Widgets, PropsOf } from '@girs/gcrui-3/vocabulary';
78
+ import { OWN_PROPS, ENUM_NICKS, PROVENANCE } from '@girs/gcrui-3/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
 
@@ -0,0 +1,360 @@
1
+ /**
2
+ * The GIR-derived widget VOCABULARY for GcrUi-3.
3
+ *
4
+ * GENERATED — do not edit. Provenance: GcrUi-3 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object Atk.ImplementorIface — inlined base(s) from a namespace with no vocabulary: Gcr.Prompt — prop(s) no TypeScript value satisfies: GcrUi.TreeSelector.columns
5
+ *
6
+ * 9 concrete widgets, 10 declarations (1 inlined from a namespace with no surface), 0 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 Gck from '@girs/gck-1';
28
+ import type Gcr from '@girs/gcr-3';
29
+ import type GcrUi from './gcrui-3.js';
30
+ import type { GtkActionableConstructOnly, GtkActionableProps, GtkActivatableConstructOnly, GtkActivatableProps, GtkBinConstructOnly, GtkBinProps, GtkBoxConstructOnly, GtkBoxProps, GtkBuildableConstructOnly, GtkBuildableProps, GtkButtonConstructOnly, GtkButtonProps, GtkCellEditableConstructOnly, GtkCellEditableProps, GtkCellLayoutConstructOnly, GtkCellLayoutProps, GtkComboBoxConstructOnly, GtkComboBoxProps, GtkContainerConstructOnly, GtkContainerProps, GtkDialogConstructOnly, GtkDialogProps, GtkOrientableConstructOnly, GtkOrientableProps, GtkScrollableConstructOnly, GtkScrollableProps, GtkTreeViewConstructOnly, GtkTreeViewProps, GtkWidgetConstructOnly, GtkWidgetProps, GtkWindowConstructOnly, GtkWindowProps } from '@girs/gtk-3.0/vocabulary';
31
+
32
+ // ---------------------------------------------------------------------------
33
+ // Enum nicks — the string vocabulary GObject registered, from GIR's `glib:nick`.
34
+ //
35
+ // Not derived from the member name. Substituting underscores for dashes is not a law:
36
+ // some nicks keep an underscore the substitution would have replaced, and only the
37
+ // attribute knows which. Gtk-4.0 and Adw-1 contradict no derivation at all, which is
38
+ // how a derived nick passes review and breaks elsewhere.
39
+ // Re-measure with `scripts/check-nick-derivation.mjs` in ts-for-gir.
40
+ // ---------------------------------------------------------------------------
41
+
42
+
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
+ /** A widget that can be used to display a certificate. */
55
+ export interface GcrCertificateWidgetProps extends GtkBinProps, GtkBuildableProps {
56
+ attributes?: Gck.Attributes | null;
57
+ certificate?: Gcr.Certificate | null;
58
+ }
59
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
60
+ export type GcrCertificateWidgetConstructOnly = GtkBinConstructOnly | GtkBuildableConstructOnly;
61
+
62
+ /** A widget that can be used to select a certificate or key. */
63
+ export interface GcrComboSelectorProps extends GtkComboBoxProps, GtkBuildableProps, GtkCellEditableProps, GtkCellLayoutProps {
64
+ /** The collection which contains the objects to display in the selector. */
65
+ collection?: Gcr.Collection;
66
+ }
67
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
68
+ export type GcrComboSelectorConstructOnly = GtkComboBoxConstructOnly | GtkBuildableConstructOnly | GtkCellEditableConstructOnly | GtkCellLayoutConstructOnly | 'collection';
69
+
70
+ /** A button which imports keys and certificates. */
71
+ export interface GcrImportButtonProps extends GtkButtonProps, GtkActionableProps, GtkActivatableProps, GtkBuildableProps {
72
+ }
73
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
74
+ export type GcrImportButtonConstructOnly = GtkButtonConstructOnly | GtkActionableConstructOnly | GtkActivatableConstructOnly | GtkBuildableConstructOnly;
75
+
76
+ /** A key widget and renderer A key widget can be used to display a RSA, DSA or EC key. */
77
+ export interface GcrKeyWidgetProps extends GtkBinProps, GtkBuildableProps {
78
+ attributes?: Gck.Attributes | null;
79
+ }
80
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
81
+ export type GcrKeyWidgetConstructOnly = GtkBinConstructOnly | GtkBuildableConstructOnly;
82
+
83
+ /** A selector widget to select 1 or more certificates or keys from a list. */
84
+ export interface GcrListSelectorProps extends GtkTreeViewProps, GtkBuildableProps, GtkScrollableProps {
85
+ /** The collection which contains the objects to display in the selector. */
86
+ collection?: Gcr.Collection;
87
+ }
88
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
89
+ export type GcrListSelectorConstructOnly = GtkTreeViewConstructOnly | GtkBuildableConstructOnly | GtkScrollableConstructOnly | 'collection';
90
+
91
+ /** A prompt displayed to the user. */
92
+ export interface GcrPromptProps {
93
+ /**
94
+ * The string handle of the caller's window.
95
+ * @default NULL
96
+ */
97
+ 'caller-window'?: string;
98
+ /**
99
+ * The label for the cancel button in the prompt.
100
+ * @default Cancel
101
+ */
102
+ 'cancel-label'?: string;
103
+ /**
104
+ * Whether the additional choice is chosen or not.
105
+ * @default FALSE
106
+ */
107
+ 'choice-chosen'?: boolean;
108
+ /**
109
+ * The label for the additional choice.
110
+ * @default NULL
111
+ */
112
+ 'choice-label'?: string;
113
+ /**
114
+ * The label for the continue button in the prompt.
115
+ * @default Continue
116
+ */
117
+ 'continue-label'?: string;
118
+ /**
119
+ * The detailed description of the prompt.
120
+ * @default NULL
121
+ */
122
+ description?: string;
123
+ /**
124
+ * The prompt message for the user.
125
+ * @default NULL
126
+ */
127
+ message?: string;
128
+ /**
129
+ * Whether the prompt will prompt for a new password.
130
+ * @default FALSE
131
+ */
132
+ 'password-new'?: boolean;
133
+ /**
134
+ * The title of the prompt.
135
+ * @default NULL
136
+ */
137
+ title?: string;
138
+ /**
139
+ * A prompt warning displayed on the prompt, or %NULL for no warning.
140
+ * @default NULL
141
+ */
142
+ warning?: string;
143
+ }
144
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
145
+ export type GcrPromptConstructOnly = never;
146
+
147
+ /** A [iface@Gcr.Prompt] implementation which shows a GTK dialog. */
148
+ export interface GcrPromptDialogProps extends GtkDialogProps, Omit<GcrPromptProps, 'title'>, GtkBuildableProps {
149
+ }
150
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
151
+ export type GcrPromptDialogConstructOnly = GtkDialogConstructOnly | GcrPromptConstructOnly | GtkBuildableConstructOnly;
152
+
153
+ /** A tree selector can be used to select certificates or keys. */
154
+ export interface GcrTreeSelectorProps extends GtkTreeViewProps, GtkBuildableProps, GtkScrollableProps {
155
+ /** The collection which contains the objects to display in the selector. */
156
+ collection?: Gcr.Collection;
157
+ /** The columns to use to display the objects. */
158
+ columns?: never;
159
+ }
160
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
161
+ export type GcrTreeSelectorConstructOnly = GtkTreeViewConstructOnly | GtkBuildableConstructOnly | GtkScrollableConstructOnly | 'collection' | 'columns';
162
+
163
+ /** This widget displays a set of unlock options for the user to select. */
164
+ export interface GcrUnlockOptionsWidgetProps extends GtkBinProps, GtkBuildableProps {
165
+ /** @default NULL */
166
+ choice?: string;
167
+ /** @default 0 */
168
+ ttl?: number;
169
+ }
170
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
171
+ export type GcrUnlockOptionsWidgetConstructOnly = GtkBinConstructOnly | GtkBuildableConstructOnly;
172
+
173
+ /** A viewer widget which can display certificates and keys that are located in files. */
174
+ export interface GcrViewerWidgetProps extends GtkBoxProps, GtkBuildableProps, GtkOrientableProps {
175
+ /**
176
+ * Display name for data being displayed.
177
+ * @default NULL
178
+ */
179
+ 'display-name'?: string;
180
+ }
181
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
182
+ export type GcrViewerWidgetConstructOnly = GtkBoxConstructOnly | GtkBuildableConstructOnly | GtkOrientableConstructOnly;
183
+
184
+ // ---------------------------------------------------------------------------
185
+ // The GType-keyed widget map.
186
+ //
187
+ // Keyed by GType because that is also the GtkBuilder XML key and the typelib key. A
188
+ // consumer maps GTypes to tags in ITS convention — kebab for JSX intrinsics, Pascal
189
+ // for a Vue `GlobalComponents`, the class itself for a renderer whose element type
190
+ // is the class. None of those is baked in here.
191
+ //
192
+ // `slotCandidates` is a candidate list and never an answer: derived from methods
193
+ // taking exactly one widget argument. The GIR cannot tell adoption from reference —
194
+ // `set_title_widget` parents its argument and `set_activatable_widget` does not, and
195
+ // both are `void f(GtkWidget*)` at `transfer-ownership="none"`. Curation decides;
196
+ // this is what notices when a release adds a candidate.
197
+ // ---------------------------------------------------------------------------
198
+
199
+ export interface Widgets {
200
+ GcrCertificateWidget: {
201
+ class: GcrUi.CertificateWidget;
202
+ props: GcrCertificateWidgetProps;
203
+ signals: GcrUi.CertificateWidget.SignalSignatures;
204
+ constructOnly: GcrCertificateWidgetConstructOnly;
205
+ slotCandidates: {};
206
+ };
207
+ GcrComboSelector: {
208
+ class: GcrUi.ComboSelector;
209
+ props: GcrComboSelectorProps;
210
+ signals: GcrUi.ComboSelector.SignalSignatures;
211
+ constructOnly: GcrComboSelectorConstructOnly;
212
+ slotCandidates: {};
213
+ };
214
+ GcrImportButton: {
215
+ class: GcrUi.ImportButton;
216
+ props: GcrImportButtonProps;
217
+ signals: GcrUi.ImportButton.SignalSignatures;
218
+ constructOnly: GcrImportButtonConstructOnly;
219
+ slotCandidates: {};
220
+ };
221
+ GcrKeyWidget: {
222
+ class: GcrUi.KeyWidget;
223
+ props: GcrKeyWidgetProps;
224
+ signals: GcrUi.KeyWidget.SignalSignatures;
225
+ constructOnly: GcrKeyWidgetConstructOnly;
226
+ slotCandidates: {};
227
+ };
228
+ GcrListSelector: {
229
+ class: GcrUi.ListSelector;
230
+ props: GcrListSelectorProps;
231
+ signals: GcrUi.ListSelector.SignalSignatures;
232
+ constructOnly: GcrListSelectorConstructOnly;
233
+ slotCandidates: {};
234
+ };
235
+ GcrPromptDialog: {
236
+ class: GcrUi.PromptDialog;
237
+ props: GcrPromptDialogProps;
238
+ signals: GcrUi.PromptDialog.SignalSignatures;
239
+ constructOnly: GcrPromptDialogConstructOnly;
240
+ slotCandidates: {};
241
+ };
242
+ GcrTreeSelector: {
243
+ class: GcrUi.TreeSelector;
244
+ props: GcrTreeSelectorProps;
245
+ signals: GcrUi.TreeSelector.SignalSignatures;
246
+ constructOnly: GcrTreeSelectorConstructOnly;
247
+ slotCandidates: {};
248
+ };
249
+ GcrUnlockOptionsWidget: {
250
+ class: GcrUi.UnlockOptionsWidget;
251
+ props: GcrUnlockOptionsWidgetProps;
252
+ signals: GcrUi.UnlockOptionsWidget.SignalSignatures;
253
+ constructOnly: GcrUnlockOptionsWidgetConstructOnly;
254
+ slotCandidates: {};
255
+ };
256
+ GcrViewerWidget: {
257
+ class: GcrUi.ViewerWidget;
258
+ props: GcrViewerWidgetProps;
259
+ signals: GcrUi.ViewerWidget.SignalSignatures;
260
+ constructOnly: GcrViewerWidgetConstructOnly;
261
+ slotCandidates: {};
262
+ };
263
+ }
264
+
265
+ /** Every GType this namespace can create. A consumer derives its own tag map. */
266
+ export type WidgetGType = keyof Widgets;
267
+
268
+ // ---------------------------------------------------------------------------
269
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
270
+ //
271
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
272
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
273
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
274
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
275
+ // more rows in `Widgets`: concatenate them when you mean both.
276
+ // ---------------------------------------------------------------------------
277
+
278
+ export interface ChildHolders {
279
+
280
+ }
281
+
282
+ /** Every GType this namespace holds a child in without it being a widget. */
283
+ export type ChildHolderGType = keyof ChildHolders;
284
+
285
+ /** The writable, optional, GObject-keyed property surface of one GType. */
286
+ export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
287
+
288
+ /** The signal table this package already emits, reached by GType. */
289
+ export type SignalsOf<G extends WidgetGType> = Widgets[G]['signals'];
290
+
291
+ /** The instance type — what a `ref`-shaped prop should infer. */
292
+ export type InstanceOf<G extends WidgetGType> = Widgets[G]['class'];
293
+
294
+ /** Property names that can only be set at construction. */
295
+ export type ConstructOnlyOf<G extends WidgetGType> = Widgets[G]['constructOnly'];
296
+
297
+ /** Candidate child slots — see the note above; curation decides. */
298
+ export type SlotCandidatesOf<G extends WidgetGType> = keyof Widgets[G]['slotCandidates'];
299
+
300
+ /**
301
+ * The same facts as runtime data, for a consumer that CHECKS them.
302
+ *
303
+ * Types are erased, so a spec that asks the installed GTK whether every property
304
+ * here is a writable ParamSpec, every signal resolvable by `GObject.signal_lookup`
305
+ * and every nick resolvable through an enum lookup cannot read the interfaces
306
+ * above. Emitted headlessly with no GTK present, which is exactly why the checking
307
+ * belongs to the consumer and the DATA belongs here.
308
+ */
309
+ export const PROVENANCE: {
310
+ readonly namespace: string;
311
+ readonly version: string;
312
+ /** The version the LIBRARY states, or null where it states none. Never the namespace's. */
313
+ readonly libraryVersion: string | null;
314
+ readonly childHolders: number;
315
+ readonly droppedBases: readonly string[];
316
+ readonly inlinedBases: readonly string[];
317
+ readonly unsettableProps: readonly string[];
318
+ };
319
+
320
+ /** Declaration GType -> its own settable properties, as GObject registered them. */
321
+ export const OWN_PROPS: Readonly<Record<string, readonly string[]>>;
322
+
323
+ /**
324
+ * Declaration GType -> the signals it registers itself, never its parents'.
325
+ *
326
+ * Keyed like `OWN_PROPS`, so both are read at every link of a `DECLS` chain. An
327
+ * abstract base has no `Widgets` row and still owns signals — `GtkWidget` owns 13.
328
+ */
329
+ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
330
+
331
+ /** Widget GType -> every declaration its members come from, self first. */
332
+ export const DECLS: Readonly<Record<string, readonly string[]>>;
333
+
334
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
335
+ export const CHILD_HOLDERS: readonly string[];
336
+
337
+ /** Enum GType -> the nicks this surface offers. */
338
+ export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
339
+
340
+ /** Widget GType -> slot name -> the method that may adopt a child there. */
341
+ export const SLOT_CANDIDATES: Readonly<Record<string, Readonly<Record<string, string>>>>;
342
+
343
+ /**
344
+ * `Type`, `Type.property` and `Type::signal` -> the release that introduced it.
345
+ *
346
+ * What keeps a runtime cross-check honest across a version gap without an
347
+ * allowlist: a name the installed library lacks is a defect UNLESS the version
348
+ * here is newer than the one running.
349
+ *
350
+ * ALL THREE key shapes, because that test only works for the names it covers. A
351
+ * property-only map leaves a consumer no way to explain a missing SIGNAL, which is
352
+ * a correct vocabulary reported as 18 defects; a member-only map leaves it no way to
353
+ * explain a missing CLASS, and that one fails as a bare
354
+ * `TypeError: can't access property "$gtype", ctor() is undefined` that does not
355
+ * even name the GType.
356
+ *
357
+ * A key is present only where the GIR states a version — sparse by nature (`version`
358
+ * sits on 29 of the 301 classes and interfaces in Gtk-4.0), never inferred.
359
+ */
360
+ export const SINCE: Readonly<Record<string, string>>;
@@ -0,0 +1,57 @@
1
+ // The widget vocabulary of GcrUi-3 as runtime data.
2
+ //
3
+ // GENERATED — do not edit. Provenance: GcrUi-3 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object Atk.ImplementorIface — inlined base(s) from a namespace with no vocabulary: Gcr.Prompt — prop(s) no TypeScript value satisfies: GcrUi.TreeSelector.columns
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: 'GcrUi',
11
+ version: '3',
12
+ libraryVersion: null,
13
+ childHolders: 0,
14
+ droppedBases: ['GObject.InitiallyUnowned', 'GObject.Object', 'Atk.ImplementorIface'],
15
+ inlinedBases: ['Gcr.Prompt'],
16
+ unsettableProps: ['GcrUi.TreeSelector.columns'],
17
+ };
18
+
19
+ export const OWN_PROPS = {
20
+ GcrCertificateWidget: ['attributes', 'certificate'],
21
+ GcrComboSelector: ['collection'],
22
+ GcrKeyWidget: ['attributes'],
23
+ GcrListSelector: ['collection'],
24
+ GcrPrompt: ['caller-window', 'cancel-label', 'choice-chosen', 'choice-label', 'continue-label', 'description', 'message', 'password-new', 'title', 'warning'],
25
+ GcrTreeSelector: ['collection', 'columns'],
26
+ GcrUnlockOptionsWidget: ['choice', 'ttl'],
27
+ GcrViewerWidget: ['display-name'],
28
+ };
29
+
30
+ export const OWN_SIGNALS = {
31
+ GcrImportButton: ['imported', 'importing'],
32
+ GcrViewerWidget: ['added'],
33
+ };
34
+
35
+ export const DECLS = {
36
+ GcrCertificateWidget: ['GcrCertificateWidget', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
37
+ GcrComboSelector: ['GcrComboSelector', 'GtkComboBox', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkCellEditable', 'GtkCellLayout'],
38
+ GcrImportButton: ['GcrImportButton', 'GtkButton', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkActionable', 'GtkActivatable', 'GtkBuildable'],
39
+ GcrKeyWidget: ['GcrKeyWidget', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
40
+ GcrListSelector: ['GcrListSelector', 'GtkTreeView', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkScrollable'],
41
+ GcrPromptDialog: ['GcrPromptDialog', 'GtkDialog', 'GtkWindow', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GcrPrompt', 'GtkBuildable'],
42
+ GcrTreeSelector: ['GcrTreeSelector', 'GtkTreeView', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkScrollable'],
43
+ GcrUnlockOptionsWidget: ['GcrUnlockOptionsWidget', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
44
+ GcrViewerWidget: ['GcrViewerWidget', 'GtkBox', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkOrientable'],
45
+ };
46
+
47
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
48
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
49
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
50
+ // from a list — the count is in the provenance line above.
51
+ export const CHILD_HOLDERS = [];
52
+
53
+ export const ENUM_NICKS = {};
54
+
55
+ export const SLOT_CANDIDATES = {};
56
+
57
+ export const SINCE = {};
package/gcrui-3.d.ts CHANGED
@@ -45,11 +45,11 @@ export namespace GcrUi {
45
45
  /**
46
46
  * only objects in the top collection, no child objects
47
47
  */
48
- LIST,
48
+ LIST = 0,
49
49
  /**
50
50
  * show objects in the collection, and child objects in a tree form
51
51
  */
52
- TREE,
52
+ TREE = 1,
53
53
  }
54
54
 
55
55
 
@@ -1958,13 +1958,13 @@ export namespace GcrUi {
1958
1958
  * @signal
1959
1959
  * @run-last
1960
1960
  */
1961
- imported: (arg0: GObject.Object, arg1: GLib.Error) => void;
1961
+ imported: (importer: GObject.Object, error: GLib.Error) => void;
1962
1962
  /**
1963
1963
  * Signal emitted when an import begins.
1964
1964
  * @signal
1965
1965
  * @run-last
1966
1966
  */
1967
- importing: (arg0: GObject.Object) => void;
1967
+ importing: (importer: GObject.Object) => void;
1968
1968
  "notify::always-show-image": (pspec: GObject.ParamSpec) => void;
1969
1969
  "notify::image": (pspec: GObject.ParamSpec) => void;
1970
1970
  "notify::image-position": (pspec: GObject.ParamSpec) => void;
@@ -3415,6 +3415,7 @@ export namespace GcrUi {
3415
3415
  * an error occurs. Check the `error` argument to tell the difference.
3416
3416
  * @param cancellable optional cancellation object
3417
3417
  * @returns the reply from the prompt
3418
+ * @throws GLib.Error
3418
3419
  */
3419
3420
  confirm(cancellable: Gio.Cancellable | null): Gcr.PromptReply;
3420
3421
 
@@ -3458,6 +3459,7 @@ export namespace GcrUi {
3458
3459
  * an error occurs. Check the `error` argument to tell the difference.
3459
3460
  * @param result asynchronous result passed to callback
3460
3461
  * @returns the reply from the prompt
3462
+ * @throws GLib.Error
3461
3463
  */
3462
3464
  confirm_finish(result: Gio.AsyncResult): Gcr.PromptReply;
3463
3465
 
@@ -3475,6 +3477,7 @@ export namespace GcrUi {
3475
3477
  * an error occurs. Check the `error` argument to tell the difference.
3476
3478
  * @param cancellable optional cancellation object
3477
3479
  * @returns the reply from the prompt
3480
+ * @throws GLib.Error
3478
3481
  */
3479
3482
  confirm_run(cancellable: Gio.Cancellable | null): Gcr.PromptReply;
3480
3483
 
@@ -3601,6 +3604,7 @@ export namespace GcrUi {
3601
3604
  * `error` argument to tell the difference.
3602
3605
  * @param cancellable optional cancellation object
3603
3606
  * @returns the password owned by the prompt, or `null`
3607
+ * @throws GLib.Error
3604
3608
  */
3605
3609
  password(cancellable: Gio.Cancellable | null): string;
3606
3610
 
@@ -3644,6 +3648,7 @@ export namespace GcrUi {
3644
3648
  * `error` argument to tell the difference.
3645
3649
  * @param result asynchronous result passed to callback
3646
3650
  * @returns the password owned by the prompt, or `null`
3651
+ * @throws GLib.Error
3647
3652
  */
3648
3653
  password_finish(result: Gio.AsyncResult): string;
3649
3654
 
@@ -3663,6 +3668,7 @@ export namespace GcrUi {
3663
3668
  * `error` argument to tell the difference.
3664
3669
  * @param cancellable optional cancellation object
3665
3670
  * @returns the password owned by the prompt, or `null`
3671
+ * @throws GLib.Error
3666
3672
  */
3667
3673
  password_run(cancellable: Gio.Cancellable | null): string;
3668
3674
 
@@ -4370,7 +4376,7 @@ export namespace GcrUi {
4370
4376
  * @signal
4371
4377
  * @run-last
4372
4378
  */
4373
- added: (arg0: Renderer, arg1: Gcr.Parsed) => void;
4379
+ added: (renderer: Renderer, parsed: Gcr.Parsed) => void;
4374
4380
  "notify::display-name": (pspec: GObject.ParamSpec) => void;
4375
4381
  "notify::parser": (pspec: GObject.ParamSpec) => void;
4376
4382
  "notify::baseline-position": (pspec: GObject.ParamSpec) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gcrui-3",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "GJS TypeScript type definitions for GcrUi-3",
5
5
  "type": "module",
6
6
  "module": "gcrui-3.js",
@@ -16,10 +16,10 @@
16
16
  "import": "./gcrui-3-import.js",
17
17
  "default": "./gcrui-3-import.js"
18
18
  },
19
- "./surface": {
20
- "types": "./gcrui-3-surface.d.ts",
21
- "import": "./gcrui-3-surface.js",
22
- "default": "./gcrui-3-surface.js"
19
+ "./vocabulary": {
20
+ "types": "./gcrui-3-vocabulary.d.ts",
21
+ "import": "./gcrui-3-vocabulary.js",
22
+ "default": "./gcrui-3-vocabulary.js"
23
23
  },
24
24
  "./gcrui-3": {
25
25
  "types": "./gcrui-3.d.ts",
@@ -36,22 +36,22 @@
36
36
  "test": "tsc --project tsconfig.json"
37
37
  },
38
38
  "dependencies": {
39
- "@girs/gjs": "^4.4.0",
40
- "@girs/gtk-3.0": "^4.4.0",
41
- "@girs/xlib-2.0": "^4.4.0",
42
- "@girs/gdk-3.0": "^4.4.0",
43
- "@girs/cairo-1.0": "^4.4.0",
44
- "@girs/gobject-2.0": "^4.4.0",
45
- "@girs/glib-2.0": "^4.4.0",
46
- "@girs/pango-1.0": "^4.4.0",
47
- "@girs/harfbuzz-0.0": "^4.4.0",
48
- "@girs/freetype2-2.0": "^4.4.0",
49
- "@girs/gio-2.0": "^4.4.0",
50
- "@girs/gmodule-2.0": "^4.4.0",
51
- "@girs/gdkpixbuf-2.0": "^4.4.0",
52
- "@girs/atk-1.0": "^4.4.0",
53
- "@girs/gcr-3": "^4.4.0",
54
- "@girs/gck-1": "^4.4.0" },
39
+ "@girs/gjs": "^4.5.0",
40
+ "@girs/gtk-3.0": "^4.5.0",
41
+ "@girs/xlib-2.0": "^4.5.0",
42
+ "@girs/gdk-3.0": "^4.5.0",
43
+ "@girs/cairo-1.0": "^4.5.0",
44
+ "@girs/gobject-2.0": "^4.5.0",
45
+ "@girs/glib-2.0": "^4.5.0",
46
+ "@girs/pango-1.0": "^4.5.0",
47
+ "@girs/harfbuzz-0.0": "^4.5.0",
48
+ "@girs/freetype2-2.0": "^4.5.0",
49
+ "@girs/gio-2.0": "^4.5.0",
50
+ "@girs/gmodule-2.0": "^4.5.0",
51
+ "@girs/gdkpixbuf-2.0": "^4.5.0",
52
+ "@girs/atk-1.0": "^4.5.0",
53
+ "@girs/gcr-3": "^4.5.0",
54
+ "@girs/gck-1": "^4.5.0" },
55
55
  "devDependencies": {
56
56
  "typescript": "*"
57
57
  },
package/tsconfig.json CHANGED
@@ -68,7 +68,7 @@
68
68
  ]
69
69
  }
70
70
  },
71
- "include": ["./gcrui-3.d.ts","./gcrui-3-surface.d.ts"]
71
+ "include": ["./gcrui-3.d.ts","./gcrui-3-vocabulary.d.ts"]
72
72
  }
73
73
 
74
74