@girs/amtk-4 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.
Files changed (3) hide show
  1. package/README.md +36 -41
  2. package/amtk-4.d.ts +10 -10
  3. package/package.json +15 -15
package/README.md CHANGED
@@ -4,82 +4,77 @@
4
4
  ![version](https://img.shields.io/npm/v/@girs/amtk-4)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/amtk-4)
6
6
 
7
+ GJS TypeScript type definitions for Amtk-4 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.5.0.
7
8
 
8
- GJS TypeScript type definitions for Amtk-4 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/amtk-4
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-4` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/amtk-4/ambient` | only the `gi://` module declarations |
27
+ | `@girs/amtk-4/import` | only the `imports.gi` declarations |
28
+ | `@girs/amtk-4/amtk-4` | the namespace, without the side-effecting declarations |
29
+
30
+ ## Three ways to import
31
+
32
+ Which one you use depends on how you write imports elsewhere, not on your toolchain.
33
+
34
+ ### As a module
18
35
 
19
- Import it like any other module:
20
36
  ```ts
21
37
  import Amtk from '@girs/amtk-4';
22
38
  ```
23
39
 
24
- ### Ambient Modules
40
+ ### As `gi://`
25
41
 
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-4` or `@girs/amtk-4/ambient` in your `tsconfig` or entry point Typescript file:
42
+ GJS resolves `gi://` at runtime. To give it types, reference the package once, either
43
+ from your entry point or from `tsconfig.json`:
28
44
 
29
- `index.ts`:
30
45
  ```ts
31
- import '@girs/amtk-4'
46
+ import '@girs/amtk-4';
32
47
  ```
33
48
 
34
- `tsconfig.json`:
35
49
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/amtk-4"],
41
- ...
42
- }
50
+ { "include": ["@girs/amtk-4"] }
43
51
  ```
44
52
 
45
- The ambient module now resolves with types:
53
+ Then the runtime spelling type-checks:
46
54
 
47
55
  ```ts
48
56
  import Amtk from 'gi://Amtk?version=4';
49
57
  ```
50
58
 
51
- ### Global import
52
-
53
- GJS's global `imports.gi` works too, with types.
54
- For this you need to include `@girs/amtk-4` or `@girs/amtk-4/import` in your `tsconfig` or entry point Typescript file:
59
+ Referencing `@girs/amtk-4/ambient` instead pulls in these declarations
60
+ alone. See [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules).
55
61
 
56
- `index.ts`:
57
- ```ts
58
- import '@girs/amtk-4'
59
- ```
60
-
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/amtk-4"],
68
- ...
69
- }
70
- ```
62
+ ### As `imports.gi`
71
63
 
72
- That form carries types as well:
64
+ GJS's global object works the same way, via `@girs/amtk-4/import`:
73
65
 
74
66
  ```ts
75
67
  const Amtk = imports.gi.Amtk;
76
68
  ```
77
69
 
