@girs/gck-2 4.1.0-3.2.4 → 4.1.0-3.2.6
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/gck-2-ambient.d.ts +4 -1
- package/gck-2-import.d.ts +0 -1
- package/gck-2.d.cts +16 -0
- package/gck-2.d.ts +16 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for Gck-2, generated from library version 4.1.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.
|
|
8
|
+
GJS TypeScript type definitions for Gck-2, generated from library version 4.1.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.6.
|
|
9
9
|
|
|
10
10
|
GLib wrapper library for PKCS#11
|
|
11
11
|
|
|
@@ -82,6 +82,19 @@ Now you have also type support for this, too:
|
|
|
82
82
|
const Gck = imports.gi.Gck;
|
|
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/gck-2-ambient.d.ts
CHANGED
package/gck-2-import.d.ts
CHANGED
package/gck-2.d.cts
CHANGED
|
@@ -1406,6 +1406,14 @@ export module Session {
|
|
|
1406
1406
|
* The GckSlot this session is opened on.
|
|
1407
1407
|
*/
|
|
1408
1408
|
slot?: Slot | null
|
|
1409
|
+
/**
|
|
1410
|
+
* Raw PKCS#11 application data used to open the PKCS#11 session.
|
|
1411
|
+
*/
|
|
1412
|
+
appData?: any | null
|
|
1413
|
+
/**
|
|
1414
|
+
* Raw PKCS#11 flags used to open the PKCS#11 session.
|
|
1415
|
+
*/
|
|
1416
|
+
openingFlags?: number | null
|
|
1409
1417
|
}
|
|
1410
1418
|
|
|
1411
1419
|
}
|
|
@@ -1418,6 +1426,10 @@ export interface Session extends Gio.AsyncInitable, Gio.Initable {
|
|
|
1418
1426
|
* Raw PKCS#11 application data used to open the PKCS#11 session.
|
|
1419
1427
|
*/
|
|
1420
1428
|
readonly app_data: any
|
|
1429
|
+
/**
|
|
1430
|
+
* Raw PKCS#11 application data used to open the PKCS#11 session.
|
|
1431
|
+
*/
|
|
1432
|
+
readonly appData: any
|
|
1421
1433
|
/**
|
|
1422
1434
|
* The raw CK_SESSION_HANDLE handle of this session.
|
|
1423
1435
|
*/
|
|
@@ -1436,6 +1448,10 @@ export interface Session extends Gio.AsyncInitable, Gio.Initable {
|
|
|
1436
1448
|
* Raw PKCS#11 flags used to open the PKCS#11 session.
|
|
1437
1449
|
*/
|
|
1438
1450
|
readonly opening_flags: number
|
|
1451
|
+
/**
|
|
1452
|
+
* Raw PKCS#11 flags used to open the PKCS#11 session.
|
|
1453
|
+
*/
|
|
1454
|
+
readonly openingFlags: number
|
|
1439
1455
|
/**
|
|
1440
1456
|
* The options this session was opened with.
|
|
1441
1457
|
*/
|
package/gck-2.d.ts
CHANGED
|
@@ -1408,6 +1408,14 @@ module Session {
|
|
|
1408
1408
|
* The GckSlot this session is opened on.
|
|
1409
1409
|
*/
|
|
1410
1410
|
slot?: Slot | null
|
|
1411
|
+
/**
|
|
1412
|
+
* Raw PKCS#11 application data used to open the PKCS#11 session.
|
|
1413
|
+
*/
|
|
1414
|
+
appData?: any | null
|
|
1415
|
+
/**
|
|
1416
|
+
* Raw PKCS#11 flags used to open the PKCS#11 session.
|
|
1417
|
+
*/
|
|
1418
|
+
openingFlags?: number | null
|
|
1411
1419
|
}
|
|
1412
1420
|
|
|
1413
1421
|
}
|
|
@@ -1420,6 +1428,10 @@ interface Session extends Gio.AsyncInitable, Gio.Initable {
|
|
|
1420
1428
|
* Raw PKCS#11 application data used to open the PKCS#11 session.
|
|
1421
1429
|
*/
|
|
1422
1430
|
readonly app_data: any
|
|
1431
|
+
/**
|
|
1432
|
+
* Raw PKCS#11 application data used to open the PKCS#11 session.
|
|
1433
|
+
*/
|
|
1434
|
+
readonly appData: any
|
|
1423
1435
|
/**
|
|
1424
1436
|
* The raw CK_SESSION_HANDLE handle of this session.
|
|
1425
1437
|
*/
|
|
@@ -1438,6 +1450,10 @@ interface Session extends Gio.AsyncInitable, Gio.Initable {
|
|
|
1438
1450
|
* Raw PKCS#11 flags used to open the PKCS#11 session.
|
|
1439
1451
|
*/
|
|
1440
1452
|
readonly opening_flags: number
|
|
1453
|
+
/**
|
|
1454
|
+
* Raw PKCS#11 flags used to open the PKCS#11 session.
|
|
1455
|
+
*/
|
|
1456
|
+
readonly openingFlags: number
|
|
1441
1457
|
/**
|
|
1442
1458
|
* The options this session was opened with.
|
|
1443
1459
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/gck-2",
|
|
3
|
-
"version": "4.1.0-3.2.
|
|
3
|
+
"version": "4.1.0-3.2.6",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Gck-2, generated from library version 4.1.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "gck-2.js",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gck-2.d.cts"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@girs/gio-2.0": "^2.78.0-3.2.
|
|
29
|
-
"@girs/gjs": "^3.2.
|
|
30
|
-
"@girs/glib-2.0": "^2.78.0-3.2.
|
|
31
|
-
"@girs/gobject-2.0": "^2.78.0-3.2.
|
|
28
|
+
"@girs/gio-2.0": "^2.78.0-3.2.6",
|
|
29
|
+
"@girs/gjs": "^3.2.6",
|
|
30
|
+
"@girs/glib-2.0": "^2.78.0-3.2.6",
|
|
31
|
+
"@girs/gobject-2.0": "^2.78.0-3.2.6"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"typescript": "*"
|