@girs/gcrgtk4-4 4.2.0 → 4.4.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
@@ -5,25 +5,25 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gcrgtk4-4)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GcrGtk4-4 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.2.0.
8
+ GJS TypeScript type definitions for GcrGtk4-4 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.0.
9
9
 
10
10
  ## Install
11
11
 
12
- To use this type definitions, install them with NPM:
12
+ Install the type definitions with npm:
13
13
  ```bash
14
14
  npm install @girs/gcrgtk4-4
15
15
  ```
16
16
 
17
17
  ## Usage
18
18
 
19
- You can import this package into your project like this:
19
+ Import it like any other module:
20
20
  ```ts
21
21
  import GcrGtk4 from '@girs/gcrgtk4-4';
22
22
  ```
23
23
 
24
24
  ### Ambient Modules
25
25
 
26
- You can also use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) to import this module like you would do this in JavaScript.
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
27
  For this you need to include `@girs/gcrgtk4-4` or `@girs/gcrgtk4-4/ambient` in your `tsconfig` or entry point Typescript file:
28
28
 
29
29
  `index.ts`:
@@ -42,7 +42,7 @@ import '@girs/gcrgtk4-4'
42
42
  }
43
43
  ```
44
44
 
45
- Now you can import the ambient module with TypeScript support:
45
+ The ambient module now resolves with types:
46
46
 
47
47
  ```ts
48
48
  import GcrGtk4 from 'gi://GcrGtk4?version=4';
@@ -50,7 +50,7 @@ import GcrGtk4 from 'gi://GcrGtk4?version=4';
50
50
 
51
51
  ### Global import
52
52
 
53
- You can also import the module with Typescript support using the global `imports.gi` object of GJS.
53
+ GJS's global `imports.gi` works too, with types.
54
54
  For this you need to include `@girs/gcrgtk4-4` or `@girs/gcrgtk4-4/import` in your `tsconfig` or entry point Typescript file:
55
55
 
56
56
  `index.ts`:
@@ -69,7 +69,7 @@ import '@girs/gcrgtk4-4'
69
69
  }
70
70
  ```
71
71
 
72
- Now you have also type support for this, too:
72
+ That form carries types as well:
73
73
 
74
74
  ```ts
75
75
  const GcrGtk4 = imports.gi.GcrGtk4;
@@ -77,7 +77,7 @@ const GcrGtk4 = imports.gi.GcrGtk4;
77
77
 
78
78
  ### Bundle
79
79
 
80
- Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
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.
81
81
 
82
82
  ## Other packages
83
83
 
