@girs/evincedocument-3.0 45.0.0-4.0.0-beta.2 → 46.0.0-4.0.0-beta.3
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 +1 -19
- package/evincedocument-3.0.d.ts +6 -1
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for EvinceDocument-3.0, generated from library version
|
|
8
|
+
GJS TypeScript type definitions for EvinceDocument-3.0, generated from library version 46.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.3.
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
## Install
|
|
@@ -22,11 +22,6 @@ You can import this package into your project like this:
|
|
|
22
22
|
import EvinceDocument from '@girs/evincedocument-3.0';
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
Or if you prefer CommonJS, you can also use this:
|
|
26
|
-
```ts
|
|
27
|
-
const EvinceDocument = require('@girs/evincedocument-3.0');
|
|
28
|
-
```
|
|
29
|
-
|
|
30
25
|
### Ambient Modules
|
|
31
26
|
|
|
32
27
|
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.
|
|
@@ -81,19 +76,6 @@ Now you have also type support for this, too:
|
|
|
81
76
|
const EvinceDocument = imports.gi.EvinceDocument;
|
|
82
77
|
```
|
|
83
78
|
|
|
84
|
-
|
|
85
|
-
### ESM vs. CommonJS
|
|
86
|
-
|
|
87
|
-
GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
|
|
88
|
-
|
|
89
|
-
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.
|
|
90
|
-
|
|
91
|
-
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.
|
|
92
|
-
|
|
93
|
-
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.
|
|
94
|
-
|
|
95
|
-
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.
|
|
96
|
-
|
|
97
79
|
### Bundle
|
|
98
80
|
|
|
99
81
|
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/evincedocument-3.0.d.ts
CHANGED
|
@@ -21,8 +21,8 @@ import type Pango from '@girs/pango-1.0';
|
|
|
21
21
|
import type HarfBuzz from '@girs/harfbuzz-0.0';
|
|
22
22
|
import type freetype2 from '@girs/freetype2-2.0';
|
|
23
23
|
import type Gio from '@girs/gio-2.0';
|
|
24
|
-
import type GModule from '@girs/gmodule-2.0';
|
|
25
24
|
import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
|
|
25
|
+
import type GModule from '@girs/gmodule-2.0';
|
|
26
26
|
import type Atk from '@girs/atk-1.0';
|
|
27
27
|
|
|
28
28
|
export namespace EvinceDocument {
|
|
@@ -173,6 +173,11 @@ export namespace EvinceDocument {
|
|
|
173
173
|
* (e.g. in version 3.1.4 this is 3).
|
|
174
174
|
*/
|
|
175
175
|
const MAJOR_VERSION: number;
|
|
176
|
+
/**
|
|
177
|
+
* The minor version number of the EV library
|
|
178
|
+
* (e.g. in version 3.1.4 this is 1).
|
|
179
|
+
*/
|
|
180
|
+
const MINOR_VERSION: number;
|
|
176
181
|
function backends_manager_get_document(mime_type: string): Document;
|
|
177
182
|
function backends_manager_get_document_module_name(document: Document): string;
|
|
178
183
|
function document_error_quark(): GLib.Quark;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/evincedocument-3.0",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "GJS TypeScript type definitions for EvinceDocument-3.0, generated from library version
|
|
3
|
+
"version": "46.0.0-4.0.0-beta.3",
|
|
4
|
+
"description": "GJS TypeScript type definitions for EvinceDocument-3.0, generated from library version 46.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "evincedocument-3.0.js",
|
|
7
7
|
"main": "evincedocument-3.0.js",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
"test": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit evincedocument-3.0.d.ts"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@girs/atk-1.0": "^2.52.0-4.0.0-beta.
|
|
30
|
-
"@girs/cairo-1.0": "^1.0.0-4.0.0-beta.
|
|
31
|
-
"@girs/freetype2-2.0": "^2.0.0-4.0.0-beta.
|
|
32
|
-
"@girs/gdk-3.0": "^3.24.41-4.0.0-beta.
|
|
33
|
-
"@girs/gdkpixbuf-2.0": "^2.0.0-4.0.0-beta.
|
|
34
|
-
"@girs/gio-2.0": "^2.80.0-4.0.0-beta.
|
|
35
|
-
"@girs/gjs": "^4.0.0-beta.
|
|
36
|
-
"@girs/glib-2.0": "^2.80.0-4.0.0-beta.
|
|
37
|
-
"@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.
|
|
38
|
-
"@girs/gobject-2.0": "^2.80.0-4.0.0-beta.
|
|
39
|
-
"@girs/gtk-3.0": "^3.24.41-4.0.0-beta.
|
|
40
|
-
"@girs/harfbuzz-0.0": "^8.3.1-4.0.0-beta.
|
|
41
|
-
"@girs/pango-1.0": "^1.
|
|
42
|
-
"@girs/xlib-2.0": "^2.0.0-4.0.0-beta.
|
|
29
|
+
"@girs/atk-1.0": "^2.52.0-4.0.0-beta.3",
|
|
30
|
+
"@girs/cairo-1.0": "^1.0.0-4.0.0-beta.3",
|
|
31
|
+
"@girs/freetype2-2.0": "^2.0.0-4.0.0-beta.3",
|
|
32
|
+
"@girs/gdk-3.0": "^3.24.41-4.0.0-beta.3",
|
|
33
|
+
"@girs/gdkpixbuf-2.0": "^2.0.0-4.0.0-beta.3",
|
|
34
|
+
"@girs/gio-2.0": "^2.80.0-4.0.0-beta.3",
|
|
35
|
+
"@girs/gjs": "^4.0.0-beta.3",
|
|
36
|
+
"@girs/glib-2.0": "^2.80.0-4.0.0-beta.3",
|
|
37
|
+
"@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.3",
|
|
38
|
+
"@girs/gobject-2.0": "^2.80.0-4.0.0-beta.3",
|
|
39
|
+
"@girs/gtk-3.0": "^3.24.41-4.0.0-beta.3",
|
|
40
|
+
"@girs/harfbuzz-0.0": "^8.3.1-4.0.0-beta.3",
|
|
41
|
+
"@girs/pango-1.0": "^1.52.2-4.0.0-beta.3",
|
|
42
|
+
"@girs/xlib-2.0": "^2.0.0-4.0.0-beta.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "*"
|