@girs/gck-1 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.
Files changed (3) hide show
  1. package/README.md +8 -8
  2. package/gck-1.d.ts +16 -0
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -5,25 +5,25 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gck-1)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for Gck-1, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.2.0.
8
+ GJS TypeScript type definitions for Gck-1, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.0.
9
9
 
10
10
  ## Install
11
11
 
12
- To use this type definitions, install them with NPM:
12
+ Install the type definitions with npm:
13
13
  ```bash
14
14
  npm install @girs/gck-1
15
15
  ```
16
16
 
17
17
  ## Usage
18
18
 
19
- You can import this package into your project like this:
19
+ Import it like any other module:
20
20
  ```ts
21
21
  import Gck from '@girs/gck-1';
22
22
  ```
23
23
 
24
24
  ### Ambient Modules
25
25
 
26
- You can also use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) to import this module like you would do this in JavaScript.
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/gck-1` or `@girs/gck-1/ambient` in your `tsconfig` or entry point Typescript file:
28
28
 
29
29
  `index.ts`:
@@ -42,7 +42,7 @@ import '@girs/gck-1'
42
42
  }
43
43
  ```
44
44
 
45
- Now you can import the ambient module with TypeScript support:
45
+ The ambient module now resolves with types:
46
46
 
47
47
  ```ts
48
48
  import Gck from 'gi://Gck?version=1';
@@ -50,7 +50,7 @@ import Gck from 'gi://Gck?version=1';
50
50
 
51
51
  ### Global import
52
52
 
53
- You can also import the module with Typescript support using the global `imports.gi` object of GJS.
53
+ GJS's global `imports.gi` works too, with types.
54
54
  For this you need to include `@girs/gck-1` or `@girs/gck-1/import` in your `tsconfig` or entry point Typescript file:
55
55
 
56
56
  `index.ts`:
@@ -69,7 +69,7 @@ import '@girs/gck-1'
69
69
  }
70
70
  ```
71
71
 
72
- Now you have also type support for this, too:
72
+ That form carries types as well:
73
73
 