78
- ### Bundle
70
+ ## Building
79
71
 
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.
72
+ The declarations need no build step. If you bundle, every bundler works, since there is
73
+ no runtime code to resolve. The [examples](https://github.com/gjsify/ts-for-gir/tree/main/examples)
74
+ show working setups for several.
81
75
 
82
76
  ## Other packages
83
77
 
84
- All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
78
+ Every pre-generated package is at [gjsify/types](https://github.com/gjsify/types).
79
+
85
80
 
package/amtk-4.d.ts CHANGED
@@ -198,38 +198,38 @@ export namespace Amtk {
198
198
  /**
199
199
  * No flags.
200
200
  */
201
- FLAGS_NONE,
201
+ FLAGS_NONE = 0,
202
202
  /**
203
203
  * Do not call `gtk_actionable_set_action_name()`.
204
204
  */
205
- IGNORE_GACTION,
205
+ IGNORE_GACTION = 1,
206
206
  /**
207
207
  * Do not set an icon.
208
208
  */
209
- IGNORE_ICON,
209
+ IGNORE_ICON = 2,
210
210
  /**
211
211
  * Do not set a label/short description.
212
212
  */
213
- IGNORE_LABEL,
213
+ IGNORE_LABEL = 4,
214
214
  /**
215
215
  * Do not set a tooltip/long description.
216
216
  */
217
- IGNORE_TOOLTIP,
217
+ IGNORE_TOOLTIP = 8,
218
218
  /**
219
219
  * Ignore completely the accelerators.
220
220
  */
221
- IGNORE_ACCELS,
221
+ IGNORE_ACCELS = 16,
222
222
  /**
223
223
  * Ignore the accelerators for
224
224
  * documentation purposes only. For example do not add/configure a
225
225
  * {@link Gtk.AccelLabel}.
226
226
  */
227
- IGNORE_ACCELS_FOR_DOC,
227
+ IGNORE_ACCELS_FOR_DOC = 32,
228
228
  /**
229
229
  * Do not call
230
230
  * `gtk_application_set_accels_for_action()`.
231
231
  */
232
- IGNORE_ACCELS_FOR_APP,
232
+ IGNORE_ACCELS_FOR_APP = 64,
233
233
  }
234
234
 
235
235
 
@@ -732,7 +732,7 @@ export namespace Amtk {
732
732
  * @since 2.0
733
733
  * @run-first
734
734
  */
735
- "menu-item-deselected": (arg0: Gtk.MenuItem) => void;
735
+ "menu-item-deselected": (menu_item: Gtk.MenuItem) => void;
736
736
  /**
737
737
  * The ::menu-item-selected signal is emitted when the
738
738
  * {@link Gtk.MenuItem.SignalSignatures.select | Gtk.MenuItem::select} signal is emitted on a {@link Gtk.MenuItem} belonging
@@ -741,7 +741,7 @@ export namespace Amtk {
741
741
  * @since 2.0
742
742
  * @run-first
743
743
  */
744
- "menu-item-selected": (arg0: Gtk.MenuItem) => void;
744
+ "menu-item-selected": (menu_item: Gtk.MenuItem) => void;
745
745
  "notify::menu-shell": (pspec: GObject.ParamSpec) => void;
746
746
  }
747
747
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/amtk-4",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "GJS TypeScript type definitions for Amtk-4",
5
5
  "type": "module",
6
6
  "module": "amtk-4.js",
@@ -31,20 +31,20 @@
31
31
  "test": "tsc --project tsconfig.json"
32
32
  },
33
33
  "dependencies": {
34
- "@girs/gjs": "^4.4.0",
35
- "@girs/gtk-3.0": "^4.4.0",
36
- "@girs/xlib-2.0": "^4.4.0",
37
- "@girs/gdk-3.0": "^4.4.0",
38
- "@girs/cairo-1.0": "^4.4.0",
39
- "@girs/gobject-2.0": "^4.4.0",
40
- "@girs/glib-2.0": "^4.4.0",
41
- "@girs/pango-1.0": "^4.4.0",
42
- "@girs/harfbuzz-0.0": "^4.4.0",
43
- "@girs/freetype2-2.0": "^4.4.0",
44
- "@girs/gio-2.0": "^4.4.0",
45
- "@girs/gmodule-2.0": "^4.4.0",
46
- "@girs/gdkpixbuf-2.0": "^4.4.0",
47
- "@girs/atk-1.0": "^4.4.0" },
34
+ "@girs/gjs": "^4.5.0",
35
+ "@girs/gtk-3.0": "^4.5.0",
36
+ "@girs/xlib-2.0": "^4.5.0",
37
+ "@girs/gdk-3.0": "^4.5.0",
38
+ "@girs/cairo-1.0": "^4.5.0",
39
+ "@girs/gobject-2.0": "^4.5.0",
40
+ "@girs/glib-2.0": "^4.5.0",
41
+ "@girs/pango-1.0": "^4.5.0",
42
+ "@girs/harfbuzz-0.0": "^4.5.0",
43
+ "@girs/freetype2-2.0": "^4.5.0",
44
+ "@girs/gio-2.0": "^4.5.0",
45
+ "@girs/gmodule-2.0": "^4.5.0",
46
+ "@girs/gdkpixbuf-2.0": "^4.5.0",
47
+ "@girs/atk-1.0": "^4.5.0" },
48
48
  "devDependencies": {
49
49
  "typescript": "*"
50
50
  },