@girs/gtksource-3.0 4.3.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/gtksource-3.0)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gtksource-3.0)
6
6
 
7
+ GJS TypeScript type definitions for GtkSource-3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.5.0.
7
8
 
8
- GJS TypeScript type definitions for GtkSource-3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.3.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/gtksource-3.0
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/gtksource-3.0` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/gtksource-3.0/ambient` | only the `gi://` module declarations |
27
+ | `@girs/gtksource-3.0/import` | only the `imports.gi` declarations |
28
+ | `@girs/gtksource-3.0/gtksource-3.0` | the namespace, without the side-effecting declarations |
29
+ | `@girs/gtksource-3.0/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 GtkSource from '@girs/gtksource-3.0';
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/gtksource-3.0` or `@girs/gtksource-3.0/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/gtksource-3.0'
47
+ import '@girs/gtksource-3.0';
32
48
  ```
33
49
 
34
- `tsconfig.json`:
35
50
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/gtksource-3.0"],
41
- ...
42
- }
51
+ { "include": ["@girs/gtksource-3.0"] }
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 GtkSource from 'gi://GtkSource?version=3.0';
49
58
  ```
50
59
 
51
- ### Global import
60
+ Referencing `@girs/gtksource-3.0/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/gtksource-3.0` or `@girs/gtksource-3.0/import` in your `tsconfig` or entry point Typescript file:
65
+ GJS's global object works the same way, via `@girs/gtksource-3.0/import`:
55
66
 
56
- `index.ts`:
57
67
  ```ts
58
- import '@girs/gtksource-3.0'
68
+ const GtkSource = imports.gi.GtkSource;
59
69
  ```
60
70
 
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/gtksource-3.0"],
68
- ...
69
- }
70
- ```
71
+ ## Widget vocabulary
71
72
 
72
- That form carries types as well:
73
+ `gtksource-3.0` 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 GtkSource = imports.gi.GtkSource;
77
+ import type { Widgets, PropsOf } from '@girs/gtksource-3.0/vocabulary';
78
+ import { OWN_PROPS, ENUM_NICKS, PROVENANCE } from '@girs/gtksource-3.0/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
 
