@girs/gck-1 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/gck-1.d.ts +100 -20
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -4,82 +4,77 @@
4
4
  ![version](https://img.shields.io/npm/v/@girs/gck-1)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gck-1)
6
6
 
7
+ 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.5.0.
7
8
 
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
+ 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/gck-1
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/gck-1` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/gck-1/ambient` | only the `gi://` module declarations |
27
+ | `@girs/gck-1/import` | only the `imports.gi` declarations |
28
+ | `@girs/gck-1/gck-1` | 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 Gck from '@girs/gck-1';
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/gck-1` or `@girs/gck-1/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/gck-1'
46
+ import '@girs/gck-1';
32
47
  ```
33
48
 
34
- `tsconfig.json`:
35
49
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/gck-1"],
41
- ...
42
- }
50
+ { "include": ["@girs/gck-1"] }
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 Gck from 'gi://Gck?version=1';
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/gck-1` or `@girs/gck-1/import` in your `tsconfig` or entry point Typescript file:
59
+ Referencing `@girs/gck-1/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/gck-1'
59
- ```
60
-
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/gck-1"],
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/gck-1/import`:
73
65
 
74
66
  ```ts
75
67
  const Gck = imports.gi.Gck;
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/gck-1.d.ts CHANGED
@@ -38,11 +38,11 @@ export namespace Gck {
38
38
  /**
39
39
  * no special flags
40
40
  */
41
- NONE,
41
+ NONE = 0,
42
42
  /**
43
43
  * use non-pageable memory for the values of the attributes
44
44
  */
45
- SECURE_MEMORY,
45
+ SECURE_MEMORY = 1,
46
46
  }
47
47
 
48
48
 
@@ -66,7 +66,7 @@ export namespace Gck {
66
66
  * a result code that signifies there was a problem
67
67
  * loading a PKCS#11 module, usually a shared library
68
68
  */
69
- PROBLEM,
69
+ PROBLEM = -951891199,
70
70
  }
71
71
 
72
72
 
@@ -85,64 +85,72 @@ export namespace Gck {
85
85
  /**
86
86
  * invalid URI scheme
87
87
  */
88
- BAD_SCHEME,
88
+ BAD_SCHEME = 1,
89
89
  /**
90
90
  * bad URI encoding
91
91
  */
92
- BAD_ENCODING,
92
+ BAD_ENCODING = 2,
93
93
  /**
94
94
  * bad URI syntax
95
95
  */
96
- BAD_SYNTAX,
96
+ BAD_SYNTAX = 3,
97
97
  /**
98
98
  * bad URI version component
99
99
  */
100
- BAD_VERSION,
100
+ BAD_VERSION = 4,
101
101
  /**
102
102
  * piece of the URI was not found
103
103
  */
104
- NOT_FOUND,
104
+ NOT_FOUND = 5,
105
105
  }
106
106
 
107
107
 
108
108
  /**
109
109
  * Used as a terminator at the end of variable argument lists.
110
+ * @default -1
110
111
  */
111
112
  const INVALID: number;
112
113
 
113
114
  /**
114
115
  * The major version number of the Gck library.
116
+ * @default 1
115
117
  */
116
118
  const MAJOR_VERSION: number;
117
119
 
118
120
  /**
119
121
  * The micro version number of the Gck library.
122
+ * @default 0
120
123
  */
121
124
  const MICRO_VERSION: number;
122
125
 
123
126
  /**
124
127
  * The minor version number of the Gck library.
128
+ * @default 0
125
129
  */
126
130
  const MINOR_VERSION: number;
127
131
 
128
132
  /**
129
133
  * The URI will match specific version of modules. To be used as a GckUriFlags argument.
134
+ * @default 24
130
135
  */
131
136
  const URI_FOR_MODULE_WITH_VERSION: number;
132
137
 
133
138
  /**
134
139
  * The URI will match objects on a specific token. To be used as a GckUriFlags argument.
140
+ * @default 6
135
141
  */
136
142
  const URI_FOR_OBJECT_ON_TOKEN: number;
137
143
 
138
144
  /**
139
145
  * The token inserted into a device with a specific module.
146
+ * @default 8
140
147
  */
141
148
  const URI_FOR_OBJECT_ON_TOKEN_AND_MODULE: number;
142
149
 
143
150
  /**
144
151
  * Custom PKCS#11 errors that originate from the gck library, are
145
152
  * based at this error code.
153
+ * @default 1195592448
146
154
  */
147
155
  const VENDOR_CODE: number;
148
156
 
@@ -190,6 +198,7 @@ export namespace Gck {
190
198
  * @param uri The URI that the enumerator will match
191
199
  * @param session_options Options from GckSessionOptions
192
200
  * @returns A new {@link Gck.Enumerator}, or `null` if an error occurs.
201
+ * @throws GLib.Error
193
202
  */
194
203
  function modules_enumerate_uri(modules: Module[], uri: string, session_options: SessionOptions): Enumerator;
195
204
 
@@ -205,6 +214,7 @@ export namespace Gck {
205
214
  * Load and initialize all the registered modules.
206
215
  * @param cancellable optional cancellation object
207
216
  * @returns A newly allocated list of {@link Gck.Module} objects, which should be released with `gck_list_unref_free()`.
217
+ * @throws GLib.Error
208
218
  */
209
219
  function modules_initialize_registered(cancellable: Gio.Cancellable | null): Module[];
210
220
 
@@ -231,6 +241,7 @@ export namespace Gck {
231
241
  * PKCS#11 modules.
232
242
  * @param result the asynchronous result
233
243
  * @returns a list of newly initialized {@link Gck.Module} objects
244
+ * @throws GLib.Error
234
245
  */
235
246
  function modules_initialize_registered_finish(result: Gio.AsyncResult): Module[];
236
247
 
@@ -243,6 +254,7 @@ export namespace Gck {
243
254
  * @param uri The URI the objects must match
244
255
  * @param session_options Options from GckSessionOptions
245
256
  * @returns A new {@link Gck.Object} which should be released with `g_object_unref()`, or `null` if no matching object was found.
257
+ * @throws GLib.Error
246
258
  */
247
259
  function modules_object_for_uri(modules: Module[], uri: string, session_options: SessionOptions): Object | null;
248
260
 
@@ -255,6 +267,7 @@ export namespace Gck {
255
267
  * @param uri The URI the objects must match
256
268
  * @param session_options Options from GckSessionOptions
257
269
  * @returns A list of {@link Gck.Object} which should be released with `gck_list_unref_free()`, or `null` if no matching object was found.
270
+ * @throws GLib.Error
258
271
  */
259
272
  function modules_objects_for_uri(modules: Module[], uri: string, session_options: SessionOptions): Object[];
260
273
 
@@ -263,6 +276,7 @@ export namespace Gck {
263
276
  * @param modules The modules
264
277
  * @param uri The URI that the token must match
265
278
  * @returns A newly allocated {@link Gck.Slot} or `null` if no such token was found.
279
+ * @throws GLib.Error
266
280
  */
267
281
  function modules_token_for_uri(modules: Module[], uri: string): Slot;
268
282
 
@@ -271,6 +285,7 @@ export namespace Gck {
271
285
  * @param modules The modules
272
286
  * @param uri The URI that the token must match
273
287
  * @returns A list of newly allocated {@link Gck.Slot} objects. Use `gck_list_unref_free()` to release the list once you're done with it.
288
+ * @throws GLib.Error
274
289
  */
275
290
  function modules_tokens_for_uri(modules: Module[], uri: string): Slot[];
276
291
 
@@ -316,6 +331,7 @@ export namespace Gck {
316
331
  * @param string the URI to parse.
317
332
  * @param flags the context in which the URI will be used.
318
333
  * @returns a newly allocated {@link Gck.UriData}; which should be freed with `gck_uri_data_free()`
334
+ * @throws GLib.Error
319
335
  */
320
336
  function uri_parse(string: string, flags: UriFlags): UriData;
321
337
 
@@ -355,19 +371,19 @@ export namespace Gck {
355
371
  /**
356
372
  * Open session as read only
357
373
  */
358
- READ_ONLY,
374
+ READ_ONLY = 0,
359
375
  /**
360
376
  * Open sessions as read/write
361
377
  */
362
- READ_WRITE,
378
+ READ_WRITE = 2,
363
379
  /**
364
380
  * Login as user on new sessions
365
381
  */
366
- LOGIN_USER,
382
+ LOGIN_USER = 4,
367
383
  /**
368
384
  * Authenticate as necessary
369
385
  */
370
- AUTHENTICATE,
386
+ AUTHENTICATE = 8,
371
387
  }
372
388
 
373
389
 
@@ -387,23 +403,23 @@ export namespace Gck {
387
403
  /**
388
404
  * the URI will be used to match objects.
389
405
  */
390
- FOR_OBJECT,
406
+ FOR_OBJECT = 2,
391
407
  /**
392
408
  * the URI will be used to match tokens.
393
409
  */
394
- FOR_TOKEN,
410
+ FOR_TOKEN = 4,
395
411
  /**
396
412
  * the URI will be used to match modules.
397
413
  */
398
- FOR_MODULE,
414
+ FOR_MODULE = 8,
399
415
  /**
400
416
  * the URI has specific version numbers for module and/or token
401
417
  */
402
- WITH_VERSION,
418
+ WITH_VERSION = 16,
403
419
  /**
404
420
  * parse all recognized components of the URI.
405
421
  */
406
- FOR_ANY,
422
+ FOR_ANY = 65535,
407
423
  }
408
424
 
409
425
 
@@ -504,6 +520,7 @@ export namespace Gck {
504
520
  * whether a failure occurred or not.
505
521
  * @param cancellable A {@link Gio.Cancellable} or `null`
506
522
  * @returns The next object, which must be released using g_object_unref, or `null`.
523
+ * @throws GLib.Error
507
524
  */
508
525
  next(cancellable: Gio.Cancellable | null): Object | null;
509
526
 
@@ -546,6 +563,7 @@ export namespace Gck {
546
563
  * whether a failure occurred or not.
547
564
  * @param result The result passed to the callback
548
565
  * @returns The list of objects, which should be freed with `gck_list_unref_free()`
566
+ * @throws GLib.Error
549
567
  */
550
568
  next_finish(result: Gio.AsyncResult): Object[];
551
569
 
@@ -559,6 +577,7 @@ export namespace Gck {
559
577
  * @param max_objects The maximum amount of objects to enumerate
560
578
  * @param cancellable A {@link Gio.Cancellable} or `null`
561
579
  * @returns A list of objects, which should be freed using `gck_list_unref_free()`.
580
+ * @throws GLib.Error
562
581
  */
563
582
  next_n(max_objects: number, cancellable: Gio.Cancellable | null): Object[];
564
583
 
@@ -598,14 +617,14 @@ export namespace Gck {
598
617
  * @deprecated Since 3.4
599
618
  * @run-last
600
619
  */
601
- "authenticate-object": (arg0: Object, arg1: string, arg2: null) => boolean | void;
620
+ "authenticate-object": (object: Object, label: string, password: null) => boolean | void;
602
621
  /**
603
622
  * Use `gck_session_set_interaction()` instead of connecting to this signal.
604
623
  * @signal
605
624
  * @deprecated Since 3.4
606
625
  * @run-last
607
626
  */
608
- "authenticate-slot": (arg0: Slot, arg1: string, arg2: null) => boolean | void;
627
+ "authenticate-slot": (slot: Slot, string: string, password: null) => boolean | void;
609
628
  "notify::functions": (pspec: GObject.ParamSpec) => void;
610
629
  "notify::path": (pspec: GObject.ParamSpec) => void;
611
630
  }
@@ -855,6 +874,7 @@ export namespace Gck {
855
874
  * @param attr_types the types of attributes to update
856
875
  * @param cancellable optional cancellation object
857
876
  * @returns the attributes retrieved or `null` on failure
877
+ * @throws GLib.Error
858
878
  */
859
879
  cache_lookup(attr_types: (bigint | number)[], cancellable: Gio.Cancellable | null): Attributes;
860
880
 
@@ -913,6 +933,7 @@ export namespace Gck {
913
933
  * from the object if necessary.
914
934
  * @param result the asynchrounous result passed to the callback
915
935
  * @returns the attributes retrieved or `null` on failure
936
+ * @throws GLib.Error
916
937
  */
917
938
  cache_lookup_finish(result: Gio.AsyncResult): Attributes;
918
939
 
@@ -921,6 +942,7 @@ export namespace Gck {
921
942
  * This call may block for an indefinite period.
922
943
  * @param cancellable Optional cancellable object, or `null` to ignore.
923
944
  * @returns Whether the call was successful or not.
945
+ * @throws GLib.Error
924
946
  */
925
947
  destroy(cancellable: Gio.Cancellable | null): boolean;
926
948
 
@@ -952,6 +974,7 @@ export namespace Gck {
952
974
  * `gck_object_destroy_async()`.
953
975
  * @param result The result of the destory operation passed to the callback.
954
976
  * @returns Whether the object was destroyed successfully or not.
977
+ * @throws GLib.Error
955
978
  */
956
979
  destroy_finish(result: Gio.AsyncResult): boolean;
957
980
 
@@ -1009,6 +1032,7 @@ export namespace Gck {
1009
1032
  * @param attr_type The attribute to get data for.
1010
1033
  * @param cancellable A {@link Gio.Cancellable} or `null`
1011
1034
  * @returns the resulting PKCS#11 attribute data, or `null` if an error occurred
1035
+ * @throws GLib.Error
1012
1036
  */
1013
1037
  get_data(attr_type: bigint | number, cancellable: Gio.Cancellable | null): Uint8Array;
1014
1038
 
@@ -1056,6 +1080,7 @@ export namespace Gck {
1056
1080
  * not included in the returned length.
1057
1081
  * @param result The result passed to the callback.
1058
1082
  * @returns The PKCS#11 attribute data or `null` if an error occurred.
1083
+ * @throws GLib.Error
1059
1084
  */
1060
1085
  get_data_finish(result: Gio.AsyncResult): Uint8Array;
1061
1086
 
@@ -1066,6 +1091,7 @@ export namespace Gck {
1066
1091
  * No extra references are added to the returned attributes pointer.
1067
1092
  * @param result The result passed to the callback.
1068
1093
  * @returns The filled in attributes structure if successful or `null` if not successful.
1094
+ * @throws GLib.Error
1069
1095
  */
1070
1096
  get_finish(result: Gio.AsyncResult): Attributes;
1071
1097
 
@@ -1078,6 +1104,7 @@ export namespace Gck {
1078
1104
  * @param attr_types the types of the attributes to get
1079
1105
  * @param cancellable optional cancellation object, or `null`
1080
1106
  * @returns a pointer to the filled in attributes if successful, or `null` if not
1107
+ * @throws GLib.Error
1081
1108
  */
1082
1109
  get_full(attr_types: (bigint | number)[], cancellable: Gio.Cancellable | null): Attributes;
1083
1110
 
@@ -1112,6 +1139,7 @@ export namespace Gck {
1112
1139
  * @param attr_type The template attribute type.
1113
1140
  * @param cancellable Optional cancellation object, or `null`.
1114
1141
  * @returns the resulting PKCS#11 attribute template, or `null` if an error occurred
1142
+ * @throws GLib.Error
1115
1143
  */
1116
1144
  get_template(attr_type: bigint | number, cancellable: Gio.Cancellable | null): Attributes;
1117
1145
 
@@ -1152,6 +1180,7 @@ export namespace Gck {
1152
1180
  * an object.
1153
1181
  * @param result The result passed to the callback.
1154
1182
  * @returns the resulting PKCS#11 attribute template, or `null` if an error occurred
1183
+ * @throws GLib.Error
1155
1184
  */
1156
1185
  get_template_finish(result: Gio.AsyncResult): Attributes;
1157
1186
 
@@ -1171,6 +1200,7 @@ export namespace Gck {
1171
1200
  * @param attrs The attributes to set on the object.
1172
1201
  * @param cancellable Optional cancellable object, or `null` to ignore.
1173
1202
  * @returns Whether the call was successful or not.
1203
+ * @throws GLib.Error
1174
1204
  */
1175
1205
  set(attrs: Attributes, cancellable: Gio.Cancellable | null): boolean;
1176
1206
 
@@ -1217,6 +1247,7 @@ export namespace Gck {
1217
1247
  * begun with `gck_object_set_async()`.
1218
1248
  * @param result The result of the destory operation passed to the callback.
1219
1249
  * @returns Whether the attributes were successfully set on the object or not.
1250
+ * @throws GLib.Error
1220
1251
  */
1221
1252
  set_finish(result: Gio.AsyncResult): boolean;
1222
1253
 
@@ -1231,6 +1262,7 @@ export namespace Gck {
1231
1262
  * @param attrs The attribute template.
1232
1263
  * @param cancellable Optional cancellation object, or `null`.
1233
1264
  * @returns `true` if the operation succeeded.
1265
+ * @throws GLib.Error
1234
1266
  */
1235
1267
  set_template(attr_type: bigint | number, attrs: Attributes, cancellable: Gio.Cancellable | null): boolean;
1236
1268
 
@@ -1280,6 +1312,7 @@ export namespace Gck {
1280
1312
  * an object.
1281
1313
  * @param result The result passed to the callback.
1282
1314
  * @returns `true` if the operation succeeded.
1315
+ * @throws GLib.Error
1283
1316
  */
1284
1317
  set_template_finish(result: Gio.AsyncResult): boolean;
1285
1318
  }
@@ -1397,7 +1430,7 @@ export namespace Gck {
1397
1430
  * @signal
1398
1431
  * @run-last
1399
1432
  */
1400
- "discard-handle": (arg0: number) => boolean | void;
1433
+ "discard-handle": (handle: number) => boolean | void;
1401
1434
  "notify::app-data": (pspec: GObject.ParamSpec) => void;
1402
1435
  "notify::handle": (pspec: GObject.ParamSpec) => void;
1403
1436
  "notify::interaction": (pspec: GObject.ParamSpec) => void;
@@ -1565,6 +1598,7 @@ export namespace Gck {
1565
1598
  * @param attrs The attributes to create the object with.
1566
1599
  * @param cancellable Optional cancellation object, or `null`.
1567
1600
  * @returns the newly created object or `null` if an error occurred
1601
+ * @throws GLib.Error
1568
1602
  */
1569
1603
  create_object(attrs: Attributes, cancellable: Gio.Cancellable | null): Object;
1570
1604
 
@@ -1604,6 +1638,7 @@ export namespace Gck {
1604
1638
  * Get the result of creating a new PKCS#11 object.
1605
1639
  * @param result The result passed to the callback.
1606
1640
  * @returns the newly created object or `null` if an error occurred
1641
+ * @throws GLib.Error
1607
1642
  */
1608
1643
  create_object_finish(result: Gio.AsyncResult): Object;
1609
1644
 
@@ -1615,6 +1650,7 @@ export namespace Gck {
1615
1650
  * @param input data to decrypt
1616
1651
  * @param cancellable Optional cancellation object, or `null`
1617
1652
  * @returns the data that was decrypted, or `null` if an error occured
1653
+ * @throws GLib.Error
1618
1654
  */
1619
1655
  decrypt(key: Object, mech_type: bigint | number, input: Uint8Array | string, cancellable: Gio.Cancellable | null): Uint8Array;
1620
1656
 
@@ -1654,6 +1690,7 @@ export namespace Gck {
1654
1690
  * Get the result of an decryption operation.
1655
1691
  * @param result The result object passed to the callback.
1656
1692
  * @returns the data that was decrypted, or `null` if an error occurred
1693
+ * @throws GLib.Error
1657
1694
  */
1658
1695
  decrypt_finish(result: Gio.AsyncResult): Uint8Array;
1659
1696
 
@@ -1665,6 +1702,7 @@ export namespace Gck {
1665
1702
  * @param input data to decrypt
1666
1703
  * @param cancellable A GCancellable which can be used to cancel the operation.
1667
1704
  * @returns the data that was decrypted, or `null` if an error occured
1705
+ * @throws GLib.Error
1668
1706
  */
1669
1707
  decrypt_full(key: Object, mechanism: Mechanism, input: Uint8Array | string, cancellable: Gio.Cancellable | null): Uint8Array;
1670
1708
 
@@ -1678,6 +1716,7 @@ export namespace Gck {
1678
1716
  * @param attrs Additional attributes for the derived key.
1679
1717
  * @param cancellable Optional cancellation object, or `null`.
1680
1718
  * @returns the new derived key or `null` if the operation failed
1719
+ * @throws GLib.Error
1681
1720
  */
1682
1721
  derive_key(base: Object, mech_type: bigint | number, attrs: Attributes, cancellable: Gio.Cancellable | null): Object;
1683
1722
 
@@ -1723,6 +1762,7 @@ export namespace Gck {
1723
1762
  * Get the result of a derive key operation.
1724
1763
  * @param result The async result passed to the callback.
1725
1764
  * @returns the new derived key or `null` if the operation failed
1765
+ * @throws GLib.Error
1726
1766
  */
1727
1767
  derive_key_finish(result: Gio.AsyncResult): Object;
1728
1768
 
@@ -1736,6 +1776,7 @@ export namespace Gck {
1736
1776
  * @param attrs Additional attributes for the derived key.
1737
1777
  * @param cancellable Optional cancellation object, or `null`.
1738
1778
  * @returns the new derived key or `null` if the operation failed
1779
+ * @throws GLib.Error
1739
1780
  */
1740
1781
  derive_key_full(base: Object, mechanism: Mechanism, attrs: Attributes, cancellable: Gio.Cancellable | null): Object;
1741
1782
 
@@ -1747,6 +1788,7 @@ export namespace Gck {
1747
1788
  * @param input the data to encrypt
1748
1789
  * @param cancellable Optional cancellation object, or `null`
1749
1790
  * @returns the data that was encrypted, or `null` if an error occured.
1791
+ * @throws GLib.Error
1750
1792
  */
1751
1793
  encrypt(key: Object, mech_type: bigint | number, input: Uint8Array | string, cancellable: Gio.Cancellable | null): Uint8Array;
1752
1794
 
@@ -1786,6 +1828,7 @@ export namespace Gck {
1786
1828
  * Get the result of an encryption operation.
1787
1829
  * @param result The result object passed to the callback.
1788
1830
  * @returns the data that was encrypted, or `null` if an error occurred.
1831
+ * @throws GLib.Error
1789
1832
  */
1790
1833
  encrypt_finish(result: Gio.AsyncResult): Uint8Array;
1791
1834
 
@@ -1797,6 +1840,7 @@ export namespace Gck {
1797
1840
  * @param input the data to encrypt
1798
1841
  * @param cancellable A GCancellable which can be used to cancel the operation.
1799
1842
  * @returns the data that was encrypted, or `null` if an error occured
1843
+ * @throws GLib.Error
1800
1844
  */
1801
1845
  encrypt_full(key: Object, mechanism: Mechanism, input: Uint8Array | string, cancellable: Gio.Cancellable | null): Uint8Array;
1802
1846
 
@@ -1819,6 +1863,7 @@ export namespace Gck {
1819
1863
  * @param match the attributes to match against objects
1820
1864
  * @param cancellable optional cancellation object or `null`
1821
1865
  * @returns a list of the matching objects, which may be empty
1866
+ * @throws GLib.Error
1822
1867
  */
1823
1868
  find_handles(match: Attributes, cancellable: Gio.Cancellable | null): number[] | null;
1824
1869
 
@@ -1858,6 +1903,7 @@ export namespace Gck {
1858
1903
  * Get the result of a find handles operation.
1859
1904
  * @param result the asynchronous result
1860
1905
  * @returns an array of handles that matched, which may be empty, or `null` on failure
1906
+ * @throws GLib.Error
1861
1907
  */
1862
1908
  find_handles_finish(result: Gio.AsyncResult): number[] | null;
1863
1909
 
@@ -1869,6 +1915,7 @@ export namespace Gck {
1869
1915
  * @param match the attributes to match
1870
1916
  * @param cancellable Optional cancellation object or `null`.
1871
1917
  * @returns a list of the matching objects, which may be empty
1918
+ * @throws GLib.Error
1872
1919
  */
1873
1920
  find_objects(match: Attributes, cancellable: Gio.Cancellable | null): Object[];
1874
1921
 
@@ -1908,6 +1955,7 @@ export namespace Gck {
1908
1955
  * Get the result of a find operation.
1909
1956
  * @param result The attributes to match.
1910
1957
  * @returns a list of the matching objects, which may be empty
1958
+ * @throws GLib.Error
1911
1959
  */
1912
1960
  find_objects_finish(result: Gio.AsyncResult): Object[];
1913
1961
 
@@ -1922,6 +1970,7 @@ export namespace Gck {
1922
1970
  * @param private_attrs Additional attributes for the generated private key.
1923
1971
  * @param cancellable Optional cancellation object, or `null`.
1924
1972
  * @returns `true` if the operation succeeded.
1973
+ * @throws GLib.Error
1925
1974
  */
1926
1975
  generate_key_pair(mech_type: bigint | number, public_attrs: Attributes, private_attrs: Attributes, cancellable: Gio.Cancellable | null): [boolean, Object | null, Object | null];
1927
1976
 
@@ -1970,6 +2019,7 @@ export namespace Gck {
1970
2019
  * Get the result of a generate key pair operation.
1971
2020
  * @param result The async result passed to the callback.
1972
2021
  * @returns `true` if the operation succeeded.
2022
+ * @throws GLib.Error
1973
2023
  */
1974
2024
  generate_key_pair_finish(result: Gio.AsyncResult): [boolean, Object | null, Object | null];
1975
2025
 
@@ -1984,6 +2034,7 @@ export namespace Gck {
1984
2034
  * @param private_attrs Additional attributes for the generated private key.
1985
2035
  * @param cancellable Optional cancellation object, or `null`.
1986
2036
  * @returns `true` if the operation succeeded.
2037
+ * @throws GLib.Error
1987
2038
  */
1988
2039
  generate_key_pair_full(mechanism: Mechanism, public_attrs: Attributes, private_attrs: Attributes, cancellable: Gio.Cancellable | null): [boolean, Object | null, Object | null];
1989
2040
 
@@ -2039,6 +2090,7 @@ export namespace Gck {
2039
2090
  * @param pin the user's PIN, or `null` for protected authentication path
2040
2091
  * @param cancellable Optional cancellation object, or `null`.
2041
2092
  * @returns Whether successful or not.
2093
+ * @throws GLib.Error
2042
2094
  */
2043
2095
  init_pin(pin: Uint8Array | string | null, cancellable: Gio.Cancellable | null): boolean;
2044
2096
 
@@ -2081,6 +2133,7 @@ export namespace Gck {
2081
2133
  * Get the result of initializing a user's PIN.
2082
2134
  * @param result The result passed to the callback.
2083
2135
  * @returns Whether the operation was successful or not.
2136
+ * @throws GLib.Error
2084
2137
  */
2085
2138
  init_pin_finish(result: Gio.AsyncResult): boolean;
2086
2139
 
@@ -2091,6 +2144,7 @@ export namespace Gck {
2091
2144
  * @param pin the user's PIN, or `null` for protected authentication path
2092
2145
  * @param cancellable Optional cancellation object, or `null`.
2093
2146
  * @returns Whether successful or not.
2147
+ * @throws GLib.Error
2094
2148
  */
2095
2149
  login(user_type: bigint | number, pin: Uint8Array | string | null, cancellable: Gio.Cancellable | null): boolean;
2096
2150
 
@@ -2127,6 +2181,7 @@ export namespace Gck {
2127
2181
  * Get the result of a login operation.
2128
2182
  * @param result The result passed to the callback.
2129
2183
  * @returns Whether the operation was successful or not.
2184
+ * @throws GLib.Error
2130
2185
  */
2131
2186
  login_finish(result: Gio.AsyncResult): boolean;
2132
2187
 
@@ -2137,6 +2192,7 @@ export namespace Gck {
2137
2192
  * @param interaction interaction to request PIN when necessary
2138
2193
  * @param cancellable optional cancellation object, or `null`
2139
2194
  * @returns Whether successful or not.
2195
+ * @throws GLib.Error
2140
2196
  */
2141
2197
  login_interactive(user_type: bigint | number, interaction: Gio.TlsInteraction | null, cancellable: Gio.Cancellable | null): boolean;
2142
2198
 
@@ -2173,6 +2229,7 @@ export namespace Gck {
2173
2229
  * Get the result of a login operation.
2174
2230
  * @param result the result passed to the callback
2175
2231
  * @returns Whether the operation was successful or not.
2232
+ * @throws GLib.Error
2176
2233
  */
2177
2234
  login_interactive_finish(result: Gio.AsyncResult): boolean;
2178
2235
 
@@ -2180,6 +2237,7 @@ export namespace Gck {
2180
2237
  * Log out of the session. This call may block for an indefinite period.
2181
2238
  * @param cancellable Optional cancellation object, or `null`.
2182
2239
  * @returns Whether the logout was successful or not.
2240
+ * @throws GLib.Error
2183
2241
  */
2184
2242
  logout(cancellable: Gio.Cancellable | null): boolean;
2185
2243
 
@@ -2210,6 +2268,7 @@ export namespace Gck {
2210
2268
  * Get the result of logging out of a session.
2211
2269
  * @param result The result passed to the callback.
2212
2270
  * @returns Whether the logout was successful or not.
2271
+ * @throws GLib.Error
2213
2272
  */
2214
2273
  logout_finish(result: Gio.AsyncResult): boolean;
2215
2274
 
@@ -2228,6 +2287,7 @@ export namespace Gck {
2228
2287
  * @param new_pin the user's new PIN, or `null` for protected authentication path
2229
2288
  * @param cancellable Optional cancellation object, or `null`.
2230
2289
  * @returns Whether successful or not.
2290
+ * @throws GLib.Error
2231
2291
  */
2232
2292
  set_pin(old_pin: Uint8Array | string | null, new_pin: Uint8Array | string | null, cancellable: Gio.Cancellable | null): boolean;
2233
2293
 
@@ -2270,6 +2330,7 @@ export namespace Gck {
2270
2330
  * Get the result of changing a user's PIN.
2271
2331
  * @param result The result passed to the callback.
2272
2332
  * @returns Whether the operation was successful or not.
2333
+ * @throws GLib.Error
2273
2334
  */
2274
2335
  set_pin_finish(result: Gio.AsyncResult): boolean;
2275
2336
 
@@ -2281,6 +2342,7 @@ export namespace Gck {
2281
2342
  * @param input data to sign
2282
2343
  * @param cancellable Optional cancellation object, or `null`
2283
2344
  * @returns the data that was signed, or `null` if an error occured
2345
+ * @throws GLib.Error
2284
2346
  */
2285
2347
  sign(key: Object, mech_type: bigint | number, input: Uint8Array | string, cancellable: Gio.Cancellable | null): Uint8Array;
2286
2348
 
@@ -2320,6 +2382,7 @@ export namespace Gck {
2320
2382
  * Get the result of an signing operation.
2321
2383
  * @param result The result object passed to the callback.
2322
2384
  * @returns the data that was signed, or `null` if an error occurred
2385
+ * @throws GLib.Error
2323
2386
  */
2324
2387
  sign_finish(result: Gio.AsyncResult): Uint8Array;
2325
2388
 
@@ -2332,6 +2395,7 @@ export namespace Gck {
2332
2395
  * @param n_result location to store the length of the result data
2333
2396
  * @param cancellable A GCancellable which can be used to cancel the operation.
2334
2397
  * @returns The data that was signed, or `null` if an error occured.
2398
+ * @throws GLib.Error
2335
2399
  */
2336
2400
  sign_full(key: Object, mechanism: Mechanism, input: Uint8Array | string, n_result: bigint | number, cancellable: Gio.Cancellable | null): number;
2337
2401
 
@@ -2346,6 +2410,7 @@ export namespace Gck {
2346
2410
  * @param attrs Additional attributes for the unwrapped key.
2347
2411
  * @param cancellable Optional cancellation object, or `null`.
2348
2412
  * @returns the new unwrapped key or `null` if the operation failed
2413
+ * @throws GLib.Error
2349
2414
  */
2350
2415
  unwrap_key(wrapper: Object, mech_type: bigint | number, input: Uint8Array | string, attrs: Attributes, cancellable: Gio.Cancellable | null): Object;
2351
2416
 
@@ -2394,6 +2459,7 @@ export namespace Gck {
2394
2459
  * Get the result of a unwrap key operation.
2395
2460
  * @param result The async result passed to the callback.
2396
2461
  * @returns the new unwrapped key or `null` if the operation failed.
2462
+ * @throws GLib.Error
2397
2463
  */
2398
2464
  unwrap_key_finish(result: Gio.AsyncResult): Object;
2399
2465
 
@@ -2408,6 +2474,7 @@ export namespace Gck {
2408
2474
  * @param attrs Additional attributes for the unwrapped key.
2409
2475
  * @param cancellable Optional cancellation object, or `null`.
2410
2476
  * @returns the new unwrapped key or `null` if the operation failed
2477
+ * @throws GLib.Error
2411
2478
  */
2412
2479
  unwrap_key_full(wrapper: Object, mechanism: Mechanism, input: Uint8Array | string, attrs: Attributes, cancellable: Gio.Cancellable | null): Object;
2413
2480
 
@@ -2420,6 +2487,7 @@ export namespace Gck {
2420
2487
  * @param signature the signature
2421
2488
  * @param cancellable Optional cancellation object, or `null`
2422
2489
  * @returns `true` if the data verified correctly, otherwise a failure or error occurred.
2490
+ * @throws GLib.Error
2423
2491
  */
2424
2492
  verify(key: Object, mech_type: bigint | number, input: Uint8Array | string, signature: Uint8Array | string, cancellable: Gio.Cancellable | null): boolean;
2425
2493
 
@@ -2462,6 +2530,7 @@ export namespace Gck {
2462
2530
  * Get the result of an verify operation.
2463
2531
  * @param result The result object passed to the callback.
2464
2532
  * @returns `true` if the data verified correctly, otherwise a failure or error occurred.
2533
+ * @throws GLib.Error
2465
2534
  */
2466
2535
  verify_finish(result: Gio.AsyncResult): boolean;
2467
2536
 
@@ -2474,6 +2543,7 @@ export namespace Gck {
2474
2543
  * @param signature the signature
2475
2544
  * @param cancellable A GCancellable which can be used to cancel the operation.
2476
2545
  * @returns `true` if the data verified correctly, otherwise a failure or error occurred.
2546
+ * @throws GLib.Error
2477
2547
  */
2478
2548
  verify_full(key: Object, mechanism: Mechanism, input: Uint8Array | string, signature: Uint8Array | string, cancellable: Gio.Cancellable | null): boolean;
2479
2549
 
@@ -2485,6 +2555,7 @@ export namespace Gck {
2485
2555
  * @param wrapped The key to wrap.
2486
2556
  * @param cancellable A {@link Gio.Cancellable} or `null`
2487
2557
  * @returns the wrapped data or `null` if the operation failed
2558
+ * @throws GLib.Error
2488
2559
  */
2489
2560
  wrap_key(wrapper: Object, mech_type: bigint | number, wrapped: Object, cancellable: Gio.Cancellable | null): Uint8Array;
2490
2561
 
@@ -2524,6 +2595,7 @@ export namespace Gck {
2524
2595
  * Get the result of a wrap key operation.
2525
2596
  * @param result The async result passed to the callback.
2526
2597
  * @returns the wrapped data or `null` if the operation failed
2598
+ * @throws GLib.Error
2527
2599
  */
2528
2600
  wrap_key_finish(result: Gio.AsyncResult): Uint8Array;
2529
2601
 
@@ -2535,6 +2607,7 @@ export namespace Gck {
2535
2607
  * @param wrapped The key to wrap.
2536
2608
  * @param cancellable Optional cancellation object, or `null`.
2537
2609
  * @returns the wrapped data or `null` if the operation failed
2610
+ * @throws GLib.Error
2538
2611
  */
2539
2612
  wrap_key_full(wrapper: Object, mechanism: Mechanism, wrapped: Object, cancellable: Gio.Cancellable | null): Uint8Array;
2540
2613
 
@@ -2675,6 +2748,7 @@ export namespace Gck {
2675
2748
  * @param res a {@link Gio.AsyncResult}.
2676
2749
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
2677
2750
  * @since 2.22
2751
+ * @throws GLib.Error
2678
2752
  */
2679
2753
  init_finish(res: Gio.AsyncResult): boolean;
2680
2754
 
@@ -2684,6 +2758,7 @@ export namespace Gck {
2684
2758
  * @param res the {@link Gio.AsyncResult} from the callback
2685
2759
  * @returns a newly created {@link GObject.Object}, or `null` on error. Free with `g_object_unref()`.
2686
2760
  * @since 2.22
2761
+ * @throws GLib.Error
2687
2762
  */
2688
2763
  new_finish(res: Gio.AsyncResult): Session;
2689
2764
 
@@ -2783,6 +2858,7 @@ export namespace Gck {
2783
2858
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2784
2859
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
2785
2860
  * @since 2.22
2861
+ * @throws GLib.Error
2786
2862
  */
2787
2863
  init(cancellable: Gio.Cancellable | null): boolean;
2788
2864
 
@@ -2996,6 +3072,7 @@ export namespace Gck {
2996
3072
  * @param options The {@link Gck.SessionOptions} to open a session with.
2997
3073
  * @param cancellable An optional cancellation object, or `null`.
2998
3074
  * @returns a new session or `null` if an error occurs
3075
+ * @throws GLib.Error
2999
3076
  */
3000
3077
  open_session(options: SessionOptions, cancellable: Gio.Cancellable | null): Session;
3001
3078
 
@@ -3036,6 +3113,7 @@ export namespace Gck {
3036
3113
  * then this may be a recycled session with the same flags.
3037
3114
  * @param result The result passed to the callback.
3038
3115
  * @returns the new session or `null` if an error occurs
3116
+ * @throws GLib.Error
3039
3117
  */
3040
3118
  open_session_finish(result: Gio.AsyncResult): Session;
3041
3119
  }
@@ -4128,6 +4206,7 @@ export namespace Gck {
4128
4206
  * @param attr_types the types of attributes to update
4129
4207
  * @param cancellable optional cancellation object
4130
4208
  * @returns whether the cache update was successful
4209
+ * @throws GLib.Error
4131
4210
  */
4132
4211
  update(attr_types: (bigint | number)[], cancellable: Gio.Cancellable | null): boolean;
4133
4212
 
@@ -4168,6 +4247,7 @@ export namespace Gck {
4168
4247
  * attributes.
4169
4248
  * @param result the asynchronous result passed to the callback
4170
4249
  * @returns whether the cache update was successful
4250
+ * @throws GLib.Error
4171
4251
  */
4172
4252
  update_finish(result: Gio.AsyncResult): boolean;
4173
4253
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gck-1",
3
- "version": "4.4.0",
3
+ "version": "4.5.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.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" },
35
+ "@girs/gjs": "^4.5.0",
36
+ "@girs/gio-2.0": "^4.5.0",
37
+ "@girs/gobject-2.0": "^4.5.0",
38
+ "@girs/glib-2.0": "^4.5.0",
39
+ "@girs/gmodule-2.0": "^4.5.0" },
40
40
  "devDependencies": {
41
41
  "typescript": "*"
42
42
  },