@girs/amtk-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/amtk-5)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/amtk-5)
6
6
 
7
+ GJS TypeScript type definitions for Amtk-5 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.5.0.
7
8
 
8
- GJS TypeScript type definitions for Amtk-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/amtk-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/amtk-5` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/amtk-5/ambient` | only the `gi://` module declarations |
27
+ | `@girs/amtk-5/import` | only the `imports.gi` declarations |
28
+ | `@girs/amtk-5/amtk-5` | the namespace, without the side-effecting declarations |
29
+ | `@girs/amtk-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 Amtk from '@girs/amtk-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/amtk-5` or `@girs/amtk-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/amtk-5'
47
+ import '@girs/amtk-5';
32
48
  ```
33
49
 
34
- `tsconfig.json`:
35
50
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/amtk-5"],
41
- ...
42
- }
51
+ { "include": ["@girs/amtk-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 Amtk from 'gi://Amtk?version=5';
49
58
  ```
50
59
 
51
- ### Global import
60
+ Referencing `@girs/amtk-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/amtk-5` or `@girs/amtk-5/import` in your `tsconfig` or entry point Typescript file:
65
+ GJS's global object works the same way, via `@girs/amtk-5/import`:
55
66
 
56
- `index.ts`:
57
67
  ```ts
58
- import '@girs/amtk-5'
68
+ const Amtk = imports.gi.Amtk;
59
69
  ```
60
70
 
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/amtk-5"],
68
- ...
69
- }
70
- ```
71
+ ## Widget vocabulary
71
72
 
72
- That form carries types as well:
73
+ `amtk-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 Amtk = imports.gi.Amtk;
77
+ import type { Widgets, PropsOf } from '@girs/amtk-5/vocabulary';
78
+ import { OWN_PROPS, ENUM_NICKS, PROVENANCE } from '@girs/amtk-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
 
@@ -87,6 +87,23 @@ export interface Widgets {
87
87
  /** Every GType this namespace can create. A consumer derives its own tag map. */
88
88
  export type WidgetGType = keyof Widgets;
89
89
 
90
+ // ---------------------------------------------------------------------------
91
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
92
+ //
93
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
94
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
95
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
96
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
97
+ // more rows in `Widgets`: concatenate them when you mean both.
98
+ // ---------------------------------------------------------------------------
99
+
100
+ export interface ChildHolders {
101
+
102
+ }
103
+
104
+ /** Every GType this namespace holds a child in without it being a widget. */
105
+ export type ChildHolderGType = keyof ChildHolders;
106
+
90
107
  /** The writable, optional, GObject-keyed property surface of one GType. */
91
108
  export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
92
109
 
@@ -122,6 +139,9 @@ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
122
139
  /** Widget GType -> every declaration its members come from, self first. */
123
140
  export const DECLS: Readonly<Record<string, readonly string[]>>;
124
141
 
142
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
143
+ export const CHILD_HOLDERS: readonly string[];
144
+
125
145
  /** Enum GType -> the nicks this surface offers. */
126
146
  export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
127
147
 
package/amtk-5-surface.js CHANGED
@@ -18,6 +18,12 @@ export const DECLS = {
18
18
  AmtkTreeViewScrolledWindowSizing: ['AmtkTreeViewScrolledWindowSizing', 'GtkScrolledWindow', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
19
19
  };
20
20
 
21
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
22
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
23
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
24
+ // from a list — the count is in the provenance line above.
25
+ export const CHILD_HOLDERS = [];
26
+
21
27
  export const ENUM_NICKS = {};
22
28
 
23
29
  export const SLOT_CANDIDATES = {};
@@ -0,0 +1,183 @@
1
+ /**
2
+ * The GIR-derived widget VOCABULARY for Amtk-5.
3
+ *
4
+ * GENERATED — do not edit. Provenance: Amtk-5 — dropped empty base(s): GObject.InitiallyUnowned GObject.Object Atk.ImplementorIface
5
+ *
6
+ * 1 concrete widgets, 1 declarations, 0 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 Amtk from './amtk-5.js';
28
+ import type { GtkBinConstructOnly, GtkBinProps, GtkBuildableConstructOnly, GtkBuildableProps, GtkContainerConstructOnly, GtkContainerProps, GtkScrolledWindowConstructOnly, GtkScrolledWindowProps, GtkWidgetConstructOnly, GtkWidgetProps } from '@girs/gtk-3.0/vocabulary';
29
+
30
+ // ---------------------------------------------------------------------------
31
+ // Enum nicks — the string vocabulary GObject registered, from GIR's `glib:nick`.
32
+ //
33
+ // Not derived from the member name. Substituting underscores for dashes is not a law:
34
+ // some nicks keep an underscore the substitution would have replaced, and only the
35
+ // attribute knows which. Gtk-4.0 and Adw-1 contradict no derivation at all, which is
36
+ // how a derived nick passes review and breaks elsewhere.
37
+ // Re-measure with `scripts/check-nick-derivation.mjs` in ts-for-gir.
38
+ // ---------------------------------------------------------------------------
39
+
40
+
41
+
42
+ // ---------------------------------------------------------------------------
43
+ // Property surfaces — one interface per GIR DECLARATION, mirroring GIR's own
44
+ // inheritance rather than flattening per widget.
45
+ //
46
+ // The interfaces are load-bearing, not tidiness: `GtkBox` declares four properties
47
+ // of its own and `orientation` is not among them — it lives on `Gtk.Orientable`,
48
+ // because GObject installs interface properties on the implementor at runtime while
49
+ // GIR keeps them once, on the interface.
50
+ // ---------------------------------------------------------------------------
51
+
52
+ export interface AmtkTreeViewScrolledWindowSizingProps extends GtkScrolledWindowProps, GtkBuildableProps {
53
+ /**
54
+ * Whether to take the #GdkMonitor size into account as a maximum width and height to apply.
55
+ * @since 5.10
56
+ * @default TRUE
57
+ */
58
+ 'monitor-limit-enabled'?: boolean;
59
+ }
60
+ /** Settable only at construction — a renderer must REBUILD, not patch. */
61
+ export type AmtkTreeViewScrolledWindowSizingConstructOnly = GtkScrolledWindowConstructOnly | GtkBuildableConstructOnly;
62
+
63
+ // ---------------------------------------------------------------------------
64
+ // The GType-keyed widget map.
65
+ //
66
+ // Keyed by GType because that is also the GtkBuilder XML key and the typelib key. A
67
+ // consumer maps GTypes to tags in ITS convention — kebab for JSX intrinsics, Pascal
68
+ // for a Vue `GlobalComponents`, the class itself for a renderer whose element type
69
+ // is the class. None of those is baked in here.
70
+ //
71
+ // `slotCandidates` is a candidate list and never an answer: derived from methods
72
+ // taking exactly one widget argument. The GIR cannot tell adoption from reference —
73
+ // `set_title_widget` parents its argument and `set_activatable_widget` does not, and
74
+ // both are `void f(GtkWidget*)` at `transfer-ownership="none"`. Curation decides;
75
+ // this is what notices when a release adds a candidate.
76
+ // ---------------------------------------------------------------------------
77
+
78
+ export interface Widgets {
79
+ AmtkTreeViewScrolledWindowSizing: {
80
+ class: Amtk.TreeViewScrolledWindowSizing;
81
+ props: AmtkTreeViewScrolledWindowSizingProps;
82
+ signals: Amtk.TreeViewScrolledWindowSizing.SignalSignatures;
83
+ constructOnly: AmtkTreeViewScrolledWindowSizingConstructOnly;
84
+ slotCandidates: {};
85
+ };
86
+ }
87
+
88
+ /** Every GType this namespace can create. A consumer derives its own tag map. */
89
+ export type WidgetGType = keyof Widgets;
90
+
91
+ // ---------------------------------------------------------------------------
92
+ // Child holders — the same shape, for objects that CARRY a widget without being one.
93
+ //
94
+ // `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
95
+ // `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
96
+ // them exactly like a container, so they belong in the vocabulary; a check asking "is
97
+ // this a widget" must still be able to say no. Hence a sibling table rather than four
98
+ // more rows in `Widgets`: concatenate them when you mean both.
99
+ // ---------------------------------------------------------------------------
100
+
101
+ export interface ChildHolders {
102
+
103
+ }
104
+
105
+ /** Every GType this namespace holds a child in without it being a widget. */
106
+ export type ChildHolderGType = keyof ChildHolders;
107
+
108
+ /** The writable, optional, GObject-keyed property surface of one GType. */
109
+ export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
110
+
111
+ /** The signal table this package already emits, reached by GType. */
112
+ export type SignalsOf<G extends WidgetGType> = Widgets[G]['signals'];
113
+
114
+ /** The instance type — what a `ref`-shaped prop should infer. */
115
+ export type InstanceOf<G extends WidgetGType> = Widgets[G]['class'];
116
+
117
+ /** Property names that can only be set at construction. */
118
+ export type ConstructOnlyOf<G extends WidgetGType> = Widgets[G]['constructOnly'];
119
+
120
+ /** Candidate child slots — see the note above; curation decides. */
121
+ export type SlotCandidatesOf<G extends WidgetGType> = keyof Widgets[G]['slotCandidates'];
122
+
123
+ /**
124
+ * The same facts as runtime data, for a consumer that CHECKS them.
125
+ *
126
+ * Types are erased, so a spec that asks the installed GTK whether every property
127
+ * here is a writable ParamSpec, every signal resolvable by `GObject.signal_lookup`
128
+ * and every nick resolvable through an enum lookup cannot read the interfaces
129
+ * above. Emitted headlessly with no GTK present, which is exactly why the checking
130
+ * belongs to the consumer and the DATA belongs here.
131
+ */
132
+ export const PROVENANCE: {
133
+ readonly namespace: string;
134
+ readonly version: string;
135
+ /** The version the LIBRARY states, or null where it states none. Never the namespace's. */
136
+ readonly libraryVersion: string | null;
137
+ readonly childHolders: number;
138
+ readonly droppedBases: readonly string[];
139
+ readonly inlinedBases: readonly string[];
140
+ readonly unsettableProps: readonly string[];
141
+ };
142
+
143
+ /** Declaration GType -> its own settable properties, as GObject registered them. */
144
+ export const OWN_PROPS: Readonly<Record<string, readonly string[]>>;
145
+
146
+ /**
147
+ * Declaration GType -> the signals it registers itself, never its parents'.
148
+ *
149
+ * Keyed like `OWN_PROPS`, so both are read at every link of a `DECLS` chain. An
150
+ * abstract base has no `Widgets` row and still owns signals — `GtkWidget` owns 13.
151
+ */
152
+ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
153
+
154
+ /** Widget GType -> every declaration its members come from, self first. */
155
+ export const DECLS: Readonly<Record<string, readonly string[]>>;
156
+
157
+ /** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
158
+ export const CHILD_HOLDERS: readonly string[];
159
+
160
+ /** Enum GType -> the nicks this surface offers. */
161
+ export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
162
+
163
+ /** Widget GType -> slot name -> the method that may adopt a child there. */
164
+ export const SLOT_CANDIDATES: Readonly<Record<string, Readonly<Record<string, string>>>>;
165
+
166
+ /**
167
+ * `Type`, `Type.property` and `Type::signal` -> the release that introduced it.
168
+ *
169
+ * What keeps a runtime cross-check honest across a version gap without an
170
+ * allowlist: a name the installed library lacks is a defect UNLESS the version
171
+ * here is newer than the one running.
172
+ *
173
+ * ALL THREE key shapes, because that test only works for the names it covers. A
174
+ * property-only map leaves a consumer no way to explain a missing SIGNAL, which is
175
+ * a correct vocabulary reported as 18 defects; a member-only map leaves it no way to
176
+ * explain a missing CLASS, and that one fails as a bare
177
+ * `TypeError: can't access property "$gtype", ctor() is undefined` that does not
178
+ * even name the GType.
179
+ *
180
+ * A key is present only where the GIR states a version — sparse by nature (`version`
181
+ * sits on 29 of the 301 classes and interfaces in Gtk-4.0), never inferred.
182
+ */
183
+ export const SINCE: Readonly<Record<string, string>>;
@@ -0,0 +1,41 @@
1
+ // The widget vocabulary of Amtk-5 as runtime data.
2
+ //
3
+ // GENERATED — do not edit. Provenance: Amtk-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: 'Amtk',
11
+ version: '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
+ AmtkTreeViewScrolledWindowSizing: ['monitor-limit-enabled'],
21
+ };
22
+
23
+ export const OWN_SIGNALS = {};
24
+
25
+ export const DECLS = {
26
+ AmtkTreeViewScrolledWindowSizing: ['AmtkTreeViewScrolledWindowSizing', 'GtkScrolledWindow', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
27
+ };
28
+
29
+ // The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
30
+ // and descend from `GObject.Object`. A renderer places them like a container; a check
31
+ // asking "is this a widget" must not count them. Derived from the accessor pair, never
32
+ // from a list — the count is in the provenance line above.
33
+ export const CHILD_HOLDERS = [];
34
+
35
+ export const ENUM_NICKS = {};
36
+
37
+ export const SLOT_CANDIDATES = {};
38
+
39
+ export const SINCE = {
40
+ 'AmtkTreeViewScrolledWindowSizing.monitor-limit-enabled': '5.10',
41
+ };
package/amtk-5.d.ts CHANGED
@@ -266,40 +266,40 @@ export namespace Amtk {
266
266
  /**
267
267
  * No flags.
268
268
  */
269
- FLAGS_NONE,
269
+ FLAGS_NONE = 0,
270
270
  /**
271
271
  * Do not associate the created object with the
272
272
  * {@link Gio.Action}. For example if the object to create is a {@link Gtk.Actionable}, do not
273
273
  * call `gtk_actionable_set_detailed_action_name()`.
274
274
  */
275
- IGNORE_GACTION,
275
+ IGNORE_GACTION = 1,
276
276
  /**
277
277
  * Do not set an icon.
278
278
  */
279
- IGNORE_ICON,
279
+ IGNORE_ICON = 2,
280
280
  /**
281
281
  * Do not set a label/short description.
282
282
  */
283
- IGNORE_LABEL,
283
+ IGNORE_LABEL = 4,
284
284
  /**
285
285
  * Do not set a tooltip/long description.
286
286
  */
287
- IGNORE_TOOLTIP,
287
+ IGNORE_TOOLTIP = 8,
288
288
  /**
289
289
  * Ignore completely the accelerators.
290
290
  */
291
- IGNORE_ACCELS,
291
+ IGNORE_ACCELS = 16,
292
292
  /**
293
293
  * Ignore the accelerators for
294
294
  * documentation purposes only. For example do not add/configure a
295
295
  * {@link Gtk.AccelLabel}.
296
296
  */
297
- IGNORE_ACCELS_FOR_DOC,
297
+ IGNORE_ACCELS_FOR_DOC = 32,
298
298
  /**
299
299
  * Do not call
300
300
  * `gtk_application_set_accels_for_action()`.
301
301
  */
302
- IGNORE_ACCELS_FOR_APP,
302
+ IGNORE_ACCELS_FOR_APP = 64,
303
303
  }
304
304
 
305
305
 
@@ -345,12 +345,16 @@ export namespace Amtk {
345
345
  emit(signal: string, ...args: any[]): void;
346
346
 
347
347
  // Static methods
348
+ /**
349
+ * @since 3.0
350
+ */
348
351
  static get_singleton(): ActionInfoCentralStore;
349
352
 
350
353
  // Methods
351
354
  /**
352
355
  * @param action_name an action name.
353
356
  * @returns the found {@link Amtk.ActionInfo}, or `null`.
357
+ * @since 2.0
354
358
  */
355
359
  lookup(action_name: string): ActionInfo;
356
360
  }
@@ -406,6 +410,7 @@ export namespace Amtk {
406
410
  * {@link Amtk.ActionInfo} with the same action name. The stores take their own
407
411
  * reference on `info`.
408
412
  * @param info an {@link Amtk.ActionInfo}.
413
+ * @since 2.0
409
414
  */
410
415
  add(info: ActionInfo): void;
411
416
 
@@ -418,6 +423,7 @@ export namespace Amtk {
418
423
  * An API similar to `g_action_map_add_action_entries()`.
419
424
  * @param entries a pointer to the first item in an array of {@link Amtk.ActionInfoEntry} structs.
420
425
  * @param translation_domain a gettext domain, or `null`.
426
+ * @since 2.0
421
427
  */
422
428
  add_entries(entries: ActionInfoEntry[], translation_domain: string | null): void;
423
429
 
@@ -429,12 +435,14 @@ export namespace Amtk {
429
435
  * You probably want to call this function on the application store after
430
436
  * creating the menu and toolbar. But it can also be useful for a store provided
431
437
  * by a library, to easily see which actions are not used by the application.
438
+ * @since 2.0
432
439
  */
433
440
  check_all_used(): void;
434
441
 
435
442
  /**
436
443
  * @param action_name an action name.
437
444
  * @returns the found {@link Amtk.ActionInfo}, or `null`.
445
+ * @since 2.0
438
446
  */
439
447
  lookup(action_name: string): ActionInfo;
440
448
 
@@ -462,6 +470,7 @@ export namespace Amtk {
462
470
  * {@link Amtk.Factory}, containing information about actions that are not added to any
463
471
  * menu or toolbar.
464
472
  * @param application a {@link Gtk.Application}.
473
+ * @since 5.0
465
474
  */
466
475
  set_all_accels_to_app(application: Gtk.Application): void;
467
476
  }
@@ -546,6 +555,7 @@ export namespace Amtk {
546
555
  * are added to the default {@link Gtk.RecentManager} with
547
556
  * `gtk_recent_manager_add_item()`, the files will normally show up in the
548
557
  * {@link Gtk.RecentChooserMenu}.
558
+ * @since 5.6
549
559
  */
550
560
  static create_open_recent_menu_base(): Gtk.RecentChooserMenu;
551
561
 
@@ -553,6 +563,7 @@ export namespace Amtk {
553
563
  * Returns the {@link Amtk.ApplicationWindow} of `gtk_window`. The returned object is
554
564
  * guaranteed to be the same for the lifetime of `gtk_window`.
555
565
  * @param gtk_window a {@link Gtk.ApplicationWindow}.
566
+ * @since 2.0
556
567
  */
557
568
  static get_from_gtk_application_window(gtk_window: Gtk.ApplicationWindow): ApplicationWindow;
558
569
 
@@ -566,6 +577,7 @@ export namespace Amtk {
566
577
  * So `amtk_menu_item_set_long_description()` must have been called, which is the
567
578
  * case if the {@link Gtk.MenuItem} has been created with {@link Amtk.Factory}.
568
579
  * @param menu_shell a {@link Gtk.MenuShell}.
580
+ * @since 2.0
569
581
  */
570
582
  connect_menu_to_statusbar(menu_shell: Gtk.MenuShell): void;
571
583
 
@@ -577,6 +589,7 @@ export namespace Amtk {
577
589
  * The full path is retrieved with
578
590
  * `amtk_utils_recent_chooser_menu_get_item_uri()`.
579
591
  * @param menu a {@link Gtk.RecentChooserMenu}.
592
+ * @since 2.0
580
593
  */
581
594
  connect_recent_chooser_menu_to_statusbar(menu: Gtk.RecentChooserMenu): void;
582
595
 
@@ -592,6 +605,7 @@ export namespace Amtk {
592
605
  * `g_application_open()` is called (with an empty hint), so the {@link Gio.Application}
593
606
  * must have the {@link Gio.ApplicationFlags.HANDLES_OPEN} flag set.
594
607
  * @returns a new {@link Gtk.RecentChooserMenu}.
608
+ * @since 3.0
595
609
  */
596
610
  create_open_recent_menu(): Gtk.Widget;
597
611
 
@@ -600,22 +614,26 @@ export namespace Amtk {
600
614
  * submenu. The {@link Gtk.RecentChooserMenu} is created with
601
615
  * `amtk_application_window_create_open_recent_menu()`.
602
616
  * @returns a new {@link Gtk.MenuItem}.
617
+ * @since 2.0
603
618
  */
604
619
  create_open_recent_menu_item(): Gtk.Widget;
605
620
 
606
621
  /**
607
622
  * @returns the {@link Gtk.ApplicationWindow} of `amtk_window`.
623
+ * @since 2.0
608
624
  */
609
625
  get_application_window(): Gtk.ApplicationWindow;
610
626
 
611
627
  /**
612
628
  * @returns the {@link Amtk.ApplicationWindow.statusbar}.
629
+ * @since 2.0
613
630
  */
614
631
  get_statusbar(): Gtk.Statusbar | null;
615
632
 
616
633
  /**
617
634
  * Sets the {@link Amtk.ApplicationWindow.statusbar} property.
618
635
  * @param statusbar a {@link Gtk.Statusbar}, or `null`.
636
+ * @since 2.0
619
637
  */
620
638
  set_statusbar(statusbar: Gtk.Statusbar | null): void;
621
639
  }
@@ -707,6 +725,7 @@ export namespace Amtk {
707
725
  * information.
708
726
  * @param action_name an action name.
709
727
  * @returns a new {@link Gtk.CheckMenuItem} for `action_name`.
728
+ * @since 3.0
710
729
  */
711
730
  create_check_menu_item(action_name: string): Gtk.Widget;
712
731
 
@@ -722,6 +741,7 @@ export namespace Amtk {
722
741
  * @param action_name an action name.
723
742
  * @param flags {@link Amtk.FactoryFlags}.
724
743
  * @returns a new {@link Gtk.CheckMenuItem} for `action_name`.
744
+ * @since 3.0
725
745
  */
726
746
  create_check_menu_item_full(action_name: string, flags: FactoryFlags): Gtk.Widget;
727
747
 
@@ -730,6 +750,7 @@ export namespace Amtk {
730
750
  * {@link Amtk.Factory.default_flags}.
731
751
  * @param action_name an action name.
732
752
  * @returns a new {@link Gio.MenuItem} for `action_name`.
753
+ * @since 5.0
733
754
  */
734
755
  create_gmenu_item(action_name: string): Gio.MenuItem;
735
756
 
@@ -742,6 +763,7 @@ export namespace Amtk {
742
763
  * @param action_name an action name.
743
764
  * @param flags {@link Amtk.FactoryFlags}.
744
765
  * @returns a new {@link Gio.MenuItem} for `action_name`.
766
+ * @since 5.0
745
767
  */
746
768
  create_gmenu_item_full(action_name: string, flags: FactoryFlags): Gio.MenuItem;
747
769
 
@@ -750,6 +772,7 @@ export namespace Amtk {
750
772
  * {@link Amtk.Factory.default_flags}.
751
773
  * @param action_name an action name.
752
774
  * @returns a new {@link Gtk.MenuItem} for `action_name`.
775
+ * @since 3.0
753
776
  */
754
777
  create_menu_item(action_name: string): Gtk.Widget;
755
778
 
@@ -759,6 +782,7 @@ export namespace Amtk {
759
782
  * @param action_name an action name.
760
783
  * @param flags {@link Amtk.FactoryFlags}.
761
784
  * @returns a new {@link Gtk.MenuItem} for `action_name`.
785
+ * @since 3.0
762
786
  */
763
787
  create_menu_item_full(action_name: string, flags: FactoryFlags): Gtk.Widget;
764
788
 
@@ -770,6 +794,7 @@ export namespace Amtk {
770
794
  * information.
771
795
  * @param action_name an action name.
772
796
  * @returns a new {@link Gtk.MenuToolButton} for `action_name`.
797
+ * @since 3.0
773
798
  */
774
799
  create_menu_tool_button(action_name: string): Gtk.MenuToolButton;
775
800
 
@@ -782,6 +807,7 @@ export namespace Amtk {
782
807
  * @param action_name an action name.
783
808
  * @param flags {@link Amtk.FactoryFlags}.
784
809
  * @returns a new {@link Gtk.MenuToolButton} for `action_name`.
810
+ * @since 3.0
785
811
  */
786
812
  create_menu_tool_button_full(action_name: string, flags: FactoryFlags): Gtk.MenuToolButton;
787
813
 
@@ -790,6 +816,7 @@ export namespace Amtk {
790
816
  * {@link Amtk.Factory.default_flags}.
791
817
  * @param action_name an action name.
792
818
  * @returns a new {@link Gtk.ShortcutsShortcut} for `action_name`.
819
+ * @since 5.0
793
820
  */
794
821
  create_shortcut(action_name: string): Gtk.Widget;
795
822
 
@@ -818,6 +845,7 @@ export namespace Amtk {
818
845
  * @param action_name an action name.
819
846
  * @param flags {@link Amtk.FactoryFlags}.
820
847
  * @returns a new {@link Gtk.ShortcutsShortcut} for `action_name`.
848
+ * @since 5.0
821
849
  */
822
850
  create_shortcut_full(action_name: string, flags: FactoryFlags): Gtk.Widget;
823
851
 
@@ -826,6 +854,7 @@ export namespace Amtk {
826
854
  * {@link Amtk.Factory.default_flags}.
827
855
  * @param entries a pointer to the first item in an array of {@link Amtk.ActionInfoEntry} structs.
828
856
  * @returns a new simple {@link Gtk.Menu} for `entries`.
857
+ * @since 5.0
829
858
  */
830
859
  create_simple_menu(entries: ActionInfoEntry[]): Gtk.Widget;
831
860
 
@@ -845,6 +874,7 @@ export namespace Amtk {
845
874
  * @param entries a pointer to the first item in an array of {@link Amtk.ActionInfoEntry} structs.
846
875
  * @param flags {@link Amtk.FactoryFlags}.
847
876
  * @returns a new simple {@link Gtk.Menu} for `entries`.
877
+ * @since 5.0
848
878
  */
849
879
  create_simple_menu_full(entries: ActionInfoEntry[], flags: FactoryFlags): Gtk.Widget;
850
880
 
@@ -853,6 +883,7 @@ export namespace Amtk {
853
883
  * {@link Amtk.Factory.default_flags}.
854
884
  * @param action_name an action name.
855
885
  * @returns a new {@link Gtk.ToolButton} for `action_name`.
886
+ * @since 3.0
856
887
  */
857
888
  create_tool_button(action_name: string): Gtk.ToolItem;
858
889
 
@@ -862,22 +893,26 @@ export namespace Amtk {
862
893
  * @param action_name an action name.
863
894
  * @param flags {@link Amtk.FactoryFlags}.
864
895
  * @returns a new {@link Gtk.ToolButton} for `action_name`.
896
+ * @since 3.0
865
897
  */
866
898
  create_tool_button_full(action_name: string, flags: FactoryFlags): Gtk.ToolItem;
867
899
 
868
900
  /**
869
901
  * @returns the {@link Amtk.Factory.application}.
902
+ * @since 3.0
870
903
  */
871
904
  get_application(): Gtk.Application | null;
872
905
 
873
906
  /**
874
907
  * @returns the {@link Amtk.Factory.default_flags}.
908
+ * @since 3.0
875
909
  */
876
910
  get_default_flags(): FactoryFlags;
877
911
 
878
912
  /**
879
913
  * Sets the {@link Amtk.Factory.default_flags} property.
880
914
  * @param default_flags the new value.
915
+ * @since 3.0
881
916
  */
882
917
  set_default_flags(default_flags: FactoryFlags): void;
883
918
  }
@@ -894,7 +929,7 @@ export namespace Amtk {
894
929
  * @since 2.0
895
930
  * @run-first
896
931
  */
897
- "menu-item-deselected": (arg0: Gtk.MenuItem) => void;
932
+ "menu-item-deselected": (menu_item: Gtk.MenuItem) => void;
898
933
  /**
899
934
  * The ::menu-item-selected signal is emitted when the
900
935
  * {@link Gtk.MenuItem.SignalSignatures.select | Gtk.MenuItem::select} signal is emitted on a {@link Gtk.MenuItem} belonging
@@ -903,7 +938,7 @@ export namespace Amtk {
903
938
  * @since 2.0
904
939
  * @run-first
905
940
  */
906
- "menu-item-selected": (arg0: Gtk.MenuItem) => void;
941
+ "menu-item-selected": (menu_item: Gtk.MenuItem) => void;
907
942
  "notify::menu-shell": (pspec: GObject.ParamSpec) => void;
908
943
  }
909
944
 
@@ -967,6 +1002,7 @@ export namespace Amtk {
967
1002
  * Returns the {@link Amtk.MenuShell} of `gtk_menu_shell`. The returned object is
968
1003
  * guaranteed to be the same for the lifetime of `gtk_menu_shell`.
969
1004
  * @param gtk_menu_shell a {@link Gtk.MenuShell}.
1005
+ * @since 2.0
970
1006
  */
971
1007
  static get_from_gtk_menu_shell(gtk_menu_shell: Gtk.MenuShell): MenuShell;
972
1008
 
@@ -986,6 +1022,7 @@ export namespace Amtk {
986
1022
  // Methods
987
1023
  /**
988
1024
  * @returns the {@link Gtk.MenuShell} of `amtk_menu_shell`.
1025
+ * @since 2.0
989
1026
  */
990
1027
  get_menu_shell(): Gtk.MenuShell;
991
1028
  }
@@ -1118,17 +1155,20 @@ export namespace Amtk {
1118
1155
  // Methods
1119
1156
  /**
1120
1157
  * @returns the current value of the {@link Amtk.TreeViewScrolledWindowSizing.monitor_limit_enabled} property.
1158
+ * @since 5.10
1121
1159
  */
1122
1160
  get_monitor_limit(): boolean;
1123
1161
 
1124
1162
  /**
1125
1163
  * @returns the {@link Gtk.TreeView}, if the child widget is a {@link Gtk.TreeView}. Otherwise `null` is returned.
1164
+ * @since 5.10
1126
1165
  */
1127
1166
  get_tree_view(): Gtk.TreeView | null;
1128
1167
 
1129
1168
  /**
1130
1169
  * Sets the {@link Amtk.TreeViewScrolledWindowSizing.monitor_limit_enabled} property.
1131
1170
  * @param monitor_limit the new value.
1171
+ * @since 5.10
1132
1172
  */
1133
1173
  set_monitor_limit(monitor_limit: boolean): void;
1134
1174
  }
@@ -1150,6 +1190,7 @@ export namespace Amtk {
1150
1190
  // Methods
1151
1191
  /**
1152
1192
  * @returns a copy of `info`. The copy will have a reference count of one.
1193
+ * @since 2.0
1153
1194
  */
1154
1195
  copy(): ActionInfo;
1155
1196
 
@@ -1158,16 +1199,19 @@ export namespace Amtk {
1158
1199
  * returns a `null`-terminated array, to be suitable for
1159
1200
  * `gtk_application_set_accels_for_action()`.
1160
1201
  * @returns a `null`-terminated array of accelerators in the format understood by `gtk_accelerator_parse()`.
1202
+ * @since 2.0
1161
1203
  */
1162
1204
  get_accels(): string[];
1163
1205
 
1164
1206
  /**
1165
1207
  * @returns the action name, or `null`. Example: `"win.save"`. Can be a detailed action name, see `g_action_parse_detailed_name()`.
1208
+ * @since 2.0
1166
1209
  */
1167
1210
  get_action_name(): string | null;
1168
1211
 
1169
1212
  /**
1170
1213
  * @returns the icon name, or `null`.
1214
+ * @since 2.0
1171
1215
  */
1172
1216
  get_icon_name(): string | null;
1173
1217
 
@@ -1175,11 +1219,13 @@ export namespace Amtk {
1175
1219
  * Gets the label. The label has normally a mnemonic. To remove the mnemonic,
1176
1220
  * there is the `amtk_utils_remove_mnemonic()` function.
1177
1221
  * @returns the label (i.e. a short description), or `null`.
1222
+ * @since 2.0
1178
1223
  */
1179
1224
  get_label(): string | null;
1180
1225
 
1181
1226
  /**
1182
1227
  * @returns the tooltip (i.e. a long description), or `null`.
1228
+ * @since 2.0
1183
1229
  */
1184
1230
  get_tooltip(): string | null;
1185
1231
 
@@ -1187,18 +1233,21 @@ export namespace Amtk {
1187
1233
  * Returns whether `info` has been used (for example by an {@link Amtk.Factory}
1188
1234
  * function). See also `amtk_action_info_store_check_all_used()`.
1189
1235
  * @returns whether `info` has been used.
1236
+ * @since 3.0
1190
1237
  */
1191
1238
  has_been_used(): boolean;
1192
1239
 
1193
1240
  /**
1194
1241
  * Mark `info` as used. An {@link Amtk.Factory} function that uses an {@link Amtk.ActionInfo}
1195
1242
  * should call this function. See `amtk_action_info_store_check_all_used()`.
1243
+ * @since 3.0
1196
1244
  */
1197
1245
  mark_as_used(): void;
1198
1246
 
1199
1247
  /**
1200
1248
  * Increments the reference count of `info` by one.
1201
1249
  * @returns the passed in `info`.
1250
+ * @since 2.0
1202
1251
  */
1203
1252
  ref(): ActionInfo;
1204
1253
 
@@ -1208,6 +1257,7 @@ export namespace Amtk {
1208
1257
  * `accels` must not be `null`, it must be a `null`-terminated array, to be
1209
1258
  * consistent with `gtk_application_set_accels_for_action()`.
1210
1259
  * @param accels a `null`-terminated array of accelerators in the format understood by `gtk_accelerator_parse()`.
1260
+ * @since 2.0
1211
1261
  */
1212
1262
  set_accels(accels: string[]): void;
1213
1263
 
@@ -1215,11 +1265,13 @@ export namespace Amtk {
1215
1265
  * Sets the action name, for example `"win.save"`. Can be a detailed action
1216
1266
  * name, see `g_action_parse_detailed_name()`.
1217
1267
  * @param action_name the action name.
1268
+ * @since 2.0
1218
1269
  */
1219
1270
  set_action_name(action_name: string): void;
1220
1271
 
1221
1272
  /**
1222
1273
  * @param icon_name the icon name, or `null`.
1274
+ * @since 2.0
1223
1275
  */
1224
1276
  set_icon_name(icon_name: string | null): void;
1225
1277
 
@@ -1227,17 +1279,20 @@ export namespace Amtk {
1227
1279
  * Sets the label with a mnemonic. To know how to encode the mnemonic, see the
1228
1280
  * documentation of `gtk_label_new_with_mnemonic()`.
1229
1281
  * @param label the label (i.e. a short description), or `null`.
1282
+ * @since 2.0
1230
1283
  */
1231
1284
  set_label(label: string | null): void;
1232
1285
 
1233
1286
  /**
1234
1287
  * @param tooltip the tooltip (i.e. a long description), or `null`.
1288
+ * @since 2.0
1235
1289
  */
1236
1290
  set_tooltip(tooltip: string | null): void;
1237
1291
 
1238
1292
  /**
1239
1293
  * Decrements the reference count of `info` by one. If the reference count drops
1240
1294
  * to 0, `info` is freed.
1295
+ * @since 2.0
1241
1296
  */
1242
1297
  unref(): void;
1243
1298
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/amtk-5",
3
- "version": "4.3.0",
3
+ "version": "4.5.0",
4
4
  "description": "GJS TypeScript type definitions for Amtk-5",
5
5
  "type": "module",
6
6
  "module": "amtk-5.js",
@@ -16,10 +16,10 @@
16
16
  "import": "./amtk-5-import.js",
17
17
  "default": "./amtk-5-import.js"
18
18
  },
19
- "./surface": {
20
- "types": "./amtk-5-surface.d.ts",
21
- "import": "./amtk-5-surface.js",
22
- "default": "./amtk-5-surface.js"
19
+ "./vocabulary": {
20
+ "types": "./amtk-5-vocabulary.d.ts",
21
+ "import": "./amtk-5-vocabulary.js",
22
+ "default": "./amtk-5-vocabulary.js"
23
23
  },
24
24
  "./amtk-5": {
25
25
  "types": "./amtk-5.d.ts",
@@ -36,20 +36,20 @@
36
36
  "test": "tsc --project tsconfig.json"
37
37
  },
38
38
  "dependencies": {
39
- "@girs/gjs": "^4.3.0",
40
- "@girs/gtk-3.0": "^4.3.0",
41
- "@girs/xlib-2.0": "^4.3.0",
42
- "@girs/gdk-3.0": "^4.3.0",
43
- "@girs/cairo-1.0": "^4.3.0",
44
- "@girs/gobject-2.0": "^4.3.0",
45
- "@girs/glib-2.0": "^4.3.0",
46
- "@girs/pango-1.0": "^4.3.0",
47
- "@girs/harfbuzz-0.0": "^4.3.0",
48
- "@girs/freetype2-2.0": "^4.3.0",
49
- "@girs/gio-2.0": "^4.3.0",
50
- "@girs/gmodule-2.0": "^4.3.0",
51
- "@girs/gdkpixbuf-2.0": "^4.3.0",
52
- "@girs/atk-1.0": "^4.3.0" },
39
+ "@girs/gjs": "^4.5.0",
40
+ "@girs/gtk-3.0": "^4.5.0",
41
+ "@girs/xlib-2.0": "^4.5.0",
42
+ "@girs/gdk-3.0": "^4.5.0",
43
+ "@girs/cairo-1.0": "^4.5.0",
44
+ "@girs/gobject-2.0": "^4.5.0",
45
+ "@girs/glib-2.0": "^4.5.0",
46
+ "@girs/pango-1.0": "^4.5.0",
47
+ "@girs/harfbuzz-0.0": "^4.5.0",
48
+ "@girs/freetype2-2.0": "^4.5.0",
49
+ "@girs/gio-2.0": "^4.5.0",
50
+ "@girs/gmodule-2.0": "^4.5.0",
51
+ "@girs/gdkpixbuf-2.0": "^4.5.0",
52
+ "@girs/atk-1.0": "^4.5.0" },
53
53
  "devDependencies": {
54
54
  "typescript": "*"
55
55
  },
package/tsconfig.json CHANGED
@@ -62,7 +62,7 @@
62
62
  ]
63
63
  }
64
64
  },
65
- "include": ["./amtk-5.d.ts","./amtk-5-surface.d.ts"]
65
+ "include": ["./amtk-5.d.ts","./amtk-5-vocabulary.d.ts"]
66
66
  }
67
67
 
68
68