@girs/gcr-4 4.3.0-4.0.0-beta.19 → 4.3.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.
package/README.md CHANGED
@@ -5,26 +5,25 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gcr-4)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for Gcr-4, generated from library version 4.3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.19.
9
-
8
+ GJS TypeScript type definitions for Gcr-4, generated from library version 4.4.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.3.0.
10
9
 
11
10
  ## Install
12
11
 
13
- To use this type definitions, install them with NPM:
12
+ Install the type definitions with npm:
14
13
  ```bash
15
14
  npm install @girs/gcr-4
16
15
  ```
17
16
 
18
17
  ## Usage
19
18
 
20
- You can import this package into your project like this:
19
+ Import it like any other module:
21
20
  ```ts
22
21
  import Gcr from '@girs/gcr-4';
23
22
  ```
24
23
 
25
24
  ### Ambient Modules
26
25
 
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.
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.
28
27
  For this you need to include `@girs/gcr-4` or `@girs/gcr-4/ambient` in your `tsconfig` or entry point Typescript file:
29
28
 
30
29
  `index.ts`:
@@ -43,7 +42,7 @@ import '@girs/gcr-4'
43
42
  }
44
43
  ```
45
44
 
46
- Now you can import the ambient module with TypeScript support:
45
+ The ambient module now resolves with types:
47
46
 
48
47
  ```ts
49
48
  import Gcr from 'gi://Gcr?version=4';
@@ -51,7 +50,7 @@ import Gcr from 'gi://Gcr?version=4';
51
50
 
52
51
  ### Global import
53
52
 
54
- 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.
55
54
  For this you need to include `@girs/gcr-4` or `@girs/gcr-4/import` in your `tsconfig` or entry point Typescript file:
56
55
 
57
56
  `index.ts`:
@@ -70,7 +69,7 @@ import '@girs/gcr-4'
70
69
  }
71
70
  ```
72
71
 
73
- Now you have also type support for this, too:
72
+ That form carries types as well:
74
73
 
75
74
  ```ts
76
75
  const Gcr = imports.gi.Gcr;
@@ -78,7 +77,7 @@ const Gcr = imports.gi.Gcr;
78
77
 
79
78
  ### Bundle
80
79
 
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).
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.
82
81
 
83
82
  ## Other packages
84
83
 
@@ -1,3 +1,4 @@
1
+
1
2
  declare module 'gi://Gcr?version=4' {
2
3
  import Gcr4 from '@girs/gcr-4';
3
4
  export default Gcr4;
@@ -7,3 +8,5 @@ declare module 'gi://Gcr' {
7
8
  import Gcr4 from 'gi://Gcr?version=4';
8
9
  export default Gcr4;
9
10
  }
11
+
12
+
package/gcr-4-import.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import Gcr4 from '@girs/gcr-4';
1
+
2
+ import type Gcr4 from '@girs/gcr-4';
2
3
 
3
4
  declare global {
4
5
  export interface GjsGiImports {
@@ -7,3 +8,5 @@ declare global {
7
8
  }
8
9
 
9
10
  export default GjsGiImports;
11
+
12
+