@girs/gtksource-5 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/gtksource-5)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GtkSource-5, generated from library version 5.20.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.2.0.
8
+ GJS TypeScript type definitions for GtkSource-5, generated from library version 5.21.0 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/gtksource-5
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 GtkSource from '@girs/gtksource-5';
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/gtksource-5` or `@girs/gtksource-5/ambient` in your `tsconfig` or entry point Typescript file:
28
28
 
29
29
  `index.ts`:
@@ -42,7 +42,7 @@ import '@girs/gtksource-5'
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 GtkSource from 'gi://GtkSource?version=5';
@@ -50,7 +50,7 @@ import GtkSource from 'gi://GtkSource?version=5';
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/gtksource-5` or `@girs/gtksource-5/import` in your `tsconfig` or entry point Typescript file:
55
55
 
56
56
  `index.ts`:
@@ -69,7 +69,7 @@ import '@girs/gtksource-5'
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 GtkSource = imports.gi.GtkSource;
@@ -77,7 +77,7 @@ const GtkSource = imports.gi.GtkSource;
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
 
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The GIR-derived widget VOCABULARY for GtkSource-5.
3
3
  *
4
- * GENERATED — do not edit. Provenance: GtkSource-5 — library 5.20.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object
4
+ * GENERATED — do not edit. Provenance: GtkSource-5 — library 5.21.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object
5
5
  *
6
6
  * 10 concrete widgets, 12 declarations, 11 enum nick unions, 2 slot candidates.
7
7
  *
@@ -288,6 +288,23 @@ export interface Widgets {
288
288
  /** Every GType this namespace can create. A consumer derives its own tag map. */
289
289
  export type WidgetGType = keyof Widgets;
290
290
 
291
+ // ---------------------------------------------------------------------------
292
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
293
+ //
294
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
295
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
296
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
297
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
298
+ // more rows in `Widgets`: concatenate them when you mean both.
299
+ // ---------------------------------------------------------------------------
300
+
301
+ export interface ChildHolders {
302
+
303
+ }
304
+
305
+ /** Every GType this namespace holds a child in without it being a widget. */
306
+ export type ChildHolderGType = keyof ChildHolders;
307
+
291
308
  /** The writable, optional, GObject-keyed property surface of one GType. */
292
309
  export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
293
310
 
@@ -323,6 +340,9 @@ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
323
340
  /** Widget GType -> every declaration its members come from, self first. */
324
341
  export const DECLS: Readonly<Record<string, readonly string[]>>;
325
342
 
343
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
344
+ export const CHILD_HOLDERS: readonly string[];
345
+
326
346
  /** Enum GType -> the nicks this surface offers. */
327
347
  export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
328
348
 
@@ -1,12 +1,12 @@
1
1
  // The widget vocabulary of GtkSource-5 as runtime data.
2
2
  //
3
- // GENERATED — do not edit. Provenance: GtkSource-5 — library 5.20.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object
3
+ // GENERATED — do not edit. Provenance: GtkSource-5 — library 5.21.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object
4
4
  //
5
5
  // The type half of this subpath is the sibling `.d.ts`. This file exists because
6
6
  // types are erased: a consumer that wants to ask the installed library whether every
7
7
  // name here is real needs values, not declarations.
8
8
 
9
- export const SURFACE_PROVENANCE = 'GtkSource-5 — library 5.20.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object';
9
+ export const SURFACE_PROVENANCE = 'GtkSource-5 — library 5.21.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object';
10
10
 
11
11
  export const OWN_PROPS = {
12
12
  GtkSourceCompletionCell: ['column', 'markup', 'paintable', 'text', 'widget'],
@@ -38,6 +38,12 @@ export const DECLS = {
38
38
  GtkSourceView: ['GtkSourceView', 'GtkTextView', 'GtkWidget', 'GtkAccessible', 'GtkAccessibleText', 'GtkBuildable', 'GtkConstraintTarget', 'GtkScrollable'],
39
39
  };
40
40
 
41
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
42
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
43
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
44
+ // from a list — the count is in the provenance line above.
45
+ export const CHILD_HOLDERS = [];
46
+
41
47
  export const ENUM_NICKS = {
42
48
  GtkSourceAnnotationStyle: ['none', 'warning', 'error', 'accent'],
43
49
  GtkSourceBackgroundPatternType: ['none', 'grid'],