@girs/gcrgtk3-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/gcrgtk3-4)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GcrGtk3-4 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.2.0.
8
+ GJS TypeScript type definitions for GcrGtk3-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/gcrgtk3-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 GcrGtk3 from '@girs/gcrgtk3-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/gcrgtk3-4` or `@girs/gcrgtk3-4/ambient` in your `tsconfig` or entry point Typescript file:
28
28
 
29
29
  `index.ts`:
@@ -42,7 +42,7 @@ import '@girs/gcrgtk3-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 GcrGtk3 from 'gi://GcrGtk3?version=4';
@@ -50,7 +50,7 @@ import GcrGtk3 from 'gi://GcrGtk3?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/gcrgtk3-4` or `@girs/gcrgtk3-4/import` in your `tsconfig` or entry point Typescript file:
55
55
 
56
56
  `index.ts`:
@@ -69,7 +69,7 @@ import '@girs/gcrgtk3-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 GcrGtk3 = imports.gi.GcrGtk3;
@@ -77,7 +77,7 @@ const GcrGtk3 = imports.gi.GcrGtk3;
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', 'GtkBox', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkOrientable'],
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/gcrgtk3-4.d.ts CHANGED
@@ -159,12 +159,14 @@ export namespace GcrGtk3 {
159
159
  /**
160
160
  * Retrieves the orientation of the `orientable`.
161
161
  * @returns the orientation of the `orientable`.
162
+ * @since 2.16
162
163
  */
163
164
  get_orientation(): Gtk.Orientation;
164
165
 
165
166
  /**
166
167
  * Sets the orientation of the `orientable`.
167
168
  * @param orientation the orientable’s new orientation.
169
+ * @since 2.16
168
170
  */
169
171
  set_orientation(orientation: Gtk.Orientation): void;
170
172
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gcrgtk3-4",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "GJS TypeScript type definitions for GcrGtk3-4",
5
5
  "type": "module",
6
6
  "module": "gcrgtk3-4.js",
@@ -36,22 +36,22 @@
36
36
  "test": "tsc --project tsconfig.json"
37
37
  },
38
38
  "dependencies": {
39
- "@girs/gjs": "^4.2.0",
40
- "@girs/gtk-3.0": "^4.2.0",
41
- "@girs/xlib-2.0": "^4.2.0",
42
- "@girs/gdk-3.0": "^4.2.0",
43
- "@girs/cairo-1.0": "^4.2.0",
44
- "@girs/gobject-2.0": "^4.2.0",
45
- "@girs/glib-2.0": "^4.2.0",
46
- "@girs/pango-1.0": "^4.2.0",
47
- "@girs/harfbuzz-0.0": "^4.2.0",
48
- "@girs/freetype2-2.0": "^4.2.0",
49
- "@girs/gio-2.0": "^4.2.0",
50
- "@girs/gmodule-2.0": "^4.2.0",
51
- "@girs/gdkpixbuf-2.0": "^4.2.0",
52
- "@girs/atk-1.0": "^4.2.0",
53
- "@girs/gcr-4": "^4.2.0",
54
- "@girs/gck-2": "^4.2.0" },
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-4": "^4.4.0",
54
+ "@girs/gck-2": "^4.4.0" },
55
55
  "devDependencies": {
56
56
  "typescript": "*"
57
57
  },