@girs/cmenu-3.0 4.2.0 → 4.4.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 +8 -8
- package/cmenu-3.0.d.ts +20 -2
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -5,25 +5,25 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for CMenu-3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.
|
|
8
|
+
GJS TypeScript type definitions for CMenu-3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.0.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Install the type definitions with npm:
|
|
13
13
|
```bash
|
|
14
14
|
npm install @girs/cmenu-3.0
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Import it like any other module:
|
|
20
20
|
```ts
|
|
21
21
|
import CMenu from '@girs/cmenu-3.0';
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
### Ambient Modules
|
|
25
25
|
|
|
26
|
-
|
|
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
27
|
For this you need to include `@girs/cmenu-3.0` or `@girs/cmenu-3.0/ambient` in your `tsconfig` or entry point Typescript file:
|
|
28
28
|
|
|
29
29
|
`index.ts`:
|
|
@@ -42,7 +42,7 @@ import '@girs/cmenu-3.0'
|
|
|
42
42
|
}
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
The ambient module now resolves with types:
|
|
46
46
|
|
|
47
47
|
```ts
|
|
48
48
|
import CMenu from 'gi://CMenu?version=3.0';
|
|
@@ -50,7 +50,7 @@ import CMenu from 'gi://CMenu?version=3.0';
|
|
|
50
50
|
|
|
51
51
|
### Global import
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
GJS's global `imports.gi` works too, with types.
|
|
54
54
|
For this you need to include `@girs/cmenu-3.0` or `@girs/cmenu-3.0/import` in your `tsconfig` or entry point Typescript file:
|
|
55
55
|
|
|
56
56
|
`index.ts`:
|
|
@@ -69,7 +69,7 @@ import '@girs/cmenu-3.0'
|
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
That form carries types as well:
|
|
73
73
|
|
|
74
74
|
```ts
|
|
75
75
|
const CMenu = imports.gi.CMenu;
|
|
@@ -77,7 +77,7 @@ const CMenu = imports.gi.CMenu;
|
|
|
77
77
|
|
|
78
78
|
### Bundle
|
|
79
79
|
|
|
80
|
-
|
|
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.
|
|
81
81
|
|
|
82
82
|
## Other packages
|
|
83
83
|
|
package/cmenu-3.0.d.ts
CHANGED
|
@@ -115,6 +115,7 @@ export namespace CMenu {
|
|
|
115
115
|
* action.
|
|
116
116
|
* @param action_name the name of the action as from `gmenu_desktopappinfo_list_actions()`
|
|
117
117
|
* @returns the locale-specific action name
|
|
118
|
+
* @since 2.38
|
|
118
119
|
*/
|
|
119
120
|
get_action_name(action_name: string): string;
|
|
120
121
|
|
|
@@ -138,6 +139,7 @@ export namespace CMenu {
|
|
|
138
139
|
* situations such as the {@link CMenu.DesktopAppInfo} returned from
|
|
139
140
|
* `gmenu_desktopappinfo_new_from_keyfile()`, this function will return `null`.
|
|
140
141
|
* @returns The full path to the file for `info`, or `null` if not known.
|
|
142
|
+
* @since 2.24
|
|
141
143
|
*/
|
|
142
144
|
get_filename(): string;
|
|
143
145
|
|
|
@@ -278,6 +280,7 @@ export namespace CMenu {
|
|
|
278
280
|
* Obtains the information whether the {@link Gio.AppInfo} can be deleted.
|
|
279
281
|
* See {@link Gio.AppInfo.delete}.
|
|
280
282
|
* @returns `TRUE` if `appinfo` can be deleted
|
|
283
|
+
* @since 2.20
|
|
281
284
|
*/
|
|
282
285
|
can_delete(): boolean;
|
|
283
286
|
|
|
@@ -294,6 +297,7 @@ export namespace CMenu {
|
|
|
294
297
|
* {@link Gio.AppInfo}s which can be deleted, and system-wide ones which cannot.
|
|
295
298
|
* See {@link Gio.AppInfo.can_delete}.
|
|
296
299
|
* @returns `TRUE` if `appinfo` has been deleted
|
|
300
|
+
* @since 2.20
|
|
297
301
|
*/
|
|
298
302
|
["delete"](): boolean;
|
|
299
303
|
|
|
@@ -318,6 +322,7 @@ export namespace CMenu {
|
|
|
318
322
|
* Gets the commandline with which the application will be
|
|
319
323
|
* started.
|
|
320
324
|
* @returns a string containing the `appinfo`’s commandline, or `NULL` if this information is not available
|
|
325
|
+
* @since 2.20
|
|
321
326
|
*/
|
|
322
327
|
get_commandline(): string | null;
|
|
323
328
|
|
|
@@ -331,6 +336,7 @@ export namespace CMenu {
|
|
|
331
336
|
* Gets the display name of the application. The display name is often more
|
|
332
337
|
* descriptive to the user than the name itself.
|
|
333
338
|
* @returns the display name of the application for `appinfo`, or the name if no display name is available.
|
|
339
|
+
* @since 2.24
|
|
334
340
|
*/
|
|
335
341
|
get_display_name(): string;
|
|
336
342
|
|
|
@@ -376,8 +382,9 @@ export namespace CMenu {
|
|
|
376
382
|
* {@link Gio.AppInfo.add_supports_type}, but only those exported directly by
|
|
377
383
|
* the application.
|
|
378
384
|
* @returns a list of content types.
|
|
385
|
+
* @since 2.34
|
|
379
386
|
*/
|
|
380
|
-
get_supported_types(): string[];
|
|
387
|
+
get_supported_types(): string[] | null;
|
|
381
388
|
|
|
382
389
|
/**
|
|
383
390
|
* Launches the application. Passes `files` to the launched application
|
|
@@ -442,6 +449,7 @@ export namespace CMenu {
|
|
|
442
449
|
* @param uris a list of URIs to launch.
|
|
443
450
|
* @param context the launch context
|
|
444
451
|
* @param cancellable a {@link Gio.Cancellable}
|
|
452
|
+
* @since 2.60
|
|
445
453
|
*/
|
|
446
454
|
launch_uris_async(uris: string[] | null, context: Gio.AppLaunchContext | null, cancellable: Gio.Cancellable | null): globalThis.Promise<boolean>;
|
|
447
455
|
|
|
@@ -456,6 +464,7 @@ export namespace CMenu {
|
|
|
456
464
|
* @param context the launch context
|
|
457
465
|
* @param cancellable a {@link Gio.Cancellable}
|
|
458
466
|
* @param callback a {@link Gio.AsyncReadyCallback} to call when the request is done
|
|
467
|
+
* @since 2.60
|
|
459
468
|
*/
|
|
460
469
|
launch_uris_async(uris: string[] | null, context: Gio.AppLaunchContext | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
|
|
461
470
|
|
|
@@ -470,6 +479,7 @@ export namespace CMenu {
|
|
|
470
479
|
* @param context the launch context
|
|
471
480
|
* @param cancellable a {@link Gio.Cancellable}
|
|
472
481
|
* @param callback a {@link Gio.AsyncReadyCallback} to call when the request is done
|
|
482
|
+
* @since 2.60
|
|
473
483
|
*/
|
|
474
484
|
launch_uris_async(uris: string[] | null, context: Gio.AppLaunchContext | null, cancellable: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): globalThis.Promise<boolean> | void;
|
|
475
485
|
|
|
@@ -477,6 +487,7 @@ export namespace CMenu {
|
|
|
477
487
|
* Finishes a {@link Gio.AppInfo.launch_uris_async} operation.
|
|
478
488
|
* @param result the async result
|
|
479
489
|
* @returns `TRUE` on successful launch, `FALSE` otherwise.
|
|
490
|
+
* @since 2.60
|
|
480
491
|
*/
|
|
481
492
|
launch_uris_finish(result: Gio.AsyncResult): boolean;
|
|
482
493
|
|
|
@@ -541,6 +552,7 @@ export namespace CMenu {
|
|
|
541
552
|
/**
|
|
542
553
|
* Obtains the information whether the {@link Gio.AppInfo} can be deleted.
|
|
543
554
|
* See {@link Gio.AppInfo.delete}.
|
|
555
|
+
* @since 2.20
|
|
544
556
|
* @virtual
|
|
545
557
|
*/
|
|
546
558
|
vfunc_can_delete(): boolean;
|
|
@@ -557,6 +569,7 @@ export namespace CMenu {
|
|
|
557
569
|
* On some platforms, there may be a difference between user-defined
|
|
558
570
|
* {@link Gio.AppInfo}s which can be deleted, and system-wide ones which cannot.
|
|
559
571
|
* See {@link Gio.AppInfo.can_delete}.
|
|
572
|
+
* @since 2.20
|
|
560
573
|
* @virtual
|
|
561
574
|
*/
|
|
562
575
|
vfunc_do_delete(): boolean;
|
|
@@ -581,6 +594,7 @@ export namespace CMenu {
|
|
|
581
594
|
/**
|
|
582
595
|
* Gets the commandline with which the application will be
|
|
583
596
|
* started.
|
|
597
|
+
* @since 2.20
|
|
584
598
|
* @virtual
|
|
585
599
|
*/
|
|
586
600
|
vfunc_get_commandline(): string | null;
|
|
@@ -594,6 +608,7 @@ export namespace CMenu {
|
|
|
594
608
|
/**
|
|
595
609
|
* Gets the display name of the application. The display name is often more
|
|
596
610
|
* descriptive to the user than the name itself.
|
|
611
|
+
* @since 2.24
|
|
597
612
|
* @virtual
|
|
598
613
|
*/
|
|
599
614
|
vfunc_get_display_name(): string;
|
|
@@ -639,9 +654,10 @@ export namespace CMenu {
|
|
|
639
654
|
* This function does not take in consideration associations added with
|
|
640
655
|
* {@link Gio.AppInfo.add_supports_type}, but only those exported directly by
|
|
641
656
|
* the application.
|
|
657
|
+
* @since 2.34
|
|
642
658
|
* @virtual
|
|
643
659
|
*/
|
|
644
|
-
vfunc_get_supported_types(): string[];
|
|
660
|
+
vfunc_get_supported_types(): string[] | null;
|
|
645
661
|
|
|
646
662
|
/**
|
|
647
663
|
* Launches the application. Passes `files` to the launched application
|
|
@@ -707,6 +723,7 @@ export namespace CMenu {
|
|
|
707
723
|
* @param context the launch context
|
|
708
724
|
* @param cancellable a {@link Gio.Cancellable}
|
|
709
725
|
* @param callback a {@link Gio.AsyncReadyCallback} to call when the request is done
|
|
726
|
+
* @since 2.60
|
|
710
727
|
* @virtual
|
|
711
728
|
*/
|
|
712
729
|
vfunc_launch_uris_async(uris: string[] | null, context: Gio.AppLaunchContext | null, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
|
|
@@ -714,6 +731,7 @@ export namespace CMenu {
|
|
|
714
731
|
/**
|
|
715
732
|
* Finishes a {@link Gio.AppInfo.launch_uris_async} operation.
|
|
716
733
|
* @param result the async result
|
|
734
|
+
* @since 2.60
|
|
717
735
|
* @virtual
|
|
718
736
|
*/
|
|
719
737
|
vfunc_launch_uris_finish(result: Gio.AsyncResult): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/cmenu-3.0",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "GJS TypeScript type definitions for CMenu-3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "cmenu-3.0.js",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"test": "tsc --project tsconfig.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@girs/gjs": "^4.
|
|
35
|
-
"@girs/gio-2.0": "^4.
|
|
36
|
-
"@girs/gobject-2.0": "^4.
|
|
37
|
-
"@girs/glib-2.0": "^4.
|
|
38
|
-
"@girs/gmodule-2.0": "^4.
|
|
34
|
+
"@girs/gjs": "^4.4.0",
|
|
35
|
+
"@girs/gio-2.0": "^4.4.0",
|
|
36
|
+
"@girs/gobject-2.0": "^4.4.0",
|
|
37
|
+
"@girs/glib-2.0": "^4.4.0",
|
|
38
|
+
"@girs/gmodule-2.0": "^4.4.0" },
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"typescript": "*"
|
|
41
41
|
},
|