@girs/gjs 3.0.0-beta.14 → 3.0.0-beta.15
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 +36 -5
- package/ambient.d.ts +2 -2873
- package/cairo.cjs +2 -0
- package/cairo.d.cts +2 -0
- package/cairo.d.ts +2 -0
- package/cairo.js +2 -0
- package/gettext.cjs +2 -0
- package/gettext.d.cts +2 -1
- package/gettext.d.ts +2 -1
- package/gettext.js +2 -0
- package/gjs.cjs +2 -1
- package/gjs.d.cts +39 -1399
- package/gjs.d.ts +39 -1399
- package/gjs.js +2 -1
- package/package.json +3 -401
- package/system.cjs +2 -0
- package/system.d.cts +2 -1
- package/system.d.ts +2 -1
- package/system.js +2 -0
- package/tsconfig.doc.json +2 -0
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
# Gjs
|
|
3
3
|
|
|
4
|
-
GJS TypeScript type definitions for Gjs using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.0.0-beta.
|
|
4
|
+
GJS TypeScript type definitions for Gjs using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.0.0-beta.15.
|
|
5
5
|
|
|
6
6
|
## Install
|
|
7
7
|
|
|
8
|
-
To use this type definitions, install them with NPM
|
|
8
|
+
To use this type definitions, install them with NPM:
|
|
9
9
|
```bash
|
|
10
10
|
npm install @girs/gjs
|
|
11
11
|
```
|
|
@@ -22,13 +22,44 @@ Or if you prefer CommonJS, you can also use this:
|
|
|
22
22
|
const Gjs = require('@girs/gjs');
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### Ambient Modules
|
|
26
|
+
|
|
27
|
+
You can import core [ambient module](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) types.
|
|
28
|
+
For this you need to include the `@girs/gjs` or `@girs/gjs/ambient` in your `tsconfig` or entry point Typescript file:
|
|
29
|
+
|
|
30
|
+
`index.ts`:
|
|
31
|
+
```ts
|
|
32
|
+
import '@girs/gjs'
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`tsconfig.json`:
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"compilerOptions": {
|
|
39
|
+
...
|
|
40
|
+
},
|
|
41
|
+
"include": ["@girs/gjs"],
|
|
42
|
+
...
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
Now you can import `gettext` and `system` in ESM style with Typescript support:
|
|
48
|
+
|
|
26
49
|
```ts
|
|
27
|
-
import '
|
|
50
|
+
import gettext from 'gettext';
|
|
51
|
+
import system from 'system';
|
|
28
52
|
```
|
|
29
53
|
|
|
54
|
+
|
|
55
|
+
If you want to have more types for GIR modules, you have to add them to your dependencies and import them as well, see the description of these modules, e.g. [Gtk-4.0](https://www.npmjs.com/package/@girs/gtk-4.0).
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Bundle
|
|
59
|
+
|
|
30
60
|
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).
|
|
31
61
|
|
|
32
62
|
## Other packages
|
|
33
63
|
|
|
34
|
-
All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
|
|
64
|
+
All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
|
|
65
|
+
|