@girs/xed-1.0 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/xed-1.0)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/xed-1.0)
6
6
 
7
+ GJS TypeScript type definitions for Xed-1.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.5.0.
7
8
 
8
- GJS TypeScript type definitions for Xed-1.0 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/xed-1.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/xed-1.0` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/xed-1.0/ambient` | only the `gi://` module declarations |
27
+ | `@girs/xed-1.0/import` | only the `imports.gi` declarations |
28
+ | `@girs/xed-1.0/xed-1.0` | the namespace, without the side-effecting declarations |
29
+ | `@girs/xed-1.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 Xed from '@girs/xed-1.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/xed-1.0` or `@girs/xed-1.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/xed-1.0'
47
+ import '@girs/xed-1.0';
32
48
  ```
33
49
 
34
- `tsconfig.json`:
35
50
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/xed-1.0"],
41
- ...
42
- }
51
+ { "include": ["@girs/xed-1.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 Xed from 'gi://Xed?version=1.0';
49
58
  ```
50
59
 
51
- ### Global import
60
+ Referencing `@girs/xed-1.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/xed-1.0` or `@girs/xed-1.0/import` in your `tsconfig` or entry point Typescript file:
65
+ GJS's global object works the same way, via `@girs/xed-1.0/import`:
55
66
 
56
- `index.ts`:
57
67
  ```ts
58
- import '@girs/xed-1.0'
68
+ const Xed = imports.gi.Xed;
59
69
  ```
60
70
 
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/xed-1.0"],
68
- ...
69
- }
70
- ```
71
+ ## Widget vocabulary
71
72
 
72
- That form carries types as well:
73
+ `xed-1.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 Xed = imports.gi.Xed;
77
+ import type { Widgets, PropsOf } from '@girs/xed-1.0/vocabulary';
78
+ import { OWN_PROPS, ENUM_NICKS, PROVENANCE } from '@girs/xed-1.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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/xed-1.0",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "GJS TypeScript type definitions for Xed-1.0",
5
5
  "type": "module",
6
6
  "module": "xed-1.0.js",
@@ -16,10 +16,10 @@
16
16
  "import": "./xed-1.0-import.js",
17
17
  "default": "./xed-1.0-import.js"
18
18
  },
19
- "./surface": {
20
- "types": "./xed-1.0-surface.d.ts",
21
- "import": "./xed-1.0-surface.js",
22
- "default": "./xed-1.0-surface.js"
19
+ "./vocabulary": {
20
+ "types": "./xed-1.0-vocabulary.d.ts",
21
+ "import": "./xed-1.0-vocabulary.js",
22
+ "default": "./xed-1.0-vocabulary.js"
23
23
  },
24
24
  "./xed-1.0": {
25
25
  "types": "./xed-1.0.d.ts",
@@ -36,21 +36,21 @@
36
36
  "test": "tsc --project tsconfig.json"
37
37
  },
38
38
  "dependencies": {
39
- "@girs/gjs": "^4.4.0",
40
- "@girs/gtksource-4": "^4.4.0",
41
- "@girs/gtk-3.0": "^4.4.0",
42
- "@girs/xlib-2.0": "^4.4.0",
43
- "@girs/gdk-3.0": "^4.4.0",
44
- "@girs/cairo-1.0": "^4.4.0",
45
- "@girs/gobject-2.0": "^4.4.0",
46
- "@girs/glib-2.0": "^4.4.0",
47
- "@girs/pango-1.0": "^4.4.0",
48
- "@girs/harfbuzz-0.0": "^4.4.0",
49
- "@girs/freetype2-2.0": "^4.4.0",
50
- "@girs/gio-2.0": "^4.4.0",
51
- "@girs/gmodule-2.0": "^4.4.0",
52
- "@girs/gdkpixbuf-2.0": "^4.4.0",
53
- "@girs/atk-1.0": "^4.4.0" },
39
+ "@girs/gjs": "^4.5.0",
40
+ "@girs/gtksource-4": "^4.5.0",
41
+ "@girs/gtk-3.0": "^4.5.0",
42
+ "@girs/xlib-2.0": "^4.5.0",
43
+ "@girs/gdk-3.0": "^4.5.0",
44
+ "@girs/cairo-1.0": "^4.5.0",
45
+ "@girs/gobject-2.0": "^4.5.0",
46
+ "@girs/glib-2.0": "^4.5.0",
47
+ "@girs/pango-1.0": "^4.5.0",
48
+ "@girs/harfbuzz-0.0": "^4.5.0",
49
+ "@girs/freetype2-2.0": "^4.5.0",
50
+ "@girs/gio-2.0": "^4.5.0",
51
+ "@girs/gmodule-2.0": "^4.5.0",
52
+ "@girs/gdkpixbuf-2.0": "^4.5.0",
53
+ "@girs/atk-1.0": "^4.5.0" },
54
54
  "devDependencies": {
55
55
  "typescript": "*"
56
56
  },
package/tsconfig.json CHANGED
@@ -65,7 +65,7 @@
65
65
  ]
66
66
  }
67
67
  },
68
- "include": ["./xed-1.0.d.ts","./xed-1.0-surface.d.ts"]
68
+ "include": ["./xed-1.0.d.ts","./xed-1.0-vocabulary.d.ts"]
69
69
  }
70
70
 
71
71
 
@@ -0,0 +1,302 @@
1
+ /**
2
+ * The GIR-derived widget VOCABULARY for Xed-1.0.
3
+ *
4
+ * GENERATED — do not edit. Provenance: Xed-1.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object Atk.ImplementorIface Gio.ActionGroup Gio.ActionMap
5
+ *
6
+ * 10 concrete widgets, 10 declarations, 2 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 Gtk from '@girs/gtk-3.0';
28
+ import type Xed from './xed-1.0.js';
29
+ import type { GtkApplicationWindowConstructOnly, GtkApplicationWindowProps, GtkBinConstructOnly, GtkBinProps, GtkBoxConstructOnly, GtkBoxProps, GtkBuildableConstructOnly, GtkBuildableProps, GtkCellEditableConstructOnly, GtkCellEditableProps, GtkCellLayoutConstructOnly, GtkCellLayoutProps, GtkComboBoxConstructOnly, GtkComboBoxProps, GtkContainerConstructOnly, GtkContainerProps, GtkDialogConstructOnly, GtkDialogProps, GtkFileChooserConstructOnly, GtkFileChooserDialogConstructOnly, GtkFileChooserDialogProps, GtkFileChooserProps, GtkInfoBarConstructOnly, GtkInfoBarProps, GtkNotebookConstructOnly, GtkNotebookProps, GtkOrientableConstructOnly, GtkOrientableProps, GtkOrientationNick, GtkScrollableConstructOnly, GtkScrollableProps, GtkStatusbarConstructOnly, GtkStatusbarProps, GtkTextViewConstructOnly, GtkTextViewProps, GtkWidgetConstructOnly, GtkWidgetProps, GtkWindowConstructOnly, GtkWindowProps } from '@girs/gtk-3.0/vocabulary';
30
+ import type { GtkSourceViewConstructOnly, GtkSourceViewProps } from '@girs/gtksource-4/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
+ export type XedSearchModeNick = 'search' | 'replace';
43
+ export type XedTabStateNick = 'state-normal' | 'state-loading' | 'state-reverting' | 'state-saving' | 'state-printing' | 'state-print-previewing' | 'state-showing-print-preview' | 'state-generic-not-editable' | 'state-loading-error' | 'state-reverting-error' | 'state-saving-error' | 'state-generic-error' | 'state-closing' | 'state-externally-modified-notification' | 'num-of-states';
44
+
45
+ // ---------------------------------------------------------------------------
46
+ // Property surfaces — one interface per GIR DECLARATION, mirroring GIR's own
47
+ // inheritance rather than flattening per widget.
48
+ //
49
+ // The interfaces are load-bearing, not tidiness: `GtkBox` declares four properties
50
+ // of its own and `orientation` is not among them — it lives on `Gtk.Orientable`,
51
+ // because GObject installs interface properties on the implementor at runtime while
52
+ // GIR keeps them once, on the interface.
53
+ // ---------------------------------------------------------------------------
54
+
55
+ export interface XedEncodingsComboBoxProps extends GtkComboBoxProps, GtkBuildableProps, GtkCellEditableProps, GtkCellLayoutProps {
56
+ /** @default FALSE */
57
+ 'save-mode'?: boolean;
58
+ }
59
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
60
+ export type XedEncodingsComboBoxConstructOnly = GtkComboBoxConstructOnly | GtkBuildableConstructOnly | GtkCellEditableConstructOnly | GtkCellLayoutConstructOnly;
61
+
62
+ export interface XedFileChooserDialogProps extends GtkFileChooserDialogProps, GtkBuildableProps, GtkFileChooserProps {
63
+ }
64
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
65
+ export type XedFileChooserDialogConstructOnly = GtkFileChooserDialogConstructOnly | GtkBuildableConstructOnly | GtkFileChooserConstructOnly;
66
+
67
+ export interface XedNotebookProps extends GtkNotebookProps, GtkBuildableProps {
68
+ }
69
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
70
+ export type XedNotebookConstructOnly = GtkNotebookConstructOnly | GtkBuildableConstructOnly;
71
+
72
+ export interface XedPanelProps extends GtkBinProps, GtkBuildableProps {
73
+ /** @default GTK_ORIENTATION_VERTICAL */
74
+ orientation?: GtkOrientationNick | Gtk.Orientation;
75
+ }
76
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
77
+ export type XedPanelConstructOnly = GtkBinConstructOnly | GtkBuildableConstructOnly | 'orientation';
78
+
79
+ export interface XedProgressInfoBarProps extends GtkInfoBarProps, GtkBuildableProps, GtkOrientableProps {
80
+ /** @default TRUE */
81
+ 'has-cancel-button'?: boolean;
82
+ }
83
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
84
+ export type XedProgressInfoBarConstructOnly = GtkInfoBarConstructOnly | GtkBuildableConstructOnly | GtkOrientableConstructOnly | 'has-cancel-button';
85
+
86
+ export interface XedSearchbarProps extends GtkBoxProps, GtkBuildableProps, GtkOrientableProps {
87
+ }
88
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
89
+ export type XedSearchbarConstructOnly = GtkBoxConstructOnly | GtkBuildableConstructOnly | GtkOrientableConstructOnly;
90
+
91
+ export interface XedStatusbarProps extends GtkStatusbarProps, GtkBuildableProps, GtkOrientableProps {
92
+ }
93
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
94
+ export type XedStatusbarConstructOnly = GtkStatusbarConstructOnly | GtkBuildableConstructOnly | GtkOrientableConstructOnly;
95
+
96
+ export interface XedTabProps extends GtkBoxProps, GtkBuildableProps, GtkOrientableProps {
97
+ /** @default TRUE */
98
+ autosave?: boolean;
99
+ /** @default 0 */
100
+ 'autosave-interval'?: number;
101
+ }
102
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
103
+ export type XedTabConstructOnly = GtkBoxConstructOnly | GtkBuildableConstructOnly | GtkOrientableConstructOnly;
104
+
105
+ export interface XedViewProps extends GtkSourceViewProps, GtkBuildableProps, GtkScrollableProps {
106
+ }
107
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
108
+ export type XedViewConstructOnly = GtkSourceViewConstructOnly | GtkBuildableConstructOnly | GtkScrollableConstructOnly;
109
+
110
+ export interface XedWindowProps extends GtkApplicationWindowProps, GtkBuildableProps {
111
+ }
112
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
113
+ export type XedWindowConstructOnly = GtkApplicationWindowConstructOnly | GtkBuildableConstructOnly;
114
+
115
+ // ---------------------------------------------------------------------------
116
+ // The GType-keyed widget map.
117
+ //
118
+ // Keyed by GType because that is also the GtkBuilder XML key and the typelib key. A
119
+ // consumer maps GTypes to tags in ITS convention — kebab for JSX intrinsics, Pascal
120
+ // for a Vue `GlobalComponents`, the class itself for a renderer whose element type
121
+ // is the class. None of those is baked in here.
122
+ //
123
+ // `slotCandidates` is a candidate list and never an answer: derived from methods
124
+ // taking exactly one widget argument. The GIR cannot tell adoption from reference —
125
+ // `set_title_widget` parents its argument and `set_activatable_widget` does not, and
126
+ // both are `void f(GtkWidget*)` at `transfer-ownership="none"`. Curation decides;
127
+ // this is what notices when a release adds a candidate.
128
+ // ---------------------------------------------------------------------------
129
+
130
+ export interface Widgets {
131
+ XedEncodingsComboBox: {
132
+ class: Xed.EncodingsComboBox;
133
+ props: XedEncodingsComboBoxProps;
134
+ signals: Xed.EncodingsComboBox.SignalSignatures;
135
+ constructOnly: XedEncodingsComboBoxConstructOnly;
136
+ slotCandidates: {};
137
+ };
138
+ XedFileChooserDialog: {
139
+ class: Xed.FileChooserDialog;
140
+ props: XedFileChooserDialogProps;
141
+ signals: Xed.FileChooserDialog.SignalSignatures;
142
+ constructOnly: XedFileChooserDialogConstructOnly;
143
+ slotCandidates: {};
144
+ };
145
+ XedNotebook: {
146
+ class: Xed.Notebook;
147
+ props: XedNotebookProps;
148
+ signals: Xed.Notebook.SignalSignatures;
149
+ constructOnly: XedNotebookConstructOnly;
150
+ slotCandidates: {};
151
+ };
152
+ XedPanel: {
153
+ class: Xed.Panel;
154
+ props: XedPanelProps;
155
+ signals: Xed.Panel.SignalSignatures;
156
+ constructOnly: XedPanelConstructOnly;
157
+ slotCandidates: {};
158
+ };
159
+ XedProgressInfoBar: {
160
+ class: Xed.ProgressInfoBar;
161
+ props: XedProgressInfoBarProps;
162
+ signals: Xed.ProgressInfoBar.SignalSignatures;
163
+ constructOnly: XedProgressInfoBarConstructOnly;
164
+ slotCandidates: {};
165
+ };
166
+ XedSearchbar: {
167
+ class: Xed.Searchbar;
168
+ props: XedSearchbarProps;
169
+ signals: Xed.Searchbar.SignalSignatures;
170
+ constructOnly: XedSearchbarConstructOnly;
171
+ slotCandidates: {};
172
+ };
173
+ XedStatusbar: {
174
+ class: Xed.Statusbar;
175
+ props: XedStatusbarProps;
176
+ signals: Xed.Statusbar.SignalSignatures;
177
+ constructOnly: XedStatusbarConstructOnly;
178
+ slotCandidates: {};
179
+ };
180
+ XedTab: {
181
+ class: Xed.Tab;
182
+ props: XedTabProps;
183
+ signals: Xed.Tab.SignalSignatures;
184
+ constructOnly: XedTabConstructOnly;
185
+ slotCandidates: {
186
+ 'info-bar': 'set_info_bar';
187
+ };
188
+ };
189
+ XedView: {
190
+ class: Xed.View;
191
+ props: XedViewProps;
192
+ signals: Xed.View.SignalSignatures;
193
+ constructOnly: XedViewConstructOnly;
194
+ slotCandidates: {};
195
+ };
196
+ XedWindow: {
197
+ class: Xed.Window;
198
+ props: XedWindowProps;
199
+ signals: Xed.Window.SignalSignatures;
200
+ constructOnly: XedWindowConstructOnly;
201
+ slotCandidates: {
202
+ 'active-tab': 'set_active_tab';
203
+ };
204
+ };
205
+ }
206
+
207
+ /** Every GType this namespace can create. A consumer derives its own tag map. */
208
+ export type WidgetGType = keyof Widgets;
209
+
210
+ // ---------------------------------------------------------------------------
211
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
212
+ //
213
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
214
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
215
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
216
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
217
+ // more rows in `Widgets`: concatenate them when you mean both.
218
+ // ---------------------------------------------------------------------------
219
+
220
+ export interface ChildHolders {
221
+
222
+ }
223
+
224
+ /** Every GType this namespace holds a child in without it being a widget. */
225
+ export type ChildHolderGType = keyof ChildHolders;
226
+
227
+ /** The writable, optional, GObject-keyed property surface of one GType. */
228
+ export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
229
+
230
+ /** The signal table this package already emits, reached by GType. */
231
+ export type SignalsOf<G extends WidgetGType> = Widgets[G]['signals'];
232
+
233
+ /** The instance type — what a `ref`-shaped prop should infer. */
234
+ export type InstanceOf<G extends WidgetGType> = Widgets[G]['class'];
235
+
236
+ /** Property names that can only be set at construction. */
237
+ export type ConstructOnlyOf<G extends WidgetGType> = Widgets[G]['constructOnly'];
238
+
239
+ /** Candidate child slots — see the note above; curation decides. */
240
+ export type SlotCandidatesOf<G extends WidgetGType> = keyof Widgets[G]['slotCandidates'];
241
+
242
+ /**
243
+ * The same facts as runtime data, for a consumer that CHECKS them.
244
+ *
245
+ * Types are erased, so a spec that asks the installed GTK whether every property
246
+ * here is a writable ParamSpec, every signal resolvable by `GObject.signal_lookup`
247
+ * and every nick resolvable through an enum lookup cannot read the interfaces
248
+ * above. Emitted headlessly with no GTK present, which is exactly why the checking
249
+ * belongs to the consumer and the DATA belongs here.
250
+ */
251
+ export const PROVENANCE: {
252
+ readonly namespace: string;
253
+ readonly version: string;
254
+ /** The version the LIBRARY states, or null where it states none. Never the namespace's. */
255
+ readonly libraryVersion: string | null;
256
+ readonly childHolders: number;
257
+ readonly droppedBases: readonly string[];
258
+ readonly inlinedBases: readonly string[];
259
+ readonly unsettableProps: readonly string[];
260
+ };
261
+
262
+ /** Declaration GType -> its own settable properties, as GObject registered them. */
263
+ export const OWN_PROPS: Readonly<Record<string, readonly string[]>>;
264
+
265
+ /**
266
+ * Declaration GType -> the signals it registers itself, never its parents'.
267
+ *
268
+ * Keyed like `OWN_PROPS`, so both are read at every link of a `DECLS` chain. An
269
+ * abstract base has no `Widgets` row and still owns signals — `GtkWidget` owns 13.
270
+ */
271
+ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
272
+
273
+ /** Widget GType -> every declaration its members come from, self first. */
274
+ export const DECLS: Readonly<Record<string, readonly string[]>>;
275
+
276
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
277
+ export const CHILD_HOLDERS: readonly string[];
278
+
279
+ /** Enum GType -> the nicks this surface offers. */
280
+ export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
281
+
282
+ /** Widget GType -> slot name -> the method that may adopt a child there. */
283
+ export const SLOT_CANDIDATES: Readonly<Record<string, Readonly<Record<string, string>>>>;
284
+
285
+ /**
286
+ * `Type`, `Type.property` and `Type::signal` -> the release that introduced it.
287
+ *
288
+ * What keeps a runtime cross-check honest across a version gap without an
289
+ * allowlist: a name the installed library lacks is a defect UNLESS the version
290
+ * here is newer than the one running.
291
+ *
292
+ * ALL THREE key shapes, because that test only works for the names it covers. A
293
+ * property-only map leaves a consumer no way to explain a missing SIGNAL, which is
294
+ * a correct vocabulary reported as 18 defects; a member-only map leaves it no way to
295
+ * explain a missing CLASS, and that one fails as a bare
296
+ * `TypeError: can't access property "$gtype", ctor() is undefined` that does not
297
+ * even name the GType.
298
+ *
299
+ * A key is present only where the GIR states a version — sparse by nature (`version`
300
+ * sits on 29 of the 301 classes and interfaces in Gtk-4.0), never inferred.
301
+ */
302
+ export const SINCE: Readonly<Record<string, string>>;
@@ -0,0 +1,66 @@
1
+ // The widget vocabulary of Xed-1.0 as runtime data.
2
+ //
3
+ // GENERATED — do not edit. Provenance: Xed-1.0 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object Atk.ImplementorIface Gio.ActionGroup Gio.ActionMap
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: 'Xed',
11
+ version: '1.0',
12
+ libraryVersion: null,
13
+ childHolders: 0,
14
+ droppedBases: ['GObject.InitiallyUnowned', 'GObject.Object', 'Atk.ImplementorIface', 'Gio.ActionGroup', 'Gio.ActionMap'],
15
+ inlinedBases: [],
16
+ unsettableProps: [],
17
+ };
18
+
19
+ export const OWN_PROPS = {
20
+ XedEncodingsComboBox: ['save-mode'],
21
+ XedPanel: ['orientation'],
22
+ XedProgressInfoBar: ['has-cancel-button'],
23
+ XedTab: ['autosave', 'autosave-interval'],
24
+ };
25
+
26
+ export const OWN_SIGNALS = {
27
+ XedNotebook: ['tab-added', 'tab-close-request', 'tab-detached', 'tab-removed', 'tabs-reordered'],
28
+ XedPanel: ['close', 'focus-document', 'item-added', 'item-removed'],
29
+ XedView: ['drop-uris'],
30
+ XedWindow: ['active-tab-changed', 'active-tab-state-changed', 'tab-added', 'tab-removed', 'tabs-reordered'],
31
+ };
32
+
33
+ export const DECLS = {
34
+ XedEncodingsComboBox: ['XedEncodingsComboBox', 'GtkComboBox', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkCellEditable', 'GtkCellLayout'],
35
+ XedFileChooserDialog: ['XedFileChooserDialog', 'GtkFileChooserDialog', 'GtkDialog', 'GtkWindow', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkFileChooser'],
36
+ XedNotebook: ['XedNotebook', 'GtkNotebook', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
37
+ XedPanel: ['XedPanel', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
38
+ XedProgressInfoBar: ['XedProgressInfoBar', 'GtkInfoBar', 'GtkBox', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkOrientable'],
39
+ XedSearchbar: ['XedSearchbar', 'GtkBox', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkOrientable'],
40
+ XedStatusbar: ['XedStatusbar', 'GtkStatusbar', 'GtkBox', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkOrientable'],
41
+ XedTab: ['XedTab', 'GtkBox', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkOrientable'],
42
+ XedView: ['XedView', 'GtkSourceView', 'GtkTextView', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkScrollable'],
43
+ XedWindow: ['XedWindow', 'GtkApplicationWindow', 'GtkWindow', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
44
+ };
45
+
46
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
47
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
48
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
49
+ // from a list — the count is in the provenance line above.
50
+ export const CHILD_HOLDERS = [];
51
+
52
+ export const ENUM_NICKS = {
53
+ XedSearchMode: ['search', 'replace'],
54
+ XedTabState: ['state-normal', 'state-loading', 'state-reverting', 'state-saving', 'state-printing', 'state-print-previewing', 'state-showing-print-preview', 'state-generic-not-editable', 'state-loading-error', 'state-reverting-error', 'state-saving-error', 'state-generic-error', 'state-closing', 'state-externally-modified-notification', 'num-of-states'],
55
+ };
56
+
57
+ export const SLOT_CANDIDATES = {
58
+ XedTab: {
59
+ 'info-bar': 'set_info_bar',
60
+ },
61
+ XedWindow: {
62
+ 'active-tab': 'set_active_tab',
63
+ },
64
+ };
65
+
66
+ export const SINCE = {};
package/xed-1.0.d.ts CHANGED
@@ -44,8 +44,8 @@ export namespace Xed {
44
44
  * @gir-type Enum
45
45
  */
46
46
  enum SearchMode {
47
- SEARCH,
48
- REPLACE,
47
+ SEARCH = 0,
48
+ REPLACE = 1,
49
49
  }
50
50
 
51
51
 
@@ -60,28 +60,37 @@ export namespace Xed {
60
60
  * @gir-type Enum
61
61
  */
62
62
  enum TabState {
63
- STATE_NORMAL,
64
- STATE_LOADING,
65
- STATE_REVERTING,
66
- STATE_SAVING,
67
- STATE_PRINTING,
68
- STATE_PRINT_PREVIEWING,
69
- STATE_SHOWING_PRINT_PREVIEW,
70
- STATE_GENERIC_NOT_EDITABLE,
71
- STATE_LOADING_ERROR,
72
- STATE_REVERTING_ERROR,
73
- STATE_SAVING_ERROR,
74
- STATE_GENERIC_ERROR,
75
- STATE_CLOSING,
76
- STATE_EXTERNALLY_MODIFIED_NOTIFICATION,
77
- NUM_OF_STATES,
63
+ STATE_NORMAL = 0,
64
+ STATE_LOADING = 1,
65
+ STATE_REVERTING = 2,
66
+ STATE_SAVING = 3,
67
+ STATE_PRINTING = 4,
68
+ STATE_PRINT_PREVIEWING = 5,
69
+ STATE_SHOWING_PRINT_PREVIEW = 6,
70
+ STATE_GENERIC_NOT_EDITABLE = 7,
71
+ STATE_LOADING_ERROR = 8,
72
+ STATE_REVERTING_ERROR = 9,
73
+ STATE_SAVING_ERROR = 10,
74
+ STATE_GENERIC_ERROR = 11,
75
+ STATE_CLOSING = 12,
76
+ STATE_EXTERNALLY_MODIFIED_NOTIFICATION = 13,
77
+ NUM_OF_STATES = 14,
78
78
  }
79
79
 
80
80
 
81
+ /**
82
+ * @default metadata::xed-encoding
83
+ */
81
84
  const METADATA_ATTRIBUTE_ENCODING: string;
82
85
 
86
+ /**
87
+ * @default metadata::xed-language
88
+ */
83
89
  const METADATA_ATTRIBUTE_LANGUAGE: string;
84
90
 
91
+ /**
92
+ * @default metadata::xed-position
93
+ */
85
94
  const METADATA_ATTRIBUTE_POSITION: string;
86
95
 
87
96
  /**
@@ -314,22 +323,22 @@ export namespace Xed {
314
323
  * @gir-type Flags
315
324
  */
316
325
  enum DebugSection {
317
- NO_DEBUG,
318
- DEBUG_VIEW,
319
- DEBUG_SEARCH,
320
- DEBUG_PRINT,
321
- DEBUG_PREFS,
322
- DEBUG_PLUGINS,
323
- DEBUG_TAB,
324
- DEBUG_DOCUMENT,
325
- DEBUG_COMMANDS,
326
- DEBUG_APP,
327
- DEBUG_SESSION,
328
- DEBUG_UTILS,
329
- DEBUG_METADATA,
330
- DEBUG_WINDOW,
331
- DEBUG_LOADER,
332
- DEBUG_SAVER,
326
+ NO_DEBUG = 0,
327
+ DEBUG_VIEW = 1,
328
+ DEBUG_SEARCH = 2,
329
+ DEBUG_PRINT = 4,
330
+ DEBUG_PREFS = 8,
331
+ DEBUG_PLUGINS = 16,
332
+ DEBUG_TAB = 32,
333
+ DEBUG_DOCUMENT = 64,
334
+ DEBUG_COMMANDS = 128,
335
+ DEBUG_APP = 256,
336
+ DEBUG_SESSION = 512,
337
+ DEBUG_UTILS = 1024,
338
+ DEBUG_METADATA = 2048,
339
+ DEBUG_WINDOW = 4096,
340
+ DEBUG_LOADER = 8192,
341
+ DEBUG_SAVER = 16384,
333
342
  }
334
343
 
335
344
 
@@ -344,12 +353,12 @@ export namespace Xed {
344
353
  * @gir-type Flags
345
354
  */
346
355
  enum WindowState {
347
- NORMAL,
348
- SAVING,
349
- PRINTING,
350
- LOADING,
351
- ERROR,
352
- SAVING_SESSION,
356
+ NORMAL = 0,
357
+ SAVING = 2,
358
+ PRINTING = 4,
359
+ LOADING = 8,
360
+ ERROR = 16,
361
+ SAVING_SESSION = 32,
353
362
  }
354
363
 
355
364
 
@@ -1547,6 +1556,7 @@ export namespace Xed {
1547
1556
  * @param folder filename of the folder to add
1548
1557
  * @returns `true` if the folder could be added successfully, `false` otherwise. In the latter case, the `error` will be set as appropriate.
1549
1558
  * @since 2.4
1559
+ * @throws GLib.Error
1550
1560
  */
1551
1561
  add_shortcut_folder(folder: string): boolean;
1552
1562
 
@@ -1558,6 +1568,7 @@ export namespace Xed {
1558
1568
  * @param uri URI of the folder to add
1559
1569
  * @returns `true` if the folder could be added successfully, `false` otherwise. In the latter case, the `error` will be set as appropriate.
1560
1570
  * @since 2.4
1571
+ * @throws GLib.Error
1561
1572
  */
1562
1573
  add_shortcut_folder_uri(uri: string): boolean;
1563
1574
 
@@ -1840,6 +1851,7 @@ export namespace Xed {
1840
1851
  * @param folder filename of the folder to remove
1841
1852
  * @returns `true` if the operation succeeds, `false` otherwise. In the latter case, the `error` will be set as appropriate. See also: `gtk_file_chooser_add_shortcut_folder()`
1842
1853
  * @since 2.4
1854
+ * @throws GLib.Error
1843
1855
  */
1844
1856
  remove_shortcut_folder(folder: string): boolean;
1845
1857
 
@@ -1848,6 +1860,7 @@ export namespace Xed {
1848
1860
  * @param uri URI of the folder to remove
1849
1861
  * @returns `true` if the operation succeeds, `false` otherwise. In the latter case, the `error` will be set as appropriate. See also: `gtk_file_chooser_add_shortcut_folder_uri()`
1850
1862
  * @since 2.4
1863
+ * @throws GLib.Error
1851
1864
  */
1852
1865
  remove_shortcut_folder_uri(uri: string): boolean;
1853
1866
 
@@ -1863,6 +1876,7 @@ export namespace Xed {
1863
1876
  * @param file the file to select
1864
1877
  * @returns Not useful.
1865
1878
  * @since 2.14
1879
+ * @throws GLib.Error
1866
1880
  */
1867
1881
  select_file(file: Gio.File): boolean;
1868
1882
 
@@ -1936,6 +1950,7 @@ export namespace Xed {
1936
1950
  * @param file the {@link Gio.File} for the new folder
1937
1951
  * @returns `true` if the folder could be changed successfully, `false` otherwise.
1938
1952
  * @since 2.14
1953
+ * @throws GLib.Error
1939
1954
  */
1940
1955
  set_current_folder_file(file: Gio.File): boolean;
1941
1956
 
@@ -2032,6 +2047,7 @@ export namespace Xed {
2032
2047
  * @param file the {@link Gio.File} to set as current
2033
2048
  * @returns Not useful.
2034
2049
  * @since 2.14
2050
+ * @throws GLib.Error
2035
2051
  */
2036
2052
  set_file(file: Gio.File): boolean;
2037
2053
 
@@ -2384,21 +2400,21 @@ export namespace Xed {
2384
2400
  * @signal
2385
2401
  * @run-last
2386
2402
  */
2387
- dispatch: (arg0: Message) => void;
2403
+ dispatch: (message: Message) => void;
2388
2404
  /**
2389
2405
  * The "registered" signal is emitted when a message has been registered
2390
2406
  * on the bus.
2391
2407
  * @signal
2392
2408
  * @run-last
2393
2409
  */
2394
- registered: (arg0: MessageType) => void;
2410
+ registered: (message_type: MessageType) => void;
2395
2411
  /**
2396
2412
  * The "unregistered" signal is emitted when a message has been
2397
2413
  * unregistered from the bus.
2398
2414
  * @signal
2399
2415
  * @run-last
2400
2416
  */
2401
- unregistered: (arg0: MessageType) => void;
2417
+ unregistered: (message_type: MessageType) => void;
2402
2418
  }
2403
2419
 
2404
2420
  // Constructor properties interface
@@ -2597,22 +2613,22 @@ export namespace Xed {
2597
2613
  * @signal
2598
2614
  * @run-first
2599
2615
  */
2600
- "tab-added": (arg0: Tab) => void;
2616
+ "tab-added": (object: Tab) => void;
2601
2617
  /**
2602
2618
  * @signal
2603
2619
  * @run-last
2604
2620
  */
2605
- "tab-close-request": (arg0: Tab) => void;
2621
+ "tab-close-request": (object: Tab) => void;
2606
2622
  /**
2607
2623
  * @signal
2608
2624
  * @run-first
2609
2625
  */
2610
- "tab-detached": (arg0: Tab) => void;
2626
+ "tab-detached": (object: Tab) => void;
2611
2627
  /**
2612
2628
  * @signal
2613
2629
  * @run-first
2614
2630
  */
2615
- "tab-removed": (arg0: Tab) => void;
2631
+ "tab-removed": (object: Tab) => void;
2616
2632
  /**
2617
2633
  * @signal
2618
2634
  * @run-first
@@ -2845,12 +2861,12 @@ export namespace Xed {
2845
2861
  * @signal
2846
2862
  * @run-first
2847
2863
  */
2848
- "item-added": (arg0: Gtk.Widget) => void;
2864
+ "item-added": (object: Gtk.Widget) => void;
2849
2865
  /**
2850
2866
  * @signal
2851
2867
  * @run-first
2852
2868
  */
2853
- "item-removed": (arg0: Gtk.Widget) => void;
2869
+ "item-removed": (object: Gtk.Widget) => void;
2854
2870
  "notify::orientation": (pspec: GObject.ParamSpec) => void;
2855
2871
  "notify::border-width": (pspec: GObject.ParamSpec) => void;
2856
2872
  "notify::child": (pspec: GObject.ParamSpec) => void;
@@ -3674,7 +3690,7 @@ export namespace Xed {
3674
3690
  * @action
3675
3691
  * @run-last
3676
3692
  */
3677
- "drop-uris": (arg0: string[]) => void;
3693
+ "drop-uris": (object: string[]) => void;
3678
3694
  "notify::auto-indent": (pspec: GObject.ParamSpec) => void;
3679
3695
  "notify::background-pattern": (pspec: GObject.ParamSpec) => void;
3680
3696
  "notify::completion": (pspec: GObject.ParamSpec) => void;
@@ -3867,7 +3883,7 @@ export namespace Xed {
3867
3883
  * @signal
3868
3884
  * @run-first
3869
3885
  */
3870
- "active-tab-changed": (arg0: Tab) => void;
3886
+ "active-tab-changed": (object: Tab) => void;
3871
3887
  /**
3872
3888
  * @signal
3873
3889
  * @run-first
@@ -3877,12 +3893,12 @@ export namespace Xed {
3877
3893
  * @signal
3878
3894
  * @run-first
3879
3895
  */
3880
- "tab-added": (arg0: Tab) => void;
3896
+ "tab-added": (object: Tab) => void;
3881
3897
  /**
3882
3898
  * @signal
3883
3899
  * @run-first
3884
3900
  */
3885
- "tab-removed": (arg0: Tab) => void;
3901
+ "tab-removed": (object: Tab) => void;
3886
3902
  /**
3887
3903
  * @signal
3888
3904
  * @run-first