@girs/notify-0.7 0.8.2-3.2.3 → 0.8.2-3.2.8
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 +14 -1
- package/notify-0.7-ambient.d.ts +0 -1
- package/notify-0.7-ambient.js +2 -0
- package/notify-0.7-import.d.ts +0 -1
- package/notify-0.7-import.js +3 -0
- package/notify-0.7.d.cts +20 -20
- package/notify-0.7.d.ts +20 -20
- package/package.json +16 -10
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for Notify-0.7, generated from library version 0.8.2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.
|
|
8
|
+
GJS TypeScript type definitions for Notify-0.7, generated from library version 0.8.2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.8.
|
|
9
9
|
|
|
10
10
|
libnotify is a library that sends desktop notifications to a notification daemon, as defined in the Desktop Notifications spec. These notifications can be used to inform the user about an event or display some form of information without getting in the user's way.
|
|
11
11
|
|
|
@@ -82,6 +82,19 @@ Now you have also type support for this, too:
|
|
|
82
82
|
const Notify = imports.gi.Notify;
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
|
|
86
|
+
### ESM vs. CommonJS
|
|
87
|
+
|
|
88
|
+
GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
|
|
89
|
+
|
|
90
|
+
In TypeScript projects for GJS and GNOME Shell extensions, you have the flexibility to use `ESM` syntax and then decide the import syntax for your bundled file. If your bundler is configured to use `CommonJS`, it will convert to the GJS-specific global imports syntax, like `const moduleName = imports.gi[moduleName]`. This is different from the traditional `require` syntax seen in Node.js. The global imports syntax is chosen because it aligns with the CommonJS format supported by NPM, which is used for the generated type definitions and this package.
|
|
91
|
+
|
|
92
|
+
On the other hand, if you configure your bundler to use ESM, it will retain the ESM import syntax. It's crucial to ensure that your bundler is set up to correctly translate and bundle these imports into either CommonJS or ESM format, depending on your project's requirements.
|
|
93
|
+
|
|
94
|
+
This approach is particularly important due to the `@girs` types, which include both `*.cjs `files, using the GJS global imports syntax, and `*.js` files, which utilize the ESM syntax. By appropriately setting up your bundler, you can control which syntax—CommonJS or ESM—is used in your project. The choice of CommonJS in this context is also due to the similarity between the GJS-specific global imports and CommonJS syntax, allowing for easier management and bundling in these specific types of projects.
|
|
95
|
+
|
|
96
|
+
Since GNOME Shell 45, you should only use ESM, even for GNOME Shell extensions. Before that, extensions had to use the global import syntax, unlike normal GJS applications, where ESM has been available for some time.
|
|
97
|
+
|
|
85
98
|
### Bundle
|
|
86
99
|
|
|
87
100
|
Depending on your project configuration, it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). You can find examples using different bundlers [here](https://github.com/gjsify/ts-for-gir/tree/main/examples).
|
package/notify-0.7-ambient.d.ts
CHANGED
package/notify-0.7-import.d.ts
CHANGED
package/notify-0.7.d.cts
CHANGED
|
@@ -87,7 +87,7 @@ export const VERSION_MINOR: number
|
|
|
87
87
|
* Gets the application name registered.
|
|
88
88
|
* @returns The registered application name, passed to [func@init].
|
|
89
89
|
*/
|
|
90
|
-
export function get_app_name(): string
|
|
90
|
+
export function get_app_name(): string
|
|
91
91
|
/**
|
|
92
92
|
* Queries the server capabilities.
|
|
93
93
|
*
|
|
@@ -104,7 +104,7 @@ export function get_server_caps(): string[]
|
|
|
104
104
|
* that it is compliant with.
|
|
105
105
|
* @returns %TRUE if successful, and the variables passed will be set, %FALSE on error. The returned strings must be freed with g_free
|
|
106
106
|
*/
|
|
107
|
-
export function get_server_info(): [ /* returnType */ boolean, /* ret_name */ string
|
|
107
|
+
export function get_server_info(): [ /* returnType */ boolean, /* ret_name */ string, /* ret_vendor */ string, /* ret_version */ string, /* ret_spec_version */ string ]
|
|
108
108
|
/**
|
|
109
109
|
* Initialized libnotify. This must be called before any other functions.
|
|
110
110
|
*
|
|
@@ -124,7 +124,7 @@ export function is_initted(): boolean
|
|
|
124
124
|
* Sets the application name.
|
|
125
125
|
* @param app_name The name of the application
|
|
126
126
|
*/
|
|
127
|
-
export function set_app_name(app_name: string
|
|
127
|
+
export function set_app_name(app_name: string): void
|
|
128
128
|
/**
|
|
129
129
|
* Uninitializes libnotify.
|
|
130
130
|
*
|
|
@@ -162,7 +162,7 @@ export module Notification {
|
|
|
162
162
|
/**
|
|
163
163
|
* The name of the application for the notification.
|
|
164
164
|
*/
|
|
165
|
-
|
|
165
|
+
appName?: string | null
|
|
166
166
|
/**
|
|
167
167
|
* The body of the notification.
|
|
168
168
|
*/
|
|
@@ -170,7 +170,7 @@ export module Notification {
|
|
|
170
170
|
/**
|
|
171
171
|
* The icon-name of the icon to be displayed on the notification.
|
|
172
172
|
*/
|
|
173
|
-
|
|
173
|
+
iconName?: string | null
|
|
174
174
|
/**
|
|
175
175
|
* The Id of the notification.
|
|
176
176
|
*/
|
|
@@ -190,7 +190,7 @@ export interface Notification {
|
|
|
190
190
|
/**
|
|
191
191
|
* The name of the application for the notification.
|
|
192
192
|
*/
|
|
193
|
-
|
|
193
|
+
appName: string | null
|
|
194
194
|
/**
|
|
195
195
|
* The body of the notification.
|
|
196
196
|
*/
|
|
@@ -200,11 +200,11 @@ export interface Notification {
|
|
|
200
200
|
*
|
|
201
201
|
* See [signal`Notification:`:closed].
|
|
202
202
|
*/
|
|
203
|
-
readonly
|
|
203
|
+
readonly closedReason: number
|
|
204
204
|
/**
|
|
205
205
|
* The icon-name of the icon to be displayed on the notification.
|
|
206
206
|
*/
|
|
207
|
-
|
|
207
|
+
iconName: string | null
|
|
208
208
|
/**
|
|
209
209
|
* The Id of the notification.
|
|
210
210
|
*/
|
|
@@ -225,7 +225,7 @@ export interface Notification {
|
|
|
225
225
|
* @param label The human-readable action label.
|
|
226
226
|
* @param callback The action's callback function.
|
|
227
227
|
*/
|
|
228
|
-
add_action(action: string
|
|
228
|
+
add_action(action: string, label: string, callback: ActionCallback): void
|
|
229
229
|
/**
|
|
230
230
|
* Clears all actions from the notification.
|
|
231
231
|
*/
|
|
@@ -274,7 +274,7 @@ export interface Notification {
|
|
|
274
274
|
* a certain way.
|
|
275
275
|
* @param category The category.
|
|
276
276
|
*/
|
|
277
|
-
set_category(category: string
|
|
277
|
+
set_category(category: string): void
|
|
278
278
|
/**
|
|
279
279
|
* Sets a hint for `key` with value `value`.
|
|
280
280
|
*
|
|
@@ -284,13 +284,13 @@ export interface Notification {
|
|
|
284
284
|
* @param key the hint key
|
|
285
285
|
* @param value the hint value
|
|
286
286
|
*/
|
|
287
|
-
set_hint(key: string
|
|
287
|
+
set_hint(key: string, value: GLib.Variant | null): void
|
|
288
288
|
/**
|
|
289
289
|
* Sets a hint with a byte value.
|
|
290
290
|
* @param key The hint.
|
|
291
291
|
* @param value The hint's value.
|
|
292
292
|
*/
|
|
293
|
-
set_hint_byte(key: string
|
|
293
|
+
set_hint_byte(key: string, value: number): void
|
|
294
294
|
/**
|
|
295
295
|
* Sets a hint with a byte array value.
|
|
296
296
|
*
|
|
@@ -298,31 +298,31 @@ export interface Notification {
|
|
|
298
298
|
* @param key The hint.
|
|
299
299
|
* @param value The hint's value.
|
|
300
300
|
*/
|
|
301
|
-
set_hint_byte_array(key: string
|
|
301
|
+
set_hint_byte_array(key: string, value: Uint8Array): void
|
|
302
302
|
/**
|
|
303
303
|
* Sets a hint with a double value.
|
|
304
304
|
* @param key The hint.
|
|
305
305
|
* @param value The hint's value.
|
|
306
306
|
*/
|
|
307
|
-
set_hint_double(key: string
|
|
307
|
+
set_hint_double(key: string, value: number): void
|
|
308
308
|
/**
|
|
309
309
|
* Sets a hint with a 32-bit integer value.
|
|
310
310
|
* @param key The hint.
|
|
311
311
|
* @param value The hint's value.
|
|
312
312
|
*/
|
|
313
|
-
set_hint_int32(key: string
|
|
313
|
+
set_hint_int32(key: string, value: number): void
|
|
314
314
|
/**
|
|
315
315
|
* Sets a hint with a string value.
|
|
316
316
|
* @param key The hint.
|
|
317
317
|
* @param value The hint's value.
|
|
318
318
|
*/
|
|
319
|
-
set_hint_string(key: string
|
|
319
|
+
set_hint_string(key: string, value: string): void
|
|
320
320
|
/**
|
|
321
321
|
* Sets a hint with an unsigned 32-bit integer value.
|
|
322
322
|
* @param key The hint.
|
|
323
323
|
* @param value The hint's value.
|
|
324
324
|
*/
|
|
325
|
-
set_hint_uint32(key: string
|
|
325
|
+
set_hint_uint32(key: string, value: number): void
|
|
326
326
|
/**
|
|
327
327
|
* Sets the icon in the notification from a #GdkPixbuf.
|
|
328
328
|
* @param icon The icon.
|
|
@@ -363,7 +363,7 @@ export interface Notification {
|
|
|
363
363
|
* @param icon The optional icon theme icon name or filename.
|
|
364
364
|
* @returns %TRUE, unless an invalid parameter was passed.
|
|
365
365
|
*/
|
|
366
|
-
update(summary: string
|
|
366
|
+
update(summary: string, body: string | null, icon: string | null): boolean
|
|
367
367
|
|
|
368
368
|
// Own virtual methods of Notify-0.7.Notify.Notification
|
|
369
369
|
|
|
@@ -432,7 +432,7 @@ export class Notification extends GObject.Object {
|
|
|
432
432
|
* @param icon The optional icon theme icon name or filename.
|
|
433
433
|
* @returns The new #NotifyNotification.
|
|
434
434
|
*/
|
|
435
|
-
constructor(summary: string
|
|
435
|
+
constructor(summary: string, body: string | null, icon: string | null)
|
|
436
436
|
/**
|
|
437
437
|
* Creates a new #NotifyNotification.
|
|
438
438
|
*
|
|
@@ -443,7 +443,7 @@ export class Notification extends GObject.Object {
|
|
|
443
443
|
* @param icon The optional icon theme icon name or filename.
|
|
444
444
|
* @returns The new #NotifyNotification.
|
|
445
445
|
*/
|
|
446
|
-
static new(summary: string
|
|
446
|
+
static new(summary: string, body: string | null, icon: string | null): Notification
|
|
447
447
|
_init(config?: Notification.ConstructorProperties): void
|
|
448
448
|
}
|
|
449
449
|
|
package/notify-0.7.d.ts
CHANGED
|
@@ -89,7 +89,7 @@ const VERSION_MINOR: number
|
|
|
89
89
|
* Gets the application name registered.
|
|
90
90
|
* @returns The registered application name, passed to [func@init].
|
|
91
91
|
*/
|
|
92
|
-
function get_app_name(): string
|
|
92
|
+
function get_app_name(): string
|
|
93
93
|
/**
|
|
94
94
|
* Queries the server capabilities.
|
|
95
95
|
*
|
|
@@ -106,7 +106,7 @@ function get_server_caps(): string[]
|
|
|
106
106
|
* that it is compliant with.
|
|
107
107
|
* @returns %TRUE if successful, and the variables passed will be set, %FALSE on error. The returned strings must be freed with g_free
|
|
108
108
|
*/
|
|
109
|
-
function get_server_info(): [ /* returnType */ boolean, /* ret_name */ string
|
|
109
|
+
function get_server_info(): [ /* returnType */ boolean, /* ret_name */ string, /* ret_vendor */ string, /* ret_version */ string, /* ret_spec_version */ string ]
|
|
110
110
|
/**
|
|
111
111
|
* Initialized libnotify. This must be called before any other functions.
|
|
112
112
|
*
|
|
@@ -126,7 +126,7 @@ function is_initted(): boolean
|
|
|
126
126
|
* Sets the application name.
|
|
127
127
|
* @param app_name The name of the application
|
|
128
128
|
*/
|
|
129
|
-
function set_app_name(app_name: string
|
|
129
|
+
function set_app_name(app_name: string): void
|
|
130
130
|
/**
|
|
131
131
|
* Uninitializes libnotify.
|
|
132
132
|
*
|
|
@@ -164,7 +164,7 @@ module Notification {
|
|
|
164
164
|
/**
|
|
165
165
|
* The name of the application for the notification.
|
|
166
166
|
*/
|
|
167
|
-
|
|
167
|
+
appName?: string | null
|
|
168
168
|
/**
|
|
169
169
|
* The body of the notification.
|
|
170
170
|
*/
|
|
@@ -172,7 +172,7 @@ module Notification {
|
|
|
172
172
|
/**
|
|
173
173
|
* The icon-name of the icon to be displayed on the notification.
|
|
174
174
|
*/
|
|
175
|
-
|
|
175
|
+
iconName?: string | null
|
|
176
176
|
/**
|
|
177
177
|
* The Id of the notification.
|
|
178
178
|
*/
|
|
@@ -192,7 +192,7 @@ interface Notification {
|
|
|
192
192
|
/**
|
|
193
193
|
* The name of the application for the notification.
|
|
194
194
|
*/
|
|
195
|
-
|
|
195
|
+
appName: string | null
|
|
196
196
|
/**
|
|
197
197
|
* The body of the notification.
|
|
198
198
|
*/
|
|
@@ -202,11 +202,11 @@ interface Notification {
|
|
|
202
202
|
*
|
|
203
203
|
* See [signal`Notification:`:closed].
|
|
204
204
|
*/
|
|
205
|
-
readonly
|
|
205
|
+
readonly closedReason: number
|
|
206
206
|
/**
|
|
207
207
|
* The icon-name of the icon to be displayed on the notification.
|
|
208
208
|
*/
|
|
209
|
-
|
|
209
|
+
iconName: string | null
|
|
210
210
|
/**
|
|
211
211
|
* The Id of the notification.
|
|
212
212
|
*/
|
|
@@ -227,7 +227,7 @@ interface Notification {
|
|
|
227
227
|
* @param label The human-readable action label.
|
|
228
228
|
* @param callback The action's callback function.
|
|
229
229
|
*/
|
|
230
|
-
add_action(action: string
|
|
230
|
+
add_action(action: string, label: string, callback: ActionCallback): void
|
|
231
231
|
/**
|
|
232
232
|
* Clears all actions from the notification.
|
|
233
233
|
*/
|
|
@@ -276,7 +276,7 @@ interface Notification {
|
|
|
276
276
|
* a certain way.
|
|
277
277
|
* @param category The category.
|
|
278
278
|
*/
|
|
279
|
-
set_category(category: string
|
|
279
|
+
set_category(category: string): void
|
|
280
280
|
/**
|
|
281
281
|
* Sets a hint for `key` with value `value`.
|
|
282
282
|
*
|
|
@@ -286,13 +286,13 @@ interface Notification {
|
|
|
286
286
|
* @param key the hint key
|
|
287
287
|
* @param value the hint value
|
|
288
288
|
*/
|
|
289
|
-
set_hint(key: string
|
|
289
|
+
set_hint(key: string, value: GLib.Variant | null): void
|
|
290
290
|
/**
|
|
291
291
|
* Sets a hint with a byte value.
|
|
292
292
|
* @param key The hint.
|
|
293
293
|
* @param value The hint's value.
|
|
294
294
|
*/
|
|
295
|
-
set_hint_byte(key: string
|
|
295
|
+
set_hint_byte(key: string, value: number): void
|
|
296
296
|
/**
|
|
297
297
|
* Sets a hint with a byte array value.
|
|
298
298
|
*
|
|
@@ -300,31 +300,31 @@ interface Notification {
|
|
|
300
300
|
* @param key The hint.
|
|
301
301
|
* @param value The hint's value.
|
|
302
302
|
*/
|
|
303
|
-
set_hint_byte_array(key: string
|
|
303
|
+
set_hint_byte_array(key: string, value: Uint8Array): void
|
|
304
304
|
/**
|
|
305
305
|
* Sets a hint with a double value.
|
|
306
306
|
* @param key The hint.
|
|
307
307
|
* @param value The hint's value.
|
|
308
308
|
*/
|
|
309
|
-
set_hint_double(key: string
|
|
309
|
+
set_hint_double(key: string, value: number): void
|
|
310
310
|
/**
|
|
311
311
|
* Sets a hint with a 32-bit integer value.
|
|
312
312
|
* @param key The hint.
|
|
313
313
|
* @param value The hint's value.
|
|
314
314
|
*/
|
|
315
|
-
set_hint_int32(key: string
|
|
315
|
+
set_hint_int32(key: string, value: number): void
|
|
316
316
|
/**
|
|
317
317
|
* Sets a hint with a string value.
|
|
318
318
|
* @param key The hint.
|
|
319
319
|
* @param value The hint's value.
|
|
320
320
|
*/
|
|
321
|
-
set_hint_string(key: string
|
|
321
|
+
set_hint_string(key: string, value: string): void
|
|
322
322
|
/**
|
|
323
323
|
* Sets a hint with an unsigned 32-bit integer value.
|
|
324
324
|
* @param key The hint.
|
|
325
325
|
* @param value The hint's value.
|
|
326
326
|
*/
|
|
327
|
-
set_hint_uint32(key: string
|
|
327
|
+
set_hint_uint32(key: string, value: number): void
|
|
328
328
|
/**
|
|
329
329
|
* Sets the icon in the notification from a #GdkPixbuf.
|
|
330
330
|
* @param icon The icon.
|
|
@@ -365,7 +365,7 @@ interface Notification {
|
|
|
365
365
|
* @param icon The optional icon theme icon name or filename.
|
|
366
366
|
* @returns %TRUE, unless an invalid parameter was passed.
|
|
367
367
|
*/
|
|
368
|
-
update(summary: string
|
|
368
|
+
update(summary: string, body: string | null, icon: string | null): boolean
|
|
369
369
|
|
|
370
370
|
// Own virtual methods of Notify-0.7.Notify.Notification
|
|
371
371
|
|
|
@@ -434,7 +434,7 @@ class Notification extends GObject.Object {
|
|
|
434
434
|
* @param icon The optional icon theme icon name or filename.
|
|
435
435
|
* @returns The new #NotifyNotification.
|
|
436
436
|
*/
|
|
437
|
-
constructor(summary: string
|
|
437
|
+
constructor(summary: string, body: string | null, icon: string | null)
|
|
438
438
|
/**
|
|
439
439
|
* Creates a new #NotifyNotification.
|
|
440
440
|
*
|
|
@@ -445,7 +445,7 @@ class Notification extends GObject.Object {
|
|
|
445
445
|
* @param icon The optional icon theme icon name or filename.
|
|
446
446
|
* @returns The new #NotifyNotification.
|
|
447
447
|
*/
|
|
448
|
-
static new(summary: string
|
|
448
|
+
static new(summary: string, body: string | null, icon: string | null): Notification
|
|
449
449
|
_init(config?: Notification.ConstructorProperties): void
|
|
450
450
|
}
|
|
451
451
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/notify-0.7",
|
|
3
|
-
"version": "0.8.2-3.2.
|
|
3
|
+
"version": "0.8.2-3.2.8",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Notify-0.7, generated from library version 0.8.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "notify-0.7.js",
|
|
7
7
|
"main": "notify-0.7.js",
|
|
8
8
|
"exports": {
|
|
9
|
-
"./ambient":
|
|
10
|
-
|
|
9
|
+
"./ambient": {
|
|
10
|
+
"types": "./notify-0.7-ambient.d.ts",
|
|
11
|
+
"default": "./notify-0.7-ambient.js"
|
|
12
|
+
},
|
|
13
|
+
"./import": {
|
|
14
|
+
"types": "./notify-0.7-import.d.ts",
|
|
15
|
+
"default": "./notify-0.7-import.js"
|
|
16
|
+
},
|
|
11
17
|
".": {
|
|
12
18
|
"import": {
|
|
13
19
|
"types": "./notify-0.7.d.ts",
|
|
@@ -25,12 +31,12 @@
|
|
|
25
31
|
"test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit notify-0.7.d.cts"
|
|
26
32
|
},
|
|
27
33
|
"dependencies": {
|
|
28
|
-
"@girs/gdkpixbuf-2.0": "^2.0.0-3.2.
|
|
29
|
-
"@girs/gio-2.0": "^2.
|
|
30
|
-
"@girs/gjs": "^3.2.
|
|
31
|
-
"@girs/glib-2.0": "^2.
|
|
32
|
-
"@girs/gmodule-2.0": "^2.0.0-3.2.
|
|
33
|
-
"@girs/gobject-2.0": "^2.
|
|
34
|
+
"@girs/gdkpixbuf-2.0": "^2.0.0-3.2.8",
|
|
35
|
+
"@girs/gio-2.0": "^2.77.0-3.2.8",
|
|
36
|
+
"@girs/gjs": "^3.2.8",
|
|
37
|
+
"@girs/glib-2.0": "^2.77.0-3.2.8",
|
|
38
|
+
"@girs/gmodule-2.0": "^2.0.0-3.2.8",
|
|
39
|
+
"@girs/gobject-2.0": "^2.77.0-3.2.8"
|
|
34
40
|
},
|
|
35
41
|
"devDependencies": {
|
|
36
42
|
"typescript": "*"
|
|
@@ -47,7 +53,7 @@
|
|
|
47
53
|
"license": "MIT",
|
|
48
54
|
"repository": {
|
|
49
55
|
"type": "git",
|
|
50
|
-
"url": "git+https://github.com/gjsify/
|
|
56
|
+
"url": "git+https://github.com/gjsify/ts-for-gir.git"
|
|
51
57
|
},
|
|
52
58
|
"bugs": {
|
|
53
59
|
"url": "https://github.com/gjsify/ts-for-gir/issues"
|