@girs/bamf-3 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/bamf-3.d.ts +103 -40
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -4,82 +4,77 @@
4
4
  ![version](https://img.shields.io/npm/v/@girs/bamf-3)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/bamf-3)
6
6
 
7
+ GJS TypeScript type definitions for Bamf-3 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.5.0.
7
8
 
8
- GJS TypeScript type definitions for Bamf-3 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/bamf-3
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/bamf-3` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/bamf-3/ambient` | only the `gi://` module declarations |
27
+ | `@girs/bamf-3/import` | only the `imports.gi` declarations |
28
+ | `@girs/bamf-3/bamf-3` | 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 Bamf from '@girs/bamf-3';
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/bamf-3` or `@girs/bamf-3/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/bamf-3'
46
+ import '@girs/bamf-3';
32
47
  ```
33
48
 
34
- `tsconfig.json`:
35
49
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/bamf-3"],
41
- ...
42
- }
50
+ { "include": ["@girs/bamf-3"] }
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 Bamf from 'gi://Bamf?version=3';
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/bamf-3` or `@girs/bamf-3/import` in your `tsconfig` or entry point Typescript file:
59
+ Referencing `@girs/bamf-3/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/bamf-3'
59
- ```
60
-
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/bamf-3"],
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/bamf-3/import`:
73
65
 
74
66
  ```ts
75
67
  const Bamf = imports.gi.Bamf;
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/bamf-3.d.ts CHANGED
@@ -25,14 +25,14 @@ export namespace Bamf {
25
25
  * @gir-type Enum
26
26
  */
27
27
  enum ClickBehavior {
28
- NONE,
29
- OPEN,
30
- FOCUS,
31
- FOCUS_ALL,
32
- MINIMIZE,
33
- RESTORE,
34
- RESTORE_ALL,
35
- PICKER,
28
+ NONE = 0,
29
+ OPEN = 1,
30
+ FOCUS = 2,
31
+ FOCUS_ALL = 3,
32
+ MINIMIZE = 4,
33
+ RESTORE = 5,
34
+ RESTORE_ALL = 6,
35
+ PICKER = 7,
36
36
  }
37
37
 
38
38
 
@@ -40,10 +40,10 @@ export namespace Bamf {
40
40
  * @gir-type Enum
41
41
  */
42
42
  enum WindowMaximizationType {
43
- FLOATING,
44
- HORIZONTAL_MAXIMIZED,
45
- VERTICAL_MAXIMIZED,
46
- MAXIMIZED,
43
+ FLOATING = 0,
44
+ HORIZONTAL_MAXIMIZED = 1,
45
+ VERTICAL_MAXIMIZED = 2,
46
+ MAXIMIZED = 3,
47
47
  }
48
48
 
49
49
 
@@ -51,58 +51,121 @@ export namespace Bamf {
51
51
  * @gir-type Enum
52
52
  */
53
53
  enum WindowType {
54
- NORMAL,
55
- DESKTOP,
56
- DOCK,
57
- DIALOG,
58
- TOOLBAR,
59
- MENU,
60
- UTILITY,
61
- SPLASHSCREEN,
62
- UNKNOWN,
54
+ NORMAL = 0,
55
+ DESKTOP = 1,
56
+ DOCK = 2,
57
+ DIALOG = 3,
58
+ TOOLBAR = 4,
59
+ MENU = 5,
60
+ UTILITY = 6,
61
+ SPLASHSCREEN = 7,
62
+ UNKNOWN = 8,
63
63
  }
64
64
 
65
65
 
66
+ /**
67
+ * @default desktop-file-updated
68
+ */
66
69
  const APPLICATION_SIGNAL_DESKTOP_FILE_UPDATED: string;
67
70
 
71
+ /**
72
+ * @default window-added
73
+ */
68
74
  const APPLICATION_SIGNAL_WINDOW_ADDED: string;
69
75
 
76
+ /**
77
+ * @default window-removed
78
+ */
70
79
  const APPLICATION_SIGNAL_WINDOW_REMOVED: string;
71
80
 
81
+ /**
82
+ * @default active-application-changed
83
+ */
72
84
  const MATCHER_SIGNAL_ACTIVE_APPLICATION_CHANGED: string;
73
85
 
86
+ /**
87
+ * @default active-window-changed
88
+ */
74
89
  const MATCHER_SIGNAL_ACTIVE_WINDOW_CHANGED: string;
75
90
 
91
+ /**
92
+ * @default stacking-order-changed
93
+ */
76
94
  const MATCHER_SIGNAL_STACKING_ORDER_CHANGED: string;
77
95
 
96
+ /**
97
+ * @default view-closed
98
+ */
78
99
  const MATCHER_SIGNAL_VIEW_CLOSED: string;
79
100
 
101
+ /**
102
+ * @default view-opened
103
+ */
80
104
  const MATCHER_SIGNAL_VIEW_OPENED: string;
81
105
 
106
+ /**
107
+ * @default active-changed
108
+ */
82
109
  const VIEW_SIGNAL_ACTIVE_CHANGED: string;
83
110
 
111
+ /**
112
+ * @default child-added
113
+ */
84
114
  const VIEW_SIGNAL_CHILD_ADDED: string;
85
115
 
116
+ /**
117
+ * @default child-moved
118
+ */
86
119
  const VIEW_SIGNAL_CHILD_MOVED: string;
87
120
 
121
+ /**
122
+ * @default child-removed
123
+ */
88
124
  const VIEW_SIGNAL_CHILD_REMOVED: string;
89
125
 
126
+ /**
127
+ * @default closed
128
+ */
90
129
  const VIEW_SIGNAL_CLOSED: string;
91
130
 
131
+ /**
132
+ * @default icon-changed
133
+ */
92
134
  const VIEW_SIGNAL_ICON_CHANGED: string;
93
135
 
136
+ /**
137
+ * @default name-changed
138
+ */
94
139
  const VIEW_SIGNAL_NAME_CHANGED: string;
95
140
 
141
+ /**
142
+ * @default running-changed
143
+ */
96
144
  const VIEW_SIGNAL_RUNNING_CHANGED: string;
97
145
 
146
+ /**
147
+ * @default starting-changed
148
+ */
98
149
  const VIEW_SIGNAL_STARTING_CHANGED: string;
99
150
 
151
+ /**
152
+ * @default urgent-changed
153
+ */
100
154
  const VIEW_SIGNAL_URGENT_CHANGED: string;
101
155
 
156
+ /**
157
+ * @default user-visible-changed
158
+ */
102
159
  const VIEW_SIGNAL_USER_VISIBLE_CHANGED: string;
103
160
 
161
+ /**
162
+ * @default maximized-changed
163
+ */
104
164
  const WINDOW_SIGNAL_MAXIMIZED_CHANGED: string;
105
165
 
166
+ /**
167
+ * @default monitor-changed
168
+ */
106
169
  const WINDOW_SIGNAL_MONITOR_CHANGED: string;
107
170
 
108
171
  /**
@@ -118,15 +181,15 @@ export namespace Bamf {
118
181
  /**
119
182
  * @signal
120
183
  */
121
- "desktop-file-updated": (arg0: string) => void;
184
+ "desktop-file-updated": (object: string) => void;
122
185
  /**
123
186
  * @signal
124
187
  */
125
- "window-added": (arg0: Window) => void;
188
+ "window-added": (object: Window) => void;
126
189
  /**
127
190
  * @signal
128
191
  */
129
- "window-removed": (arg0: Window) => void;
192
+ "window-removed": (object: Window) => void;
130
193
  "notify::active": (pspec: GObject.ParamSpec) => void;
131
194
  "notify::path": (pspec: GObject.ParamSpec) => void;
132
195
  "notify::running": (pspec: GObject.ParamSpec) => void;
@@ -301,11 +364,11 @@ export namespace Bamf {
301
364
  /**
302
365
  * @signal
303
366
  */
304
- "active-application-changed": (arg0: Application, arg1: Application) => void;
367
+ "active-application-changed": (object: Application, p0: Application) => void;
305
368
  /**
306
369
  * @signal
307
370
  */
308
- "active-window-changed": (arg0: Window, arg1: Window) => void;
371
+ "active-window-changed": (object: Window, p0: Window) => void;
309
372
  /**
310
373
  * @signal
311
374
  */
@@ -313,11 +376,11 @@ export namespace Bamf {
313
376
  /**
314
377
  * @signal
315
378
  */
316
- "view-closed": (arg0: View) => void;
379
+ "view-closed": (object: View) => void;
317
380
  /**
318
381
  * @signal
319
382
  */
320
- "view-opened": (arg0: View) => void;
383
+ "view-opened": (object: View) => void;
321
384
  }
322
385
 
323
386
  // Constructor properties interface
@@ -626,22 +689,22 @@ export namespace Bamf {
626
689
  * @signal
627
690
  * @run-first
628
691
  */
629
- "active-changed": (arg0: boolean) => void;
692
+ "active-changed": (object: boolean) => void;
630
693
  /**
631
694
  * @signal
632
695
  * @run-first
633
696
  */
634
- "child-added": (arg0: View) => void;
697
+ "child-added": (object: View) => void;
635
698
  /**
636
699
  * @signal
637
700
  * @run-first
638
701
  */
639
- "child-moved": (arg0: View) => void;
702
+ "child-moved": (object: View) => void;
640
703
  /**
641
704
  * @signal
642
705
  * @run-first
643
706
  */
644
- "child-removed": (arg0: View) => void;
707
+ "child-removed": (object: View) => void;
645
708
  /**
646
709
  * @signal
647
710
  * @run-last
@@ -650,31 +713,31 @@ export namespace Bamf {
650
713
  /**
651
714
  * @signal
652
715
  */
653
- "icon-changed": (arg0: string) => void;
716
+ "icon-changed": (object: string) => void;
654
717
  /**
655
718
  * @signal
656
719
  */
657
- "name-changed": (arg0: string, arg1: string) => void;
720
+ "name-changed": (object: string, p0: string) => void;
658
721
  /**
659
722
  * @signal
660
723
  * @run-first
661
724
  */
662
- "running-changed": (arg0: boolean) => void;
725
+ "running-changed": (object: boolean) => void;
663
726
  /**
664
727
  * @signal
665
728
  * @run-first
666
729
  */
667
- "starting-changed": (arg0: boolean) => void;
730
+ "starting-changed": (object: boolean) => void;
668
731
  /**
669
732
  * @signal
670
733
  * @run-first
671
734
  */
672
- "urgent-changed": (arg0: boolean) => void;
735
+ "urgent-changed": (object: boolean) => void;
673
736
  /**
674
737
  * @signal
675
738
  * @run-first
676
739
  */
677
- "user-visible-changed": (arg0: boolean) => void;
740
+ "user-visible-changed": (object: boolean) => void;
678
741
  "notify::active": (pspec: GObject.ParamSpec) => void;
679
742
  "notify::path": (pspec: GObject.ParamSpec) => void;
680
743
  "notify::running": (pspec: GObject.ParamSpec) => void;
@@ -996,12 +1059,12 @@ export namespace Bamf {
996
1059
  * @signal
997
1060
  * @run-first
998
1061
  */
999
- "maximized-changed": (arg0: number, arg1: number) => void;
1062
+ "maximized-changed": (object: number, p0: number) => void;
1000
1063
  /**
1001
1064
  * @signal
1002
1065
  * @run-first
1003
1066
  */
1004
- "monitor-changed": (arg0: number, arg1: number) => void;
1067
+ "monitor-changed": (object: number, p0: number) => void;
1005
1068
  "notify::active": (pspec: GObject.ParamSpec) => void;
1006
1069
  "notify::path": (pspec: GObject.ParamSpec) => void;
1007
1070
  "notify::running": (pspec: GObject.ParamSpec) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/bamf-3",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "description": "GJS TypeScript type definitions for Bamf-3",
5
5
  "type": "module",
6
6
  "module": "bamf-3.js",
@@ -31,9 +31,9 @@
31
31
  "test": "tsc --project tsconfig.json"
32
32
  },
33
33
  "dependencies": {
34
- "@girs/gjs": "^4.4.0",
35
- "@girs/gobject-2.0": "^4.4.0",
36
- "@girs/glib-2.0": "^4.4.0" },
34
+ "@girs/gjs": "^4.5.0",
35
+ "@girs/gobject-2.0": "^4.5.0",
36
+ "@girs/glib-2.0": "^4.5.0" },
37
37
  "devDependencies": {
38
38
  "typescript": "*"
39
39
  },