@girs/xreaderview-1.5 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/xreaderview-1.5)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/xreaderview-1.5)
6
6
 
7
+ GJS TypeScript type definitions for XreaderView-1.5 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.5.0.
7
8
 
8
- GJS TypeScript type definitions for XreaderView-1.5 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/xreaderview-1.5
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/xreaderview-1.5` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/xreaderview-1.5/ambient` | only the `gi://` module declarations |
27
+ | `@girs/xreaderview-1.5/import` | only the `imports.gi` declarations |
28
+ | `@girs/xreaderview-1.5/xreaderview-1.5` | the namespace, without the side-effecting declarations |
29
+ | `@girs/xreaderview-1.5/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 XreaderView from '@girs/xreaderview-1.5';
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/xreaderview-1.5` or `@girs/xreaderview-1.5/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/xreaderview-1.5'
47
+ import '@girs/xreaderview-1.5';
32
48
  ```
33
49
 
34
- `tsconfig.json`:
35
50
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/xreaderview-1.5"],
41
- ...
42
- }
51
+ { "include": ["@girs/xreaderview-1.5"] }
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 XreaderView from 'gi://XreaderView?version=1.5';
49
58
  ```
50
59
 
51
- ### Global import
60
+ Referencing `@girs/xreaderview-1.5/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/xreaderview-1.5` or `@girs/xreaderview-1.5/import` in your `tsconfig` or entry point Typescript file:
65
+ GJS's global object works the same way, via `@girs/xreaderview-1.5/import`:
55
66
 
56
- `index.ts`:
57
67
  ```ts
58
- import '@girs/xreaderview-1.5'
68
+ const XreaderView = imports.gi.XreaderView;
59
69
  ```
60
70
 
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/xreaderview-1.5"],
68
- ...
69
- }
70
- ```
71
+ ## Widget vocabulary
71
72
 
72
- That form carries types as well:
73
+ `xreaderview-1.5` 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 XreaderView = imports.gi.XreaderView;
77
+ import type { Widgets, PropsOf } from '@girs/xreaderview-1.5/vocabulary';
78
+ import { OWN_PROPS, ENUM_NICKS, PROVENANCE } from '@girs/xreaderview-1.5/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/xreaderview-1.5",
3
- "version": "4.3.0",
3
+ "version": "4.5.0",
4
4
  "description": "GJS TypeScript type definitions for XreaderView-1.5",
5
5
  "type": "module",
6
6
  "module": "xreaderview-1.5.js",
@@ -16,10 +16,10 @@
16
16
  "import": "./xreaderview-1.5-import.js",
17
17
  "default": "./xreaderview-1.5-import.js"
18
18
  },
19
- "./surface": {
20
- "types": "./xreaderview-1.5-surface.d.ts",
21
- "import": "./xreaderview-1.5-surface.js",
22
- "default": "./xreaderview-1.5-surface.js"
19
+ "./vocabulary": {
20
+ "types": "./xreaderview-1.5-vocabulary.d.ts",
21
+ "import": "./xreaderview-1.5-vocabulary.js",
22
+ "default": "./xreaderview-1.5-vocabulary.js"
23
23
  },
24
24
  "./xreaderview-1.5": {
25
25
  "types": "./xreaderview-1.5.d.ts",
@@ -36,21 +36,21 @@
36
36
  "test": "tsc --project tsconfig.json"
37
37
  },
38
38
  "dependencies": {
39
- "@girs/gjs": "^4.3.0",
40
- "@girs/xreaderdocument-1.5": "^4.3.0",
41
- "@girs/gtk-3.0": "^4.3.0",
42
- "@girs/xlib-2.0": "^4.3.0",
43
- "@girs/gdk-3.0": "^4.3.0",
44
- "@girs/cairo-1.0": "^4.3.0",
45
- "@girs/gobject-2.0": "^4.3.0",
46
- "@girs/glib-2.0": "^4.3.0",
47
- "@girs/pango-1.0": "^4.3.0",
48
- "@girs/harfbuzz-0.0": "^4.3.0",
49
- "@girs/freetype2-2.0": "^4.3.0",
50
- "@girs/gio-2.0": "^4.3.0",
51
- "@girs/gmodule-2.0": "^4.3.0",
52
- "@girs/gdkpixbuf-2.0": "^4.3.0",
53
- "@girs/atk-1.0": "^4.3.0" },
39
+ "@girs/gjs": "^4.5.0",
40
+ "@girs/xreaderdocument-1.5": "^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": ["./xreaderview-1.5.d.ts","./xreaderview-1.5-surface.d.ts"]
68
+ "include": ["./xreaderview-1.5.d.ts","./xreaderview-1.5-vocabulary.d.ts"]
69
69
  }
70
70
 
71
71
 