@@ -84,6 +84,23 @@ export interface Widgets {
84
84
  /** Every GType this namespace can create. A consumer derives its own tag map. */
85
85
  export type WidgetGType = keyof Widgets;
86
86
 
87
+ // ---------------------------------------------------------------------------
88
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
89
+ //
90
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
91
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
92
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
93
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
94
+ // more rows in `Widgets`: concatenate them when you mean both.
95
+ // ---------------------------------------------------------------------------
96
+
97
+ export interface ChildHolders {
98
+
99
+ }
100
+
101
+ /** Every GType this namespace holds a child in without it being a widget. */
102
+ export type ChildHolderGType = keyof ChildHolders;
103
+
87
104
  /** The writable, optional, GObject-keyed property surface of one GType. */
88
105
  export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
89
106
 
@@ -119,6 +136,9 @@ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
119
136
  /** Widget GType -> every declaration its members come from, self first. */
120
137
  export const DECLS: Readonly<Record<string, readonly string[]>>;
121
138
 
139
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
140
+ export const CHILD_HOLDERS: readonly string[];
141
+
122
142
  /** Enum GType -> the nicks this surface offers. */
123
143
  export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
124
144
 
@@ -18,6 +18,12 @@ export const DECLS = {
18
18
  GcrCertificateWidget: ['GcrCertificateWidget', 'GtkWidget', 'GtkAccessible', 'GtkBuildable', 'GtkConstraintTarget'],
19
19
  };
20
20
 
21
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
22
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
23
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
24
+ // from a list — the count is in the provenance line above.
25
+ export const CHILD_HOLDERS = [];
26
+
21
27
  export const ENUM_NICKS = {};
22
28
 
23
29
  export const SLOT_CANDIDATES = {};
package/gcrgtk4-4.d.ts CHANGED
@@ -167,6 +167,7 @@ export namespace GcrGtk4 {
167
167
  * does not interrupts the user's current screen reader output.
168
168
  * @param message the string to announce
169
169
  * @param priority the priority of the announcement
170
+ * @since 4.14
170
171
  */
171
172
  announce(message: string, priority: Gtk.AccessibleAnnouncementPriority): void;
172
173
 
@@ -179,6 +180,7 @@ export namespace GcrGtk4 {
179
180
  * It is left to the accessible implementation to define the scope
180
181
  * and uniqueness of the identifier.
181
182
  * @returns the accessible identifier
183
+ * @since 4.22
182
184
  */
183
185
  get_accessible_id(): string | null;
184
186
 
@@ -187,6 +189,7 @@ export namespace GcrGtk4 {
187
189
  *
188
190
  * This function returns `NULL` for top level widgets.
189
191
  * @returns the accessible parent
192
+ * @since 4.10
190
193
  */
191
194
  get_accessible_parent(): Gtk.Accessible | null;
192
195
 
@@ -199,6 +202,7 @@ export namespace GcrGtk4 {
199
202
  /**
200
203
  * Retrieves the implementation for the given accessible object.
201
204
  * @returns the accessible implementation object
205
+ * @since 4.10
202
206
  */
203
207
  get_at_context(): Gtk.ATContext;
204
208
 
@@ -209,18 +213,21 @@ export namespace GcrGtk4 {
209
213
  * implementations, e.g. to get the bounds from an ignored
210
214
  * child widget.
211
215
  * @returns true if the bounds are valid, and false otherwise
216
+ * @since 4.10
212
217
  */
213
218
  get_bounds(): [boolean, number, number, number, number];
214
219
 
215
220
  /**
216
221
  * Retrieves the first accessible child of an accessible object.
217
222
  * @returns the first accessible child
223
+ * @since 4.10
218
224
  */
219
225
  get_first_accessible_child(): Gtk.Accessible | null;
220
226
 
221
227
  /**
222
228
  * Retrieves the next accessible sibling of an accessible object
223
229
  * @returns the next accessible sibling
230
+ * @since 4.10
224
231
  */
225
232
  get_next_accessible_sibling(): Gtk.Accessible | null;
226
233
 
@@ -232,6 +239,7 @@ export namespace GcrGtk4 {
232
239
  * child widget, as is the case for {@link Gtk.Text} wrappers.
233
240
  * @param state platform state to query
234
241
  * @returns the value of state for the accessible
242
+ * @since 4.10
235
243
  */
236
244
  get_platform_state(state: Gtk.AccessiblePlatformState): boolean;
237
245
 
@@ -265,6 +273,7 @@ export namespace GcrGtk4 {
265
273
  * object is the container widget.
266
274
  * @param parent the parent accessible object
267
275
  * @param next_sibling the sibling accessible object
276
+ * @since 4.10
268
277
  */
269
278
  set_accessible_parent(parent: Gtk.Accessible | null, next_sibling: Gtk.Accessible | null): void;
270
279
 
@@ -274,6 +283,7 @@ export namespace GcrGtk4 {
274
283
  * That might be useful when a new child of a custom accessible
275
284
  * is created, and it needs to be linked to a previous child.
276
285
  * @param new_sibling the new next accessible sibling to set
286
+ * @since 4.10
277
287
  */
278
288
  update_next_accessible_sibling(new_sibling: Gtk.Accessible | null): void;
279
289
 
@@ -284,6 +294,7 @@ export namespace GcrGtk4 {
284
294
  * have a platform state but are not widgets. Widgets handle platform
285
295
  * states automatically.
286
296
  * @param state the platform state to update
297
+ * @since 4.18
287
298
  */
288
299
  update_platform_state(state: Gtk.AccessiblePlatformState): void;
289
300
 
@@ -331,6 +342,7 @@ export namespace GcrGtk4 {
331
342
  *
332
343
  * It is left to the accessible implementation to define the scope
333
344
  * and uniqueness of the identifier.
345
+ * @since 4.22
334
346
  * @virtual
335
347
  */
336
348
  vfunc_get_accessible_id(): string | null;
@@ -339,12 +351,14 @@ export namespace GcrGtk4 {
339
351
  * Retrieves the accessible parent for an accessible object.
340
352
  *
341
353
  * This function returns `NULL` for top level widgets.
354
+ * @since 4.10
342
355
  * @virtual
343
356
  */
344
357
  vfunc_get_accessible_parent(): Gtk.Accessible | null;
345
358
 
346
359
  /**
347
360
  * Retrieves the implementation for the given accessible object.
361
+ * @since 4.10
348
362
  * @virtual
349
363
  */
350
364
  vfunc_get_at_context(): Gtk.ATContext | null;
@@ -355,18 +369,21 @@ export namespace GcrGtk4 {
355
369
  * This functionality can be overridden by {@link Gtk.Accessible}
356
370
  * implementations, e.g. to get the bounds from an ignored
357
371
  * child widget.
372
+ * @since 4.10
358
373
  * @virtual
359
374
  */
360
375
  vfunc_get_bounds(): [boolean, number, number, number, number];
361
376
 
362
377
  /**
363
378
  * Retrieves the first accessible child of an accessible object.
379
+ * @since 4.10
364
380
  * @virtual
365
381
  */
366
382
  vfunc_get_first_accessible_child(): Gtk.Accessible | null;
367
383
 
368
384
  /**
369
385
  * Retrieves the next accessible sibling of an accessible object
386
+ * @since 4.10
370
387
  * @virtual
371
388
  */
372
389
  vfunc_get_next_accessible_sibling(): Gtk.Accessible | null;
@@ -378,6 +395,7 @@ export namespace GcrGtk4 {
378
395
  * implementations, e.g. to get platform state from an ignored
379
396
  * child widget, as is the case for {@link Gtk.Text} wrappers.
380
397
  * @param state platform state to query
398
+ * @since 4.10
381
399
  * @virtual
382
400
  */
383
401
  vfunc_get_platform_state(state: Gtk.AccessiblePlatformState): boolean;
@@ -473,7 +491,7 @@ export namespace GcrGtk4 {
473
491
  /**
474
492
  * Stores the id attribute given in the {@link Gtk.Builder} UI definition.
475
493
  * {@link Gtk.Widget} stores the name as object data. Implement this method if your
476
- * object has some notion of &#x201C;ID&#x201D; and it makes sense to map the XML id
494
+ * object has some notion of ID and it makes sense to map the XML id
477
495
  * attribute to it.
478
496
  * @param id
479
497
  * @virtual
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gcrgtk4-4",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "GJS TypeScript type definitions for GcrGtk4-4",
5
5
  "type": "module",
6
6
  "module": "gcrgtk4-4.js",
@@ -36,23 +36,23 @@
36
36
  "test": "tsc --project tsconfig.json"
37
37
  },
38
38
  "dependencies": {
39
- "@girs/gjs": "^4.2.0",
40
- "@girs/gtk-4.0": "^4.2.0",
41
- "@girs/gsk-4.0": "^4.2.0",
42
- "@girs/graphene-1.0": "^4.2.0",
43
- "@girs/gobject-2.0": "^4.2.0",
44
- "@girs/glib-2.0": "^4.2.0",
45
- "@girs/gdk-4.0": "^4.2.0",
46
- "@girs/cairo-1.0": "^4.2.0",
47
- "@girs/pangocairo-1.0": "^4.2.0",
48
- "@girs/pango-1.0": "^4.2.0",
49
- "@girs/harfbuzz-0.0": "^4.2.0",
50
- "@girs/freetype2-2.0": "^4.2.0",
51
- "@girs/gio-2.0": "^4.2.0",
52
- "@girs/gmodule-2.0": "^4.2.0",
53
- "@girs/gdkpixbuf-2.0": "^4.2.0",
54
- "@girs/gcr-4": "^4.2.0",
55
- "@girs/gck-2": "^4.2.0" },
39
+ "@girs/gjs": "^4.4.0",
40
+ "@girs/gtk-4.0": "^4.4.0",
41
+ "@girs/gsk-4.0": "^4.4.0",
42
+ "@girs/graphene-1.0": "^4.4.0",
43
+ "@girs/gobject-2.0": "^4.4.0",
44
+ "@girs/glib-2.0": "^4.4.0",
45
+ "@girs/gdk-4.0": "^4.4.0",
46
+ "@girs/cairo-1.0": "^4.4.0",
47
+ "@girs/pangocairo-1.0": "^4.4.0",
48
+ "@girs/pango-1.0": "^4.4.0",
49
+ "@girs/harfbuzz-0.0": "^4.4.0",
50
+ "@girs/freetype2-2.0": "^4.4.0",
51
+ "@girs/gio-2.0": "^4.4.0",
52
+ "@girs/gmodule-2.0": "^4.4.0",
53
+ "@girs/gdkpixbuf-2.0": "^4.4.0",
54
+ "@girs/gcr-4": "^4.4.0",
55
+ "@girs/gck-2": "^4.4.0" },
56
56
  "devDependencies": {
57
57
  "typescript": "*"
58
58
  },