74
74
  ```ts
75
75
  const Gck = imports.gi.Gck;
@@ -77,7 +77,7 @@ const Gck = imports.gi.Gck;
77
77
 
78
78
  ### Bundle
79
79
 
80
- 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).
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/gck-1.d.ts CHANGED
@@ -644,6 +644,7 @@ export namespace Gck {
644
644
  * This may be set to NULL if this object was created from an already
645
645
  * initialized module via the `gck_module_new()` function.
646
646
  * @construct-only
647
+ * @default null
647
648
  */
648
649
  get path(): string;
649
650
 
@@ -790,6 +791,7 @@ export namespace Gck {
790
791
  /**
791
792
  * The raw PKCS11 handle for this object.
792
793
  * @construct-only
794
+ * @default 0
793
795
  */
794
796
  get handle(): number;
795
797
 
@@ -1445,6 +1447,7 @@ export namespace Gck {
1445
1447
  /**
1446
1448
  * The raw CK_SESSION_HANDLE handle of this session.
1447
1449
  * @construct-only
1450
+ * @default 0
1448
1451
  */
1449
1452
  get handle(): number;
1450
1453
 
@@ -1465,18 +1468,21 @@ export namespace Gck {
1465
1468
  /**
1466
1469
  * Raw PKCS#11 flags used to open the PKCS#11 session.
1467
1470
  * @construct-only
1471
+ * @default 0
1468
1472
  */
1469
1473
  set opening_flags(val: bigint | number);
1470
1474
 
1471
1475
  /**
1472
1476
  * Raw PKCS#11 flags used to open the PKCS#11 session.
1473
1477
  * @construct-only
1478
+ * @default 0
1474
1479
  */
1475
1480
  set openingFlags(val: bigint | number);
1476
1481
 
1477
1482
  /**
1478
1483
  * The options this session was opened with.
1479
1484
  * @construct-only
1485
+ * @default Gck.SessionOptions.READ_ONLY
1480
1486
  */
1481
1487
  get options(): SessionOptions;
1482
1488
 
@@ -2571,6 +2577,7 @@ export namespace Gck {
2571
2577
  * any interface methods.
2572
2578
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2573
2579
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2580
+ * @since 2.22
2574
2581
  */
2575
2582
  init_async(io_priority: number, cancellable: Gio.Cancellable | null): globalThis.Promise<boolean>;
2576
2583
 
@@ -2614,6 +2621,7 @@ export namespace Gck {
2614
2621
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2615
2622
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2616
2623
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
2624
+ * @since 2.22
2617
2625
  */
2618
2626
  init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
2619
2627
 
@@ -2657,6 +2665,7 @@ export namespace Gck {
2657
2665
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2658
2666
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2659
2667
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
2668
+ * @since 2.22
2660
2669
  */
2661
2670
  init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): globalThis.Promise<boolean> | void;
2662
2671
 
@@ -2665,6 +2674,7 @@ export namespace Gck {
2665
2674
  * See `g_async_initable_init_async()`.
2666
2675
  * @param res a {@link Gio.AsyncResult}.
2667
2676
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
2677
+ * @since 2.22
2668
2678
  */
2669
2679
  init_finish(res: Gio.AsyncResult): boolean;
2670
2680
 
@@ -2673,6 +2683,7 @@ export namespace Gck {
2673
2683
  * calls, returning the created object or `null` on error.
2674
2684
  * @param res the {@link Gio.AsyncResult} from the callback
2675
2685
  * @returns a newly created {@link GObject.Object}, or `null` on error. Free with `g_object_unref()`.
2686
+ * @since 2.22
2676
2687
  */
2677
2688
  new_finish(res: Gio.AsyncResult): Session;
2678
2689
 
@@ -2716,6 +2727,7 @@ export namespace Gck {
2716
2727
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2717
2728
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2718
2729
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
2730
+ * @since 2.22
2719
2731
  * @virtual
2720
2732
  */
2721
2733
  vfunc_init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
@@ -2724,6 +2736,7 @@ export namespace Gck {
2724
2736
  * Finishes asynchronous initialization and returns the result.
2725
2737
  * See `g_async_initable_init_async()`.
2726
2738
  * @param res a {@link Gio.AsyncResult}.
2739
+ * @since 2.22
2727
2740
  * @virtual
2728
2741
  */
2729
2742
  vfunc_init_finish(res: Gio.AsyncResult): boolean;
@@ -2769,6 +2782,7 @@ export namespace Gck {
2769
2782
  * instance.
2770
2783
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2771
2784
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
2785
+ * @since 2.22
2772
2786
  */
2773
2787
  init(cancellable: Gio.Cancellable | null): boolean;
2774
2788
 
@@ -2812,6 +2826,7 @@ export namespace Gck {
2812
2826
  * on the result of `g_object_new()`, regardless of whether it is in fact a new
2813
2827
  * instance.
2814
2828
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2829
+ * @since 2.22
2815
2830
  * @virtual
2816
2831
  */
2817
2832
  vfunc_init(cancellable: Gio.Cancellable | null): boolean;
@@ -2847,6 +2862,7 @@ export namespace Gck {
2847
2862
  /**
2848
2863
  * The raw CK_SLOT_ID handle of this slot.
2849
2864
  * @construct-only
2865
+ * @default 0
2850
2866
  */
2851
2867
  get handle(): number;
2852
2868
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gck-1",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "libraryVersion": "1.0.0",
5
5
  "description": "GJS TypeScript type definitions for Gck-1, generated from library version 1.0.0",
6
6
  "type": "module",
@@ -32,11 +32,11 @@
32
32
  "test": "tsc --project tsconfig.json"
33
33
  },
34
34
  "dependencies": {
35
- "@girs/gjs": "^4.2.0",
36
- "@girs/gio-2.0": "^4.2.0",
37
- "@girs/gobject-2.0": "^4.2.0",
38
- "@girs/glib-2.0": "^4.2.0",
39
- "@girs/gmodule-2.0": "^4.2.0" },
35
+ "@girs/gjs": "^4.4.0",
36
+ "@girs/gio-2.0": "^4.4.0",
37
+ "@girs/gobject-2.0": "^4.4.0",
38
+ "@girs/glib-2.0": "^4.4.0",
39
+ "@girs/gmodule-2.0": "^4.4.0" },
40
40
  "devDependencies": {
41
41
  "typescript": "*"
42
42
  },