@@ -102,6 +102,23 @@ export interface Widgets {
102
102
  /** Every GType this namespace can create. A consumer derives its own tag map. */
103
103
  export type WidgetGType = keyof Widgets;
104
104
 
105
+ // ---------------------------------------------------------------------------
106
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
107
+ //
108
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
109
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
110
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
111
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
112
+ // more rows in `Widgets`: concatenate them when you mean both.
113
+ // ---------------------------------------------------------------------------
114
+
115
+ export interface ChildHolders {
116
+
117
+ }
118
+
119
+ /** Every GType this namespace holds a child in without it being a widget. */
120
+ export type ChildHolderGType = keyof ChildHolders;
121
+
105
122
  /** The writable, optional, GObject-keyed property surface of one GType. */
106
123
  export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
107
124
 
@@ -137,6 +154,9 @@ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
137
154
  /** Widget GType -> every declaration its members come from, self first. */
138
155
  export const DECLS: Readonly<Record<string, readonly string[]>>;
139
156
 
157
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
158
+ export const CHILD_HOLDERS: readonly string[];
159
+
140
160
  /** Enum GType -> the nicks this surface offers. */
141
161
  export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
142
162
 
@@ -22,6 +22,12 @@ export const DECLS = {
22
22
  EvViewPresentation: ['EvViewPresentation', 'GtkWidget', 'GtkBuildable'],
23
23
  };
24
24
 
25
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
26
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
27
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
28
+ // from a list — the count is in the provenance line above.
29
+ export const CHILD_HOLDERS = [];
30
+
25
31
  export const ENUM_NICKS = {
26
32
  EvJobPriority: ['priority-urgent', 'priority-high', 'priority-low', 'priority-none', 'n-priorities'],
27
33
  EvJobRunMode: ['thread', 'main-loop'],
@@ -0,0 +1,200 @@
1
+ /**
2
+ * The GIR-derived widget VOCABULARY for XreaderView-1.5.
3
+ *
4
+ * GENERATED — do not edit. Provenance: XreaderView-1.5 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object Atk.ImplementorIface
5
+ *
6
+ * 2 concrete widgets, 2 declarations, 4 enum nick unions, 0 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 XreaderDocument from '@girs/xreaderdocument-1.5';
28
+ import type XreaderView from './xreaderview-1.5.js';
29
+ import type { GtkBuildableConstructOnly, GtkBuildableProps, GtkContainerConstructOnly, GtkContainerProps, GtkScrollableConstructOnly, GtkScrollableProps, GtkWidgetConstructOnly, GtkWidgetProps } 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 EvJobPriorityNick = 'priority-urgent' | 'priority-high' | 'priority-low' | 'priority-none' | 'n-priorities';
42
+ export type EvJobRunModeNick = 'thread' | 'main-loop';
43
+ export type EvSizingModeNick = 'best-fit' | 'fit-width' | 'free';
44
+ export type EvViewSelectionModeNick = 'text' | 'rectangle';
45
+
46
+ // ---------------------------------------------------------------------------
47
+ // Property surfaces — one interface per GIR DECLARATION, mirroring GIR's own
48
+ // inheritance rather than flattening per widget.
49
+ //
50
+ // The interfaces are load-bearing, not tidiness: `GtkBox` declares four properties
51
+ // of its own and `orientation` is not among them — it lives on `Gtk.Orientable`,
52
+ // because GObject installs interface properties on the implementor at runtime while
53
+ // GIR keeps them once, on the interface.
54
+ // ---------------------------------------------------------------------------
55
+
56
+ export interface EvViewProps extends GtkContainerProps, GtkBuildableProps, GtkScrollableProps {
57
+ }
58
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
59
+ export type EvViewConstructOnly = GtkContainerConstructOnly | GtkBuildableConstructOnly | GtkScrollableConstructOnly;
60
+
61
+ export interface EvViewPresentationProps extends GtkWidgetProps, GtkBuildableProps {
62
+ /** @default 0 */
63
+ 'current-page'?: number;
64
+ document?: XreaderDocument.Document;
65
+ /** @default FALSE */
66
+ 'inverted-colors'?: boolean;
67
+ /** @default 0 */
68
+ rotation?: number;
69
+ }
70
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
71
+ export type EvViewPresentationConstructOnly = GtkWidgetConstructOnly | GtkBuildableConstructOnly | 'current-page' | 'document' | 'inverted-colors';
72
+
73
+ // ---------------------------------------------------------------------------
74
+ // The GType-keyed widget map.
75
+ //
76
+ // Keyed by GType because that is also the GtkBuilder XML key and the typelib key. A
77
+ // consumer maps GTypes to tags in ITS convention — kebab for JSX intrinsics, Pascal
78
+ // for a Vue `GlobalComponents`, the class itself for a renderer whose element type
79
+ // is the class. None of those is baked in here.
80
+ //
81
+ // `slotCandidates` is a candidate list and never an answer: derived from methods
82
+ // taking exactly one widget argument. The GIR cannot tell adoption from reference —
83
+ // `set_title_widget` parents its argument and `set_activatable_widget` does not, and
84
+ // both are `void f(GtkWidget*)` at `transfer-ownership="none"`. Curation decides;
85
+ // this is what notices when a release adds a candidate.
86
+ // ---------------------------------------------------------------------------
87
+
88
+ export interface Widgets {
89
+ EvView: {
90
+ class: XreaderView.View;
91
+ props: EvViewProps;
92
+ signals: XreaderView.View.SignalSignatures;
93
+ constructOnly: EvViewConstructOnly;
94
+ slotCandidates: {};
95
+ };
96
+ EvViewPresentation: {
97
+ class: XreaderView.ViewPresentation;
98
+ props: EvViewPresentationProps;
99
+ signals: XreaderView.ViewPresentation.SignalSignatures;
100
+ constructOnly: EvViewPresentationConstructOnly;
101
+ slotCandidates: {};
102
+ };
103
+ }
104
+
105
+ /** Every GType this namespace can create. A consumer derives its own tag map. */
106
+ export type WidgetGType = keyof Widgets;
107
+
108
+ // ---------------------------------------------------------------------------
109
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
110
+ //
111
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
112
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
113
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
114
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
115
+ // more rows in `Widgets`: concatenate them when you mean both.
116
+ // ---------------------------------------------------------------------------
117
+
118
+ export interface ChildHolders {
119
+
120
+ }
121
+
122
+ /** Every GType this namespace holds a child in without it being a widget. */
123
+ export type ChildHolderGType = keyof ChildHolders;
124
+
125
+ /** The writable, optional, GObject-keyed property surface of one GType. */
126
+ export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
127
+
128
+ /** The signal table this package already emits, reached by GType. */
129
+ export type SignalsOf<G extends WidgetGType> = Widgets[G]['signals'];
130
+
131
+ /** The instance type — what a `ref`-shaped prop should infer. */
132
+ export type InstanceOf<G extends WidgetGType> = Widgets[G]['class'];
133
+
134
+ /** Property names that can only be set at construction. */
135
+ export type ConstructOnlyOf<G extends WidgetGType> = Widgets[G]['constructOnly'];
136
+
137
+ /** Candidate child slots — see the note above; curation decides. */
138
+ export type SlotCandidatesOf<G extends WidgetGType> = keyof Widgets[G]['slotCandidates'];
139
+
140
+ /**
141
+ * The same facts as runtime data, for a consumer that CHECKS them.
142
+ *
143
+ * Types are erased, so a spec that asks the installed GTK whether every property
144
+ * here is a writable ParamSpec, every signal resolvable by `GObject.signal_lookup`
145
+ * and every nick resolvable through an enum lookup cannot read the interfaces
146
+ * above. Emitted headlessly with no GTK present, which is exactly why the checking
147
+ * belongs to the consumer and the DATA belongs here.
148
+ */
149
+ export const PROVENANCE: {
150
+ readonly namespace: string;
151
+ readonly version: string;
152
+ /** The version the LIBRARY states, or null where it states none. Never the namespace's. */
153
+ readonly libraryVersion: string | null;
154
+ readonly childHolders: number;
155
+ readonly droppedBases: readonly string[];
156
+ readonly inlinedBases: readonly string[];
157
+ readonly unsettableProps: readonly string[];
158
+ };
159
+
160
+ /** Declaration GType -> its own settable properties, as GObject registered them. */
161
+ export const OWN_PROPS: Readonly<Record<string, readonly string[]>>;
162
+
163
+ /**
164
+ * Declaration GType -> the signals it registers itself, never its parents'.
165
+ *
166
+ * Keyed like `OWN_PROPS`, so both are read at every link of a `DECLS` chain. An
167
+ * abstract base has no `Widgets` row and still owns signals — `GtkWidget` owns 13.
168
+ */
169
+ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
170
+
171
+ /** Widget GType -> every declaration its members come from, self first. */
172
+ export const DECLS: Readonly<Record<string, readonly string[]>>;
173
+
174
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
175
+ export const CHILD_HOLDERS: readonly string[];
176
+
177
+ /** Enum GType -> the nicks this surface offers. */
178
+ export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
179
+
180
+ /** Widget GType -> slot name -> the method that may adopt a child there. */
181
+ export const SLOT_CANDIDATES: Readonly<Record<string, Readonly<Record<string, string>>>>;
182
+
183
+ /**
184
+ * `Type`, `Type.property` and `Type::signal` -> the release that introduced it.
185
+ *
186
+ * What keeps a runtime cross-check honest across a version gap without an
187
+ * allowlist: a name the installed library lacks is a defect UNLESS the version
188
+ * here is newer than the one running.
189
+ *
190
+ * ALL THREE key shapes, because that test only works for the names it covers. A
191
+ * property-only map leaves a consumer no way to explain a missing SIGNAL, which is
192
+ * a correct vocabulary reported as 18 defects; a member-only map leaves it no way to
193
+ * explain a missing CLASS, and that one fails as a bare
194
+ * `TypeError: can't access property "$gtype", ctor() is undefined` that does not
195
+ * even name the GType.
196
+ *
197
+ * A key is present only where the GIR states a version — sparse by nature (`version`
198
+ * sits on 29 of the 301 classes and interfaces in Gtk-4.0), never inferred.
199
+ */
200
+ export const SINCE: Readonly<Record<string, string>>;
@@ -0,0 +1,48 @@
1
+ // The widget vocabulary of XreaderView-1.5 as runtime data.
2
+ //
3
+ // GENERATED — do not edit. Provenance: XreaderView-1.5 — 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: 'XreaderView',
11
+ version: '1.5',
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
+ EvViewPresentation: ['current-page', 'document', 'inverted-colors', 'rotation'],
21
+ };
22
+
23
+ export const OWN_SIGNALS = {
24
+ EvView: ['activate', 'annot-added', 'annot-removed', 'binding-activated', 'external-link', 'handle-link', 'layers-changed', 'popup', 'selection-changed', 'sync-source'],
25
+ EvViewPresentation: ['change-page', 'external-link', 'finished'],
26
+ };
27
+
28
+ export const DECLS = {
29
+ EvView: ['EvView', 'GtkContainer', 'GtkWidget', 'GtkBuildable', 'GtkScrollable'],
30
+ EvViewPresentation: ['EvViewPresentation', 'GtkWidget', 'GtkBuildable'],
31
+ };
32
+
33
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
34
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
35
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
36
+ // from a list — the count is in the provenance line above.
37
+ export const CHILD_HOLDERS = [];
38
+
39
+ export const ENUM_NICKS = {
40
+ EvJobPriority: ['priority-urgent', 'priority-high', 'priority-low', 'priority-none', 'n-priorities'],
41
+ EvJobRunMode: ['thread', 'main-loop'],
42
+ EvSizingMode: ['best-fit', 'fit-width', 'free'],
43
+ EvViewSelectionMode: ['text', 'rectangle'],
44
+ };
45
+
46
+ export const SLOT_CANDIDATES = {};
47
+
48
+ export const SINCE = {};
@@ -44,11 +44,11 @@ export namespace XreaderView {
44
44
  * @gir-type Enum
45
45
  */
46
46
  enum JobPriority {
47
- PRIORITY_URGENT,
48
- PRIORITY_HIGH,
49
- PRIORITY_LOW,
50
- PRIORITY_NONE,
51
- N_PRIORITIES,
47
+ PRIORITY_URGENT = 0,
48
+ PRIORITY_HIGH = 1,
49
+ PRIORITY_LOW = 2,
50
+ PRIORITY_NONE = 3,
51
+ N_PRIORITIES = 4,
52
52
  }
53
53
 
54
54
 
@@ -63,8 +63,8 @@ export namespace XreaderView {
63
63
  * @gir-type Enum
64
64
  */
65
65
  enum JobRunMode {
66
- THREAD,
67
- MAIN_LOOP,
66
+ THREAD = 0,
67
+ MAIN_LOOP = 1,
68
68
  }
69
69
 
70
70
 
@@ -79,9 +79,9 @@ export namespace XreaderView {
79
79
  * @gir-type Enum
80
80
  */
81
81
  enum SizingMode {
82
- BEST_FIT,
83
- FIT_WIDTH,
84
- FREE,
82
+ BEST_FIT = 0,
83
+ FIT_WIDTH = 1,
84
+ FREE = 2,
85
85
  }
86
86
 
87
87
 
@@ -96,37 +96,79 @@ export namespace XreaderView {
96
96
  * @gir-type Enum
97
97
  */
98
98
  enum ViewSelectionMode {
99
- TEXT,
100
- RECTANGLE,
99
+ TEXT = 0,
100
+ RECTANGLE = 1,
101
101
  }
102
102
 
103
103
 
104
+ /**
105
+ * @default mail-attachment
106
+ */
104
107
  const STOCK_ATTACHMENT: string;
105
108
 
109
+ /**
110
+ * @default close
111
+ */
106
112
  const STOCK_CLOSE: string;
107
113
 
114
+ /**
115
+ * @default inverted
116
+ */
108
117
  const STOCK_INVERTED_COLORS: string;
109
118
 
119
+ /**
120
+ * @default resize-se
121
+ */
110
122
  const STOCK_RESIZE_SE: string;
111
123
 
124
+ /**
125
+ * @default resize-sw
126
+ */
112
127
  const STOCK_RESIZE_SW: string;
113
128
 
129
+ /**
130
+ * @default object-rotate-left
131
+ */
114
132
  const STOCK_ROTATE_LEFT: string;
115
133
 
134
+ /**
135
+ * @default object-rotate-right
136
+ */
116
137
  const STOCK_ROTATE_RIGHT: string;
117
138
 
139
+ /**
140
+ * @default x-office-presentation
141
+ */
118
142
  const STOCK_RUN_PRESENTATION: string;
119
143
 
144
+ /**
145
+ * @default view-page-continuous
146
+ */
120
147
  const STOCK_VIEW_CONTINUOUS: string;
121
148
 
149
+ /**
150
+ * @default view-page-facing
151
+ */
122
152
  const STOCK_VIEW_DUAL: string;
123
153
 
154
+ /**
155
+ * @default eye
156
+ */
124
157
  const STOCK_VISIBLE: string;
125
158
 
159
+ /**
160
+ * @default zoom
161
+ */
126
162
  const STOCK_ZOOM: string;
127
163
 
164
+ /**
165
+ * @default zoom-fit-height
166
+ */
128
167
  const STOCK_ZOOM_PAGE: string;
129
168
 
169
+ /**
170
+ * @default zoom-fit-width
171
+ */
130
172
  const STOCK_ZOOM_WIDTH: string;
131
173
 
132
174
  /**
@@ -152,15 +194,15 @@ export namespace XreaderView {
152
194
  * @gir-type Flags
153
195
  */
154
196
  enum JobPageDataFlags {
155
- NONE,
156
- LINKS,
157
- TEXT,
158
- TEXT_MAPPING,
159
- TEXT_LAYOUT,
160
- IMAGES,
161
- FORMS,
162
- ANNOTS,
163
- ALL,
197
+ NONE = 0,
198
+ LINKS = 1,
199
+ TEXT = 2,
200
+ TEXT_MAPPING = 4,
201
+ TEXT_LAYOUT = 8,
202
+ IMAGES = 16,
203
+ FORMS = 32,
204
+ ANNOTS = 64,
205
+ ALL = 127,
164
206
  }
165
207
 
166
208
 
@@ -171,7 +213,7 @@ export namespace XreaderView {
171
213
  * @signal
172
214
  * @run-last
173
215
  */
174
- "page-changed": (arg0: number, arg1: number) => void;
216
+ "page-changed": (object: number, p0: number) => void;
175
217
  "notify::continuous": (pspec: GObject.ParamSpec) => void;
176
218
  "notify::document": (pspec: GObject.ParamSpec) => void;
177
219
  "notify::dual-odd-left": (pspec: GObject.ParamSpec) => void;
@@ -712,7 +754,7 @@ export namespace XreaderView {
712
754
  * @signal
713
755
  * @run-last
714
756
  */
715
- updated: (arg0: number) => void;
757
+ updated: (object: number) => void;
716
758
  }
717
759
 
718
760
  // Constructor properties interface
@@ -799,7 +841,7 @@ export namespace XreaderView {
799
841
  * @signal
800
842
  * @run-last
801
843
  */
802
- updated: (arg0: number) => void;
844
+ updated: (object: number) => void;
803
845
  }
804
846
 
805
847
  // Constructor properties interface
@@ -1318,7 +1360,7 @@ export namespace XreaderView {
1318
1360
  * @signal
1319
1361
  * @run-last
1320
1362
  */
1321
- done: (arg0: Gtk.PrintOperationResult) => void;
1363
+ done: (object: Gtk.PrintOperationResult) => void;
1322
1364
  /**
1323
1365
  * @signal
1324
1366
  * @run-last
@@ -1385,6 +1427,9 @@ export namespace XreaderView {
1385
1427
 
1386
1428
  get_embed_page_setup(): boolean;
1387
1429
 
1430
+ /**
1431
+ * @throws GLib.Error
1432
+ */
1388
1433
  get_error(): void;
1389
1434
 
1390
1435
  get_job_name(): string;
@@ -1439,31 +1484,31 @@ export namespace XreaderView {
1439
1484
  * @action
1440
1485
  * @run-last
1441
1486
  */
1442
- "annot-added": (arg0: XreaderDocument.Annotation) => void;
1487
+ "annot-added": (object: XreaderDocument.Annotation) => void;
1443
1488
  /**
1444
1489
  * @signal
1445
1490
  * @action
1446
1491
  * @run-last
1447
1492
  */
1448
- "annot-removed": (arg0: XreaderDocument.Annotation) => void;
1493
+ "annot-removed": (object: XreaderDocument.Annotation) => void;
1449
1494
  /**
1450
1495
  * @signal
1451
1496
  * @action
1452
1497
  * @run-last
1453
1498
  */
1454
- "binding-activated": (arg0: Gtk.ScrollType, arg1: boolean) => void;
1499
+ "binding-activated": (object: Gtk.ScrollType, p0: boolean) => void;
1455
1500
  /**
1456
1501
  * @signal
1457
1502
  * @action
1458
1503
  * @run-last
1459
1504
  */
1460
- "external-link": (arg0: GObject.Object) => void;
1505
+ "external-link": (object: GObject.Object) => void;
1461
1506
  /**
1462
1507
  * @signal
1463
1508
  * @action
1464
1509
  * @run-last
1465
1510
  */
1466
- "handle-link": (arg0: GObject.Object) => void;
1511
+ "handle-link": (object: GObject.Object) => void;
1467
1512
  /**
1468
1513
  * @signal
1469
1514
  * @action
@@ -1475,7 +1520,7 @@ export namespace XreaderView {
1475
1520
  * @action
1476
1521
  * @run-last
1477
1522
  */
1478
- popup: (arg0: null) => void;
1523
+ popup: (object: null) => void;
1479
1524
  /**
1480
1525
  * @signal
1481
1526
  * @action
@@ -1487,7 +1532,7 @@ export namespace XreaderView {
1487
1532
  * @action
1488
1533
  * @run-last
1489
1534
  */
1490
- "sync-source": (arg0: null) => void;
1535
+ "sync-source": (object: null) => void;
1491
1536
  "notify::border-width": (pspec: GObject.ParamSpec) => void;
1492
1537
  "notify::child": (pspec: GObject.ParamSpec) => void;
1493
1538
  "notify::resize-mode": (pspec: GObject.ParamSpec) => void;
@@ -1754,36 +1799,42 @@ export namespace XreaderView {
1754
1799
  * display overlayed graphics, like the overshoot indication,
1755
1800
  * at the right position.
1756
1801
  * @returns `true` if `border` has been set
1802
+ * @since 3.16
1757
1803
  */
1758
1804
  get_border(): [boolean, Gtk.Border];
1759
1805
 
1760
1806
  /**
1761
1807
  * Retrieves the {@link Gtk.Adjustment} used for horizontal scrolling.
1762
1808
  * @returns horizontal {@link Gtk.Adjustment}.
1809
+ * @since 3.0
1763
1810
  */
1764
1811
  get_hadjustment(): Gtk.Adjustment;
1765
1812
 
1766
1813
  /**
1767
1814
  * Gets the horizontal {@link Gtk.ScrollablePolicy}.
1768
1815
  * @returns The horizontal {@link Gtk.ScrollablePolicy}.
1816
+ * @since 3.0
1769
1817
  */
1770
1818
  get_hscroll_policy(): Gtk.ScrollablePolicy;
1771
1819
 
1772
1820
  /**
1773
1821
  * Retrieves the {@link Gtk.Adjustment} used for vertical scrolling.
1774
1822
  * @returns vertical {@link Gtk.Adjustment}.
1823
+ * @since 3.0
1775
1824
  */
1776
1825
  get_vadjustment(): Gtk.Adjustment;
1777
1826
 
1778
1827
  /**
1779
1828
  * Gets the vertical {@link Gtk.ScrollablePolicy}.
1780
1829
  * @returns The vertical {@link Gtk.ScrollablePolicy}.
1830
+ * @since 3.0
1781
1831
  */
1782
1832
  get_vscroll_policy(): Gtk.ScrollablePolicy;
1783
1833
 
1784
1834
  /**
1785
1835
  * Sets the horizontal adjustment of the {@link Gtk.Scrollable}.
1786
1836
  * @param hadjustment a {@link Gtk.Adjustment}
1837
+ * @since 3.0
1787
1838
  */
1788
1839
  set_hadjustment(hadjustment: Gtk.Adjustment | null): void;
1789
1840
 
@@ -1792,12 +1843,14 @@ export namespace XreaderView {
1792
1843
  * horizontal scrolling should start below the minimum width or
1793
1844
  * below the natural width.
1794
1845
  * @param policy the horizontal {@link Gtk.ScrollablePolicy}
1846
+ * @since 3.0
1795
1847
  */
1796
1848
  set_hscroll_policy(policy: Gtk.ScrollablePolicy): void;
1797
1849
 
1798
1850
  /**
1799
1851
  * Sets the vertical adjustment of the {@link Gtk.Scrollable}.
1800
1852
  * @param vadjustment a {@link Gtk.Adjustment}
1853
+ * @since 3.0
1801
1854
  */
1802
1855
  set_vadjustment(vadjustment: Gtk.Adjustment | null): void;
1803
1856
 
@@ -1806,6 +1859,7 @@ export namespace XreaderView {
1806
1859
  * vertical scrolling should start below the minimum height or
1807
1860
  * below the natural height.
1808
1861
  * @param policy the vertical {@link Gtk.ScrollablePolicy}
1862
+ * @since 3.0
1809
1863
  */
1810
1864
  set_vscroll_policy(policy: Gtk.ScrollablePolicy): void;
1811
1865
 
@@ -1815,6 +1869,7 @@ export namespace XreaderView {
1815
1869
  * be treeview headers. GTK+ can use this information to
1816
1870
  * display overlayed graphics, like the overshoot indication,
1817
1871
  * at the right position.
1872
+ * @since 3.16
1818
1873
  * @virtual
1819
1874
  */
1820
1875
  vfunc_get_border(): [boolean, Gtk.Border];
@@ -1829,13 +1884,13 @@ export namespace XreaderView {
1829
1884
  * @action
1830
1885
  * @run-last
1831
1886
  */
1832
- "change-page": (arg0: Gtk.ScrollType) => void;
1887
+ "change-page": (object: Gtk.ScrollType) => void;
1833
1888
  /**
1834
1889
  * @signal
1835
1890
  * @action
1836
1891
  * @run-last
1837
1892
  */
1838
- "external-link": (arg0: GObject.Object) => void;
1893
+ "external-link": (object: GObject.Object) => void;
1839
1894
  /**
1840
1895
  * @signal
1841
1896
  * @action
@@ -1994,6 +2049,7 @@ export namespace XreaderView {
1994
2049
  * @param builder a {@link Gtk.Builder}
1995
2050
  * @param child child to add
1996
2051
  * @param type kind of child or `null`
2052
+ * @since 2.12
1997
2053
  */
1998
2054
  add_child(builder: Gtk.Builder, child: GObject.Object, type: string | null): void;
1999
2055
 
@@ -2005,6 +2061,7 @@ export namespace XreaderView {
2005
2061
  * @param builder {@link Gtk.Builder} used to construct this object
2006
2062
  * @param name name of child to construct
2007
2063
  * @returns the constructed child
2064
+ * @since 2.12
2008
2065
  */
2009
2066
  construct_child<T = GObject.Object>(builder: Gtk.Builder, name: string): T;
2010
2067
 
@@ -2015,6 +2072,7 @@ export namespace XreaderView {
2015
2072
  * @param child child object or `null` for non-child tags
2016
2073
  * @param tagname the name of the tag
2017
2074
  * @param data user data created in custom_tag_start
2075
+ * @since 2.12
2018
2076
  */
2019
2077
  custom_finished(builder: Gtk.Builder, child: GObject.Object | null, tagname: string, data: null): void;
2020
2078
 
@@ -2025,6 +2083,7 @@ export namespace XreaderView {
2025
2083
  * @param child child object or `null` for non-child tags
2026
2084
  * @param tagname name of tag
2027
2085
  * @param data user data that will be passed in to parser functions
2086
+ * @since 2.12
2028
2087
  */
2029
2088
  custom_tag_end(builder: Gtk.Builder, child: GObject.Object | null, tagname: string, data: null): void;
2030
2089
 
@@ -2034,6 +2093,7 @@ export namespace XreaderView {
2034
2093
  * @param child child object or `null` for non-child tags
2035
2094
  * @param tagname name of tag
2036
2095
  * @returns `true` if a object has a custom implementation, `false` if it doesn't.
2096
+ * @since 2.12
2037
2097
  */
2038
2098
  custom_tag_start(builder: Gtk.Builder, child: GObject.Object | null, tagname: string): [boolean, GLib.MarkupParser, null];
2039
2099
 
@@ -2042,6 +2102,7 @@ export namespace XreaderView {
2042
2102
  * @param builder a {@link Gtk.Builder}
2043
2103
  * @param childname name of child
2044
2104
  * @returns the internal child of the buildable object
2105
+ * @since 2.12
2045
2106
  */
2046
2107
  get_internal_child<T = GObject.Object>(builder: Gtk.Builder, childname: string): T;
2047
2108
 
@@ -2052,6 +2113,7 @@ export namespace XreaderView {
2052
2113
  * [GtkBuilder UI definition][BUILDER-UI]
2053
2114
  * used to construct the `buildable`.
2054
2115
  * @returns the name set with `gtk_buildable_set_name()`
2116
+ * @since 2.12
2055
2117
  */
2056
2118
  get_name(): string;
2057
2119
 
@@ -2062,6 +2124,7 @@ export namespace XreaderView {
2062
2124
  * `gtk_builder_add_from_file()` or `gtk_builder_add_from_string()`
2063
2125
  * is called on a builder.
2064
2126
  * @param builder a {@link Gtk.Builder}
2127
+ * @since 2.12
2065
2128
  */
2066
2129
  parser_finished(builder: Gtk.Builder): void;
2067
2130
 
@@ -2070,12 +2133,14 @@ export namespace XreaderView {
2070
2133
  * @param builder a {@link Gtk.Builder}
2071
2134
  * @param name name of property
2072
2135
  * @param value value of property
2136
+ * @since 2.12
2073
2137
  */
2074
2138
  set_buildable_property(builder: Gtk.Builder, name: string, value: GObject.Value | any): void;
2075
2139
 
2076
2140
  /**
2077
2141
  * Sets the name of the `buildable` object.
2078
2142
  * @param name name to set
2143
+ * @since 2.12
2079
2144
  */
2080
2145
  set_name(name: string): void;
2081
2146
 
@@ -2085,6 +2150,7 @@ export namespace XreaderView {
2085
2150
  * @param builder a {@link Gtk.Builder}
2086
2151
  * @param child child to add
2087
2152
  * @param type kind of child or `null`
2153
+ * @since 2.12
2088
2154
  * @virtual
2089
2155
  */
2090
2156
  vfunc_add_child(builder: Gtk.Builder, child: GObject.Object, type: string | null): void;
@@ -2096,6 +2162,7 @@ export namespace XreaderView {
2096
2162
  * specified in the UI definition.
2097
2163
  * @param builder {@link Gtk.Builder} used to construct this object
2098
2164
  * @param name name of child to construct
2165
+ * @since 2.12
2099
2166
  * @virtual
2100
2167
  */
2101
2168
  vfunc_construct_child<T = GObject.Object>(builder: Gtk.Builder, name: string): T;
@@ -2107,6 +2174,7 @@ export namespace XreaderView {
2107
2174
  * @param child child object or `null` for non-child tags
2108
2175
  * @param tagname the name of the tag
2109
2176
  * @param data user data created in custom_tag_start
2177
+ * @since 2.12
2110
2178
  * @virtual
2111
2179
  */
2112
2180
  vfunc_custom_finished(builder: Gtk.Builder, child: GObject.Object | null, tagname: string, data: null): void;
@@ -2118,6 +2186,7 @@ export namespace XreaderView {
2118
2186
  * @param child child object or `null` for non-child tags
2119
2187
  * @param tagname name of tag
2120
2188
  * @param data user data that will be passed in to parser functions
2189
+ * @since 2.12
2121
2190
  * @virtual
2122
2191
  */
2123
2192
  vfunc_custom_tag_end(builder: Gtk.Builder, child: GObject.Object | null, tagname: string, data: null): void;
@@ -2127,6 +2196,7 @@ export namespace XreaderView {
2127
2196
  * @param builder a {@link Gtk.Builder} used to construct this object
2128
2197
  * @param child child object or `null` for non-child tags
2129
2198
  * @param tagname name of tag
2199
+ * @since 2.12
2130
2200
  * @virtual
2131
2201
  */
2132
2202
  vfunc_custom_tag_start(builder: Gtk.Builder, child: GObject.Object | null, tagname: string): [boolean, GLib.MarkupParser, never];
@@ -2135,6 +2205,7 @@ export namespace XreaderView {
2135
2205
  * Get the internal child called `childname` of the `buildable` object.
2136
2206
  * @param builder a {@link Gtk.Builder}
2137
2207
  * @param childname name of child
2208
+ * @since 2.12
2138
2209
  * @virtual
2139
2210
  */
2140
2211
  vfunc_get_internal_child<T = GObject.Object>(builder: Gtk.Builder, childname: string): T;
@@ -2145,6 +2216,7 @@ export namespace XreaderView {
2145
2216
  * {@link Gtk.Builder} sets the name based on the
2146
2217
  * [GtkBuilder UI definition][BUILDER-UI]
2147
2218
  * used to construct the `buildable`.
2219
+ * @since 2.12
2148
2220
  * @virtual
2149
2221
  */
2150
2222
  vfunc_get_name(): string;
@@ -2156,6 +2228,7 @@ export namespace XreaderView {
2156
2228
  * `gtk_builder_add_from_file()` or `gtk_builder_add_from_string()`
2157
2229
  * is called on a builder.
2158
2230
  * @param builder a {@link Gtk.Builder}
2231
+ * @since 2.12
2159
2232
  * @virtual
2160
2233
  */
2161
2234
  vfunc_parser_finished(builder: Gtk.Builder): void;
@@ -2165,6 +2238,7 @@ export namespace XreaderView {
2165
2238
  * @param builder a {@link Gtk.Builder}
2166
2239
  * @param name name of property
2167
2240
  * @param value value of property
2241
+ * @since 2.12
2168
2242
  * @virtual
2169
2243
  */
2170
2244
  vfunc_set_buildable_property(builder: Gtk.Builder, name: string, value: unknown): void;
@@ -2172,6 +2246,7 @@ export namespace XreaderView {
2172
2246
  /**
2173
2247
  * Sets the name of the `buildable` object.
2174
2248
  * @param name name to set
2249
+ * @since 2.12
2175
2250
  * @virtual
2176
2251
  */
2177
2252
  vfunc_set_name(name: string): void;