@@ -190,6 +190,23 @@ export interface Widgets {
190
190
  /** Every GType this namespace can create. A consumer derives its own tag map. */
191
191
  export type WidgetGType = keyof Widgets;
192
192
 
193
+ // ---------------------------------------------------------------------------
194
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
195
+ //
196
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
197
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
198
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
199
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
200
+ // more rows in `Widgets`: concatenate them when you mean both.
201
+ // ---------------------------------------------------------------------------
202
+
203
+ export interface ChildHolders {
204
+
205
+ }
206
+
207
+ /** Every GType this namespace holds a child in without it being a widget. */
208
+ export type ChildHolderGType = keyof ChildHolders;
209
+
193
210
  /** The writable, optional, GObject-keyed property surface of one GType. */
194
211
  export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
195
212
 
@@ -225,6 +242,9 @@ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
225
242
  /** Widget GType -> every declaration its members come from, self first. */
226
243
  export const DECLS: Readonly<Record<string, readonly string[]>>;
227
244
 
245
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
246
+ export const CHILD_HOLDERS: readonly string[];
247
+
228
248
  /** Enum GType -> the nicks this surface offers. */
229
249
  export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
230
250
 
@@ -27,6 +27,12 @@ export const DECLS = {
27
27
  GtkSourceView: ['GtkSourceView', 'GtkTextView', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkScrollable'],
28
28
  };
29
29
 
30
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
31
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
32
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
33
+ // from a list — the count is in the provenance line above.
34
+ export const CHILD_HOLDERS = [];
35
+
30
36
  export const ENUM_NICKS = {
31
37
  GtkSourceBackgroundPatternType: ['none', 'grid'],
32
38
  GtkSourceBracketMatchType: ['none', 'out-of-range', 'not-found', 'found'],
@@ -0,0 +1,312 @@
1
+ /**
2
+ * The GIR-derived widget VOCABULARY for GtkSource-3.0.
3
+ *
4
+ * GENERATED — do not edit. Provenance: GtkSource-3.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object Atk.ImplementorIface
5
+ *
6
+ * 5 concrete widgets, 6 declarations, 8 enum nick unions, 2 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 GtkSource from './gtksource-3.0.js';
28
+ import type Pango from '@girs/pango-1.0';
29
+ import type { GtkActionableConstructOnly, GtkActionableProps, GtkActivatableConstructOnly, GtkActivatableProps, GtkBinConstructOnly, GtkBinProps, GtkBuildableConstructOnly, GtkBuildableProps, GtkButtonConstructOnly, GtkButtonProps, GtkContainerConstructOnly, GtkContainerProps, GtkScrollableConstructOnly, GtkScrollableProps, GtkTextViewConstructOnly, GtkTextViewProps, GtkWidgetConstructOnly, GtkWidgetProps, GtkWindowConstructOnly, GtkWindowProps } from '@girs/gtk-3.0/vocabulary';
30
+
31
+ // ---------------------------------------------------------------------------
32
+ // Enum nicks — the string vocabulary GObject registered, from GIR's `glib:nick`.
33
+ //
34
+ // Not derived from the member name. Substituting underscores for dashes is not a law:
35
+ // some nicks keep an underscore the substitution would have replaced, and only the
36
+ // attribute knows which. Gtk-4.0 and Adw-1 contradict no derivation at all, which is
37
+ // how a derived nick passes review and breaks elsewhere.
38
+ // Re-measure with `scripts/check-nick-derivation.mjs` in ts-for-gir.
39
+ // ---------------------------------------------------------------------------
40
+
41
+ export type GtkSourceBackgroundPatternTypeNick = 'none' | 'grid';
42
+ export type GtkSourceBracketMatchTypeNick = 'none' | 'out-of-range' | 'not-found' | 'found';
43
+ export type GtkSourceChangeCaseTypeNick = 'lower' | 'upper' | 'toggle' | 'title';
44
+ export type GtkSourceCompressionTypeNick = 'none' | 'gzip';
45
+ export type GtkSourceGutterRendererAlignmentModeNick = 'cell' | 'first' | 'last';
46
+ export type GtkSourceNewlineTypeNick = 'lf' | 'cr' | 'cr-lf';
47
+ export type GtkSourceSmartHomeEndTypeNick = 'disabled' | 'before' | 'after' | 'always';
48
+ export type GtkSourceViewGutterPositionNick = 'lines' | 'marks';
49
+
50
+ // ---------------------------------------------------------------------------
51
+ // Property surfaces — one interface per GIR DECLARATION, mirroring GIR's own
52
+ // inheritance rather than flattening per widget.
53
+ //
54
+ // The interfaces are load-bearing, not tidiness: `GtkBox` declares four properties
55
+ // of its own and `orientation` is not among them — it lives on `Gtk.Orientable`,
56
+ // because GObject installs interface properties on the implementor at runtime while
57
+ // GIR keeps them once, on the interface.
58
+ // ---------------------------------------------------------------------------
59
+
60
+ export interface GtkSourceCompletionInfoProps extends GtkWindowProps, GtkBuildableProps {
61
+ }
62
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
63
+ export type GtkSourceCompletionInfoConstructOnly = GtkWindowConstructOnly | GtkBuildableConstructOnly;
64
+
65
+ export interface GtkSourceMapProps extends GtkSourceViewProps, GtkBuildableProps, GtkScrollableProps {
66
+ 'font-desc'?: Pango.FontDescription;
67
+ view?: GtkSource.View | null;
68
+ }
69
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
70
+ export type GtkSourceMapConstructOnly = GtkSourceViewConstructOnly | GtkBuildableConstructOnly | GtkScrollableConstructOnly;
71
+
72
+ export interface GtkSourceStyleSchemeChooserProps {
73
+ /**
74
+ * The :style-scheme property contains the currently selected style scheme.
75
+ * @since 3.16
76
+ */
77
+ 'style-scheme'?: GtkSource.StyleScheme;
78
+ }
79
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
80
+ export type GtkSourceStyleSchemeChooserConstructOnly = never;
81
+
82
+ export interface GtkSourceStyleSchemeChooserButtonProps extends GtkButtonProps, GtkActionableProps, GtkActivatableProps, GtkBuildableProps, GtkSourceStyleSchemeChooserProps {
83
+ }
84
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
85
+ export type GtkSourceStyleSchemeChooserButtonConstructOnly = GtkButtonConstructOnly | GtkActionableConstructOnly | GtkActivatableConstructOnly | GtkBuildableConstructOnly | GtkSourceStyleSchemeChooserConstructOnly;
86
+
87
+ export interface GtkSourceStyleSchemeChooserWidgetProps extends GtkBinProps, GtkBuildableProps, GtkSourceStyleSchemeChooserProps {
88
+ }
89
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
90
+ export type GtkSourceStyleSchemeChooserWidgetConstructOnly = GtkBinConstructOnly | GtkBuildableConstructOnly | GtkSourceStyleSchemeChooserConstructOnly;
91
+
92
+ export interface GtkSourceViewProps extends GtkTextViewProps, GtkBuildableProps, GtkScrollableProps {
93
+ /** @default FALSE */
94
+ 'auto-indent'?: boolean;
95
+ /**
96
+ * Draw a specific background pattern on the view.
97
+ * @since 3.16
98
+ * @default GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE
99
+ */
100
+ 'background-pattern'?: GtkSourceBackgroundPatternTypeNick | GtkSource.BackgroundPatternType;
101
+ /**
102
+ * Set if and how the spaces should be visualized.
103
+ * @since 2.4
104
+ * @default 0
105
+ * @deprecated since 3.24: Use the #GtkSourceSpaceDrawer:matrix property instead.
106
+ */
107
+ 'draw-spaces'?: number;
108
+ /** @default FALSE */
109
+ 'highlight-current-line'?: boolean;
110
+ /** @default TRUE */
111
+ 'indent-on-tab'?: boolean;
112
+ /**
113
+ * Width of an indentation step expressed in number of spaces.
114
+ * @default -1
115
+ */
116
+ 'indent-width'?: number;
117
+ /** @default FALSE */
118
+ 'insert-spaces-instead-of-tabs'?: boolean;
119
+ /**
120
+ * Position of the right margin.
121
+ * @default 80
122
+ */
123
+ 'right-margin-position'?: number;
124
+ /**
125
+ * Whether to display line mark pixbufs
126
+ * @default FALSE
127
+ */
128
+ 'show-line-marks'?: boolean;
129
+ /**
130
+ * Whether to display line numbers
131
+ * @default FALSE
132
+ */
133
+ 'show-line-numbers'?: boolean;
134
+ /**
135
+ * Whether to display the right margin.
136
+ * @default FALSE
137
+ */
138
+ 'show-right-margin'?: boolean;
139
+ /**
140
+ * Whether smart Backspace should be used.
141
+ * @since 3.18
142
+ * @default FALSE
143
+ */
144
+ 'smart-backspace'?: boolean;
145
+ /**
146
+ * Set the behavior of the HOME and END keys.
147
+ * @since 2.0
148
+ * @default GTK_SOURCE_SMART_HOME_END_DISABLED
149
+ */
150
+ 'smart-home-end'?: GtkSourceSmartHomeEndTypeNick | GtkSource.SmartHomeEndType;
151
+ /**
152
+ * Width of a tab character expressed in number of spaces.
153
+ * @default 8
154
+ */
155
+ 'tab-width'?: number;
156
+ }
157
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
158
+ export type GtkSourceViewConstructOnly = GtkTextViewConstructOnly | GtkBuildableConstructOnly | GtkScrollableConstructOnly;
159
+
160
+ // ---------------------------------------------------------------------------
161
+ // The GType-keyed widget map.
162
+ //
163
+ // Keyed by GType because that is also the GtkBuilder XML key and the typelib key. A
164
+ // consumer maps GTypes to tags in ITS convention — kebab for JSX intrinsics, Pascal
165
+ // for a Vue `GlobalComponents`, the class itself for a renderer whose element type
166
+ // is the class. None of those is baked in here.
167
+ //
168
+ // `slotCandidates` is a candidate list and never an answer: derived from methods
169
+ // taking exactly one widget argument. The GIR cannot tell adoption from reference —
170
+ // `set_title_widget` parents its argument and `set_activatable_widget` does not, and
171
+ // both are `void f(GtkWidget*)` at `transfer-ownership="none"`. Curation decides;
172
+ // this is what notices when a release adds a candidate.
173
+ // ---------------------------------------------------------------------------
174
+
175
+ export interface Widgets {
176
+ GtkSourceCompletionInfo: {
177
+ class: GtkSource.CompletionInfo;
178
+ props: GtkSourceCompletionInfoProps;
179
+ signals: GtkSource.CompletionInfo.SignalSignatures;
180
+ constructOnly: GtkSourceCompletionInfoConstructOnly;
181
+ slotCandidates: {
182
+ 'widget': 'set_widget';
183
+ };
184
+ };
185
+ GtkSourceMap: {
186
+ class: GtkSource.Map;
187
+ props: GtkSourceMapProps;
188
+ signals: GtkSource.Map.SignalSignatures;
189
+ constructOnly: GtkSourceMapConstructOnly;
190
+ slotCandidates: {
191
+ 'view': 'set_view';
192
+ };
193
+ };
194
+ GtkSourceStyleSchemeChooserButton: {
195
+ class: GtkSource.StyleSchemeChooserButton;
196
+ props: GtkSourceStyleSchemeChooserButtonProps;
197
+ signals: GtkSource.StyleSchemeChooserButton.SignalSignatures;
198
+ constructOnly: GtkSourceStyleSchemeChooserButtonConstructOnly;
199
+ slotCandidates: {};
200
+ };
201
+ GtkSourceStyleSchemeChooserWidget: {
202
+ class: GtkSource.StyleSchemeChooserWidget;
203
+ props: GtkSourceStyleSchemeChooserWidgetProps;
204
+ signals: GtkSource.StyleSchemeChooserWidget.SignalSignatures;
205
+ constructOnly: GtkSourceStyleSchemeChooserWidgetConstructOnly;
206
+ slotCandidates: {};
207
+ };
208
+ GtkSourceView: {
209
+ class: GtkSource.View;
210
+ props: GtkSourceViewProps;
211
+ signals: GtkSource.View.SignalSignatures;
212
+ constructOnly: GtkSourceViewConstructOnly;
213
+ slotCandidates: {};
214
+ };
215
+ }
216
+
217
+ /** Every GType this namespace can create. A consumer derives its own tag map. */
218
+ export type WidgetGType = keyof Widgets;
219
+
220
+ // ---------------------------------------------------------------------------
221
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
222
+ //
223
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
224
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
225
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
226
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
227
+ // more rows in `Widgets`: concatenate them when you mean both.
228
+ // ---------------------------------------------------------------------------
229
+
230
+ export interface ChildHolders {
231
+
232
+ }
233
+
234
+ /** Every GType this namespace holds a child in without it being a widget. */
235
+ export type ChildHolderGType = keyof ChildHolders;
236
+
237
+ /** The writable, optional, GObject-keyed property surface of one GType. */
238
+ export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
239
+
240
+ /** The signal table this package already emits, reached by GType. */
241
+ export type SignalsOf<G extends WidgetGType> = Widgets[G]['signals'];
242
+
243
+ /** The instance type — what a `ref`-shaped prop should infer. */
244
+ export type InstanceOf<G extends WidgetGType> = Widgets[G]['class'];
245
+
246
+ /** Property names that can only be set at construction. */
247
+ export type ConstructOnlyOf<G extends WidgetGType> = Widgets[G]['constructOnly'];
248
+
249
+ /** Candidate child slots — see the note above; curation decides. */
250
+ export type SlotCandidatesOf<G extends WidgetGType> = keyof Widgets[G]['slotCandidates'];
251
+
252
+ /**
253
+ * The same facts as runtime data, for a consumer that CHECKS them.
254
+ *
255
+ * Types are erased, so a spec that asks the installed GTK whether every property
256
+ * here is a writable ParamSpec, every signal resolvable by `GObject.signal_lookup`
257
+ * and every nick resolvable through an enum lookup cannot read the interfaces
258
+ * above. Emitted headlessly with no GTK present, which is exactly why the checking
259
+ * belongs to the consumer and the DATA belongs here.
260
+ */
261
+ export const PROVENANCE: {
262
+ readonly namespace: string;
263
+ readonly version: string;
264
+ /** The version the LIBRARY states, or null where it states none. Never the namespace's. */
265
+ readonly libraryVersion: string | null;
266
+ readonly childHolders: number;
267
+ readonly droppedBases: readonly string[];
268
+ readonly inlinedBases: readonly string[];
269
+ readonly unsettableProps: readonly string[];
270
+ };
271
+
272
+ /** Declaration GType -> its own settable properties, as GObject registered them. */
273
+ export const OWN_PROPS: Readonly<Record<string, readonly string[]>>;
274
+
275
+ /**
276
+ * Declaration GType -> the signals it registers itself, never its parents'.
277
+ *
278
+ * Keyed like `OWN_PROPS`, so both are read at every link of a `DECLS` chain. An
279
+ * abstract base has no `Widgets` row and still owns signals — `GtkWidget` owns 13.
280
+ */
281
+ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
282
+
283
+ /** Widget GType -> every declaration its members come from, self first. */
284
+ export const DECLS: Readonly<Record<string, readonly string[]>>;
285
+
286
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
287
+ export const CHILD_HOLDERS: readonly string[];
288
+
289
+ /** Enum GType -> the nicks this surface offers. */
290
+ export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
291
+
292
+ /** Widget GType -> slot name -> the method that may adopt a child there. */
293
+ export const SLOT_CANDIDATES: Readonly<Record<string, Readonly<Record<string, string>>>>;
294
+
295
+ /**
296
+ * `Type`, `Type.property` and `Type::signal` -> the release that introduced it.
297
+ *
298
+ * What keeps a runtime cross-check honest across a version gap without an
299
+ * allowlist: a name the installed library lacks is a defect UNLESS the version
300
+ * here is newer than the one running.
301
+ *
302
+ * ALL THREE key shapes, because that test only works for the names it covers. A
303
+ * property-only map leaves a consumer no way to explain a missing SIGNAL, which is
304
+ * a correct vocabulary reported as 18 defects; a member-only map leaves it no way to
305
+ * explain a missing CLASS, and that one fails as a bare
306
+ * `TypeError: can't access property "$gtype", ctor() is undefined` that does not
307
+ * even name the GType.
308
+ *
309
+ * A key is present only where the GIR states a version — sparse by nature (`version`
310
+ * sits on 29 of the 301 classes and interfaces in Gtk-4.0), never inferred.
311
+ */
312
+ export const SINCE: Readonly<Record<string, string>>;
@@ -0,0 +1,77 @@
1
+ // The widget vocabulary of GtkSource-3.0 as runtime data.
2
+ //
3
+ // GENERATED — do not edit. Provenance: GtkSource-3.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object Atk.ImplementorIface
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: 'GtkSource',
11
+ version: '3.0',
12
+ libraryVersion: null,
13
+ childHolders: 0,
14
+ droppedBases: ['GObject.InitiallyUnowned', 'GObject.Object', 'Atk.ImplementorIface'],
15
+ inlinedBases: [],
16
+ unsettableProps: [],
17
+ };
18
+
19
+ export const OWN_PROPS = {
20
+ GtkSourceMap: ['font-desc', 'view'],
21
+ GtkSourceStyleSchemeChooser: ['style-scheme'],
22
+ GtkSourceView: ['auto-indent', 'background-pattern', 'draw-spaces', 'highlight-current-line', 'indent-on-tab', 'indent-width', 'insert-spaces-instead-of-tabs', 'right-margin-position', 'show-line-marks', 'show-line-numbers', 'show-right-margin', 'smart-backspace', 'smart-home-end', 'tab-width'],
23
+ };
24
+
25
+ export const OWN_SIGNALS = {
26
+ GtkSourceCompletionInfo: ['before-show'],
27
+ GtkSourceView: ['change-case', 'change-number', 'join-lines', 'line-mark-activated', 'move-lines', 'move-to-matching-bracket', 'move-words', 'redo', 'show-completion', 'smart-home-end', 'undo'],
28
+ };
29
+
30
+ export const DECLS = {
31
+ GtkSourceCompletionInfo: ['GtkSourceCompletionInfo', 'GtkWindow', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
32
+ GtkSourceMap: ['GtkSourceMap', 'GtkSourceView', 'GtkTextView', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkScrollable'],
33
+ GtkSourceStyleSchemeChooserButton: ['GtkSourceStyleSchemeChooserButton', 'GtkButton', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkActionable', 'GtkActivatable', 'GtkBuildable', 'GtkSourceStyleSchemeChooser'],
34
+ GtkSourceStyleSchemeChooserWidget: ['GtkSourceStyleSchemeChooserWidget', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkSourceStyleSchemeChooser'],
35
+ GtkSourceView: ['GtkSourceView', 'GtkTextView', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkScrollable'],
36
+ };
37
+
38
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
39
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
40
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
41
+ // from a list — the count is in the provenance line above.
42
+ export const CHILD_HOLDERS = [];
43
+
44
+ export const ENUM_NICKS = {
45
+ GtkSourceBackgroundPatternType: ['none', 'grid'],
46
+ GtkSourceBracketMatchType: ['none', 'out-of-range', 'not-found', 'found'],
47
+ GtkSourceChangeCaseType: ['lower', 'upper', 'toggle', 'title'],
48
+ GtkSourceCompressionType: ['none', 'gzip'],
49
+ GtkSourceGutterRendererAlignmentMode: ['cell', 'first', 'last'],
50
+ GtkSourceNewlineType: ['lf', 'cr', 'cr-lf'],
51
+ GtkSourceSmartHomeEndType: ['disabled', 'before', 'after', 'always'],
52
+ GtkSourceViewGutterPosition: ['lines', 'marks'],
53
+ };
54
+
55
+ export const SLOT_CANDIDATES = {
56
+ GtkSourceCompletionInfo: {
57
+ 'widget': 'set_widget',
58
+ },
59
+ GtkSourceMap: {
60
+ 'view': 'set_view',
61
+ },
62
+ };
63
+
64
+ export const SINCE = {
65
+ 'GtkSourceStyleSchemeChooser.style-scheme': '3.16',
66
+ 'GtkSourceView.background-pattern': '3.16',
67
+ 'GtkSourceView.draw-spaces': '2.4',
68
+ 'GtkSourceView.smart-backspace': '3.18',
69
+ 'GtkSourceView.smart-home-end': '2.0',
70
+ 'GtkSourceView::change-case': '3.16',
71
+ 'GtkSourceView::change-number': '3.16',
72
+ 'GtkSourceView::join-lines': '3.16',
73
+ 'GtkSourceView::move-lines': '2.10',
74
+ 'GtkSourceView::move-to-matching-bracket': '3.16',
75
+ 'GtkSourceView::move-words': '3.0',
76
+ 'GtkSourceView::smart-home-end': '3.0',
77
+ };