@ts-for-gir/cli 3.0.0-beta.7 → 3.0.0-beta.9

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 (162) hide show
  1. package/README.md +318 -63
  2. package/lib/commands/generate.d.ts +5 -5
  3. package/lib/commands/generate.js +5 -5
  4. package/lib/commands/generate.js.map +1 -1
  5. package/lib/config.d.ts +7 -24
  6. package/lib/config.js +69 -50
  7. package/lib/config.js.map +1 -1
  8. package/lib/constants.d.ts +1 -1
  9. package/lib/constants.js +1 -1
  10. package/lib/constants.js.map +1 -1
  11. package/lib/dependency-manager.d.ts +34 -0
  12. package/lib/dependency-manager.js +78 -0
  13. package/lib/dependency-manager.js.map +1 -0
  14. package/lib/generation-handler.js +2 -2
  15. package/lib/generation-handler.js.map +1 -1
  16. package/lib/gir-module.d.ts +7 -6
  17. package/lib/gir-module.js +34 -23
  18. package/lib/gir-module.js.map +1 -1
  19. package/lib/messages.d.ts +4 -3
  20. package/lib/messages.js +4 -3
  21. package/lib/messages.js.map +1 -1
  22. package/lib/module-loader.d.ts +11 -8
  23. package/lib/module-loader.js +53 -50
  24. package/lib/module-loader.js.map +1 -1
  25. package/lib/symtable.d.ts +4 -4
  26. package/lib/symtable.js +1 -1
  27. package/lib/symtable.js.map +1 -1
  28. package/lib/template-processor.d.ts +37 -9
  29. package/lib/template-processor.js +79 -68
  30. package/lib/template-processor.js.map +1 -1
  31. package/lib/type-definition-generator.js +34 -26
  32. package/lib/type-definition-generator.js.map +1 -1
  33. package/lib/types/class-parent.d.ts +2 -0
  34. package/lib/types/dependency-map.d.ts +1 -1
  35. package/lib/types/dependency.d.ts +2 -1
  36. package/lib/types/file-info.d.ts +14 -0
  37. package/lib/types/file-info.js +2 -0
  38. package/lib/types/file-info.js.map +1 -0
  39. package/lib/types/generate-config.d.ts +6 -6
  40. package/lib/types/index.d.ts +1 -0
  41. package/lib/types/index.js +1 -0
  42. package/lib/types/index.js.map +1 -1
  43. package/lib/types/promisify-func.d.ts +5 -0
  44. package/lib/types/promisify-func.js +2 -0
  45. package/lib/types/promisify-func.js.map +1 -0
  46. package/lib/types/user-config.d.ts +6 -6
  47. package/lib/utils.d.ts +196 -7
  48. package/lib/utils.js +201 -19
  49. package/lib/utils.js.map +1 -1
  50. package/package.json +28 -14
  51. package/src/commands/generate.ts +5 -5
  52. package/src/config.ts +95 -68
  53. package/src/constants.ts +1 -1
  54. package/src/dependency-manager.ts +91 -0
  55. package/src/generation-handler.ts +2 -2
  56. package/src/gir-module.ts +43 -32
  57. package/src/messages.ts +4 -3
  58. package/src/module-loader.ts +59 -54
  59. package/src/symtable.ts +8 -6
  60. package/src/template-processor.ts +101 -72
  61. package/src/type-definition-generator.ts +36 -28
  62. package/src/types/class-parent.ts +2 -0
  63. package/src/types/dependency-map.ts +1 -1
  64. package/src/types/dependency.ts +3 -1
  65. package/src/types/file-info.ts +14 -0
  66. package/src/types/generate-config.ts +6 -6
  67. package/src/types/index.ts +1 -0
  68. package/src/types/user-config.ts +6 -6
  69. package/src/utils.ts +203 -20
  70. package/templates/Gjs/Gjs.d.ts +75 -8
  71. package/templates/Gjs/GnomeShell.d.ts +70 -36
  72. package/templates/Gjs/index.d.ts +9 -5
  73. package/templates/Gjs/misc/dbusUtils.d.ts +15 -0
  74. package/templates/Gjs/misc/dbusUtils.js +6 -0
  75. package/templates/Gjs/misc/fileUtils.d.ts +51 -0
  76. package/templates/Gjs/misc/fileUtils.js +6 -0
  77. package/templates/Gjs/misc/gnomeSession.d.ts +74 -0
  78. package/templates/Gjs/misc/gnomeSession.js +6 -0
  79. package/templates/Gjs/misc/parentalControlsManager.d.ts +42 -0
  80. package/templates/Gjs/misc/parentalControlsManager.js +6 -0
  81. package/templates/Gjs/misc/signals.d.ts +15 -0
  82. package/templates/Gjs/misc/signals.js +6 -0
  83. package/templates/Gjs/module.d.ts +0 -4
  84. package/templates/Gjs/module.js +1 -1
  85. package/templates/Gjs/tsconfig.alias.json +10 -0
  86. package/templates/Gjs/ui/accessDialog.d.ts +19 -0
  87. package/templates/Gjs/ui/accessDialog.js +6 -0
  88. package/templates/Gjs/ui/altTab.d.ts +124 -0
  89. package/templates/Gjs/ui/altTab.js +6 -0
  90. package/templates/Gjs/ui/animation.d.ts +58 -0
  91. package/templates/Gjs/ui/animation.js +6 -0
  92. package/templates/Gjs/ui/appDisplay.d.ts +204 -0
  93. package/templates/Gjs/ui/appDisplay.js +6 -0
  94. package/templates/Gjs/ui/appFavorites.d.ts +34 -0
  95. package/templates/Gjs/ui/appFavorites.js +6 -0
  96. package/templates/Gjs/ui/appMenu.d.ts +74 -0
  97. package/templates/Gjs/ui/appMenu.js +6 -0
  98. package/templates/Gjs/ui/audioDeviceSelection.d.ts +51 -0
  99. package/templates/Gjs/ui/audioDeviceSelection.js +6 -0
  100. package/templates/Gjs/ui/background.d.ts +255 -0
  101. package/templates/Gjs/ui/background.js +5 -0
  102. package/templates/Gjs/ui/backgroundMenu.d.ts +19 -0
  103. package/templates/Gjs/ui/backgroundMenu.js +5 -0
  104. package/templates/Gjs/ui/barLevel.d.ts +42 -0
  105. package/templates/Gjs/ui/barLevel.js +5 -0
  106. package/templates/Gjs/ui/boxpointer.d.ts +103 -0
  107. package/templates/Gjs/ui/boxpointer.js +5 -0
  108. package/templates/Gjs/ui/calendar.d.ts +261 -0
  109. package/templates/Gjs/ui/calendar.js +5 -0
  110. package/templates/Gjs/ui/components/__init__.d.ts +9 -0
  111. package/templates/Gjs/ui/components/__init__.js +6 -0
  112. package/templates/Gjs/ui/components/automountManager.d.ts +8 -0
  113. package/templates/Gjs/ui/components/automountManager.js +6 -0
  114. package/templates/Gjs/ui/components/autorunManager.d.ts +8 -0
  115. package/templates/Gjs/ui/components/autorunManager.js +6 -0
  116. package/templates/Gjs/ui/components/index.d.ts +6 -0
  117. package/templates/Gjs/ui/components/index.js +6 -0
  118. package/templates/Gjs/ui/components/keyring.d.ts +19 -0
  119. package/templates/Gjs/ui/components/keyring.js +6 -0
  120. package/templates/Gjs/ui/components/networkAgent.d.ts +10 -0
  121. package/templates/Gjs/ui/components/networkAgent.js +6 -0
  122. package/templates/Gjs/ui/components/polkitAgent.d.ts +19 -0
  123. package/templates/Gjs/ui/components/polkitAgent.js +6 -0
  124. package/templates/Gjs/ui/components/telepathyClient.d.ts +10 -0
  125. package/templates/Gjs/ui/components/telepathyClient.js +6 -0
  126. package/templates/Gjs/ui/dialog.d.ts +78 -0
  127. package/templates/Gjs/ui/dialog.js +0 -0
  128. package/templates/Gjs/ui/dnd.d.ts +127 -0
  129. package/templates/Gjs/ui/dnd.js +6 -0
  130. package/templates/Gjs/ui/iconGrid.d.ts +172 -0
  131. package/templates/Gjs/ui/iconGrid.js +6 -0
  132. package/templates/Gjs/ui/layout.d.ts +311 -0
  133. package/templates/Gjs/ui/layout.js +6 -0
  134. package/templates/Gjs/ui/main.d.ts +215 -0
  135. package/templates/Gjs/ui/main.js +6 -0
  136. package/templates/Gjs/ui/messageList.d.ts +113 -0
  137. package/templates/Gjs/ui/messageList.js +6 -0
  138. package/templates/Gjs/ui/messageTray.d.ts +423 -0
  139. package/templates/Gjs/ui/messageTray.js +6 -0
  140. package/templates/Gjs/ui/modalDialog.d.ts +96 -0
  141. package/templates/Gjs/ui/modalDialog.js +6 -0
  142. package/templates/Gjs/ui/mpris.d.ts +78 -0
  143. package/templates/Gjs/ui/mpris.js +6 -0
  144. package/templates/Gjs/ui/notificationDaemon.d.ts +5 -0
  145. package/templates/Gjs/ui/notificationDaemon.js +6 -0
  146. package/templates/Gjs/ui/panel.d.ts +65 -0
  147. package/templates/Gjs/ui/panel.js +6 -0
  148. package/templates/Gjs/ui/panelMenu.d.ts +51 -0
  149. package/templates/Gjs/ui/panelMenu.js +6 -0
  150. package/templates/Gjs/ui/popupMenu.d.ts +228 -0
  151. package/templates/Gjs/ui/popupMenu.js +6 -0
  152. package/templates/Gjs/ui/ripples.d.ts +44 -0
  153. package/templates/Gjs/ui/ripples.js +6 -0
  154. package/templates/Gjs/ui/search.d.ts +158 -0
  155. package/templates/Gjs/ui/search.js +6 -0
  156. package/templates/Gjs/ui/switcherPopup.d.ts +107 -0
  157. package/templates/Gjs/ui/switcherPopup.js +6 -0
  158. package/templates/Gjs/ui/userWidget.d.ts +13 -0
  159. package/templates/Gjs/ui/userWidget.js +6 -0
  160. package/templates/node-gtk/index.d.ts +3 -3
  161. package/templates/node-gtk/module.d.ts +0 -4
  162. package/templates/node-gtk/module.js +1 -1
package/README.md CHANGED
@@ -1,14 +1,42 @@
1
- # ts-for-gjs CLI
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/gjsify/ts-for-gir/main/.github/ts-for-gir.png" />
3
+ <h1 align="center">TS <small>for</small> GIR</h1>
4
+ </p>
5
+
6
+ <p align="center">
7
+ <img src="https://badgen.net/github/checks/gjsify/ts-for-gir" />
8
+ <img src="https://badgen.net/github/license/gjsify/ts-for-gir" />
9
+ <img src="https://badgen.net/npm/v/@ts-for-gir/cli" />
10
+ <img src="https://badgen.net/npm/dw/@ts-for-gir/cli" />
11
+ </p>
12
+
13
+ <p align="center">TypeScript type definition generator for GObject introspection interfaces</p>
14
+
15
+ <p align="center">
16
+ <img src="https://raw.githubusercontent.com/gjsify/ts-for-gir/main/.github/feeling.gif" />
17
+ </p>
18
+
19
+ # CLI
2
20
 
3
21
  CLI tool to generate Typescript Type Definition files for Gjs and node-gtk.
4
22
 
5
23
  ## Getting started
6
24
 
7
25
  ``` bash
8
- npm install @ts-for-gir/cli -g
26
+ npm install -g @ts-for-gir/cli
9
27
  ts-for-gir --help
10
28
  ```
11
29
 
30
+ > Alternatively you can also add @ts-for-gir/cli to your dependencies:
31
+ > ```bash
32
+ > npm install --save-dev @ts-for-gir/cli
33
+ > ```
34
+ >
35
+ > Or without installing using `npx`:
36
+ > ```bash
37
+ > npx @ts-for-gir/cli --help
38
+ > ```
39
+
12
40
  After you have installed `@ts-for-gir/cli` you can run the `ts-for-gir` command:
13
41
 
14
42
  ```bash
@@ -20,12 +48,30 @@ Commands:
20
48
  ts-for-gir generate [modules..] Generates .d.ts files from GIR for gjs or nod
21
49
  e-gtk
22
50
  ts-for-gir list [modules..] Lists all available GIR modules
51
+ ts-for-gir doc [modules..] The HTML documentation generator is not yet i
52
+ mplemented, but feel free to implement it 🤗
23
53
 
24
54
  Options:
25
55
  --version Show version number [boolean]
26
- --help Show help [boolean]
56
+ --help Show help [boolean] [boolean]
57
+ ```
58
+
59
+ ## Example
60
+
61
+ To generate the Typescript type definitions of Gtk-4.0 for Gjs run:
62
+
63
+ ```
64
+ ts-for-gir generate Gtk-4.0
65
+ ```
66
+
67
+ To generate this types for [node-gtk](https://github.com/romgrk/node-gtk) run:
68
+
69
+ ```
70
+ ts-for-gir generate Gtk-4.0 -e node
27
71
  ```
28
72
 
73
+ You can also look at the [examples](https://github.com/gjsify/ts-for-gir/tree/main/examples) to see how the types are generated there.
74
+
29
75
  ## Generate .d.ts files
30
76
 
31
77
  ```bash
@@ -36,48 +82,45 @@ ts-for-gir generate [modules..]
36
82
  Generates .d.ts files from GIR for gjs or node-gtk
37
83
 
38
84
  Options:
39
- --version Show version number [boolean]
40
- --help Show help [boolean]
41
- --modules GIR modules to load, e.g. 'Gio-2.0'. Accepts multiple m
42
- odules [array] [default: ["*"]]
43
- -g, --girDirectories GIR directories
85
+ --version Show version number [boolean]
86
+ --help Show help [boolean]
87
+ --modules GIR modules to load, e.g. 'Gio-2.0'. Accepts mul
88
+ tiple modules [array] [default: ["*"]]
89
+ -g, --girDirectories GIR directories
44
90
  [array] [default: ["/usr/share/gir-1.0"]]
45
- -o, --outdir Directory to output to [string] [default: "./@types"]
46
- -e, --environments Javascript environment
47
- [array] [choices: "gjs", "node"] [default: ["gjs","node"]]
48
- -i, --ignore Modules that should be ignored [array] [default: []]
49
- -b, --buildType Definitions generation type
91
+ -o, --outdir Directory to output to
92
+ [string] [default: "./@types"]
93
+ -e, --environments Javascript environment
94
+ [array] [choices: "gjs", "node"] [default: ["gjs"]]
95
+ -i, --ignore Modules that should be ignored
96
+ [array] [default: []]
97
+ -b, --buildType Definitions generation type
50
98
  [string] [choices: "lib", "types"] [default: "lib"]
51
- -t, --moduleType Specify what module code is generated.
52
- [string] [choices: "esm", "commonjs"] [default: "commonjs"]
53
- --pretty Prettifies the generated .d.ts files
99
+ -t, --moduleType Specify what module code is generated.
100
+ [string] [choices: "esm", "commonjs"] [default: "esm"]
101
+ -v, --verbose Switch on/off the verbose mode
54
102
  [string] [default: false]
55
- -v, --verbose Switch on/off the verbose mode [string] [default: true]
56
- --ignoreVersionConflicts Do not ask for package versions if multiple versions ar
57
- e found [string] [default: false]
58
- -p, --print Print the output to console and create no files
103
+ --ignoreVersionConflicts Do not ask for package versions if multiple vers
104
+ ions are found [string] [default: false]
105
+ -p, --print Print the output to console and create no files
59
106
  [string] [default: false]
60
- --configName Name of the config if you want to use a different name
61
- [string]
62
- -d, --useNamespace Export all symbols for each module as a namespace
107
+ --configName Name of the config if you want to use a differen
108
+ t name [string] [default: ".ts-for-girrc.js"]
109
+ -d, --noNamespace Do not export all symbols for each module as a n
110
+ amespace [string] [default: false]
111
+ -n, --noComments Do not generate documentation comments
63
112
  [string] [default: false]
64
- -n, --noComments Do not generate documentation comments
113
+ --noDebugComments Do not generate debugging inline comments
65
114
  [string] [default: false]
66
-
67
- Examples:
68
- ts-for-gir generate Run 'ts-for-gir generate' in your gj
69
- s or node-gtk project to generate ty
70
- pings for your project, pass the gir
71
- modules you need for your project
72
- ts-for-gir generate Gtk* You can also use wild cards
73
- ts-for-gir generate '*' If you want to parse all of your loc
74
- ally installed gir modules run
75
- ts-for-gir generate '*' -e gjs Generate .d.ts. files only for gjs
76
- ts-for-gir generate '*' -e node Generate .d.ts. files only for node
77
- ts-for-gir generate --configName='.ts-fo Use a special config file
78
- r-gir.gtk4.rc.js
79
- ts-for-gir generate --ignore=Gtk-3.0 xra Generate .d.ts. files but not for Gt
80
- ndr-1.3 k-3.0 and xrandr-1.3
115
+ --noDOMLib Disables the generation of types that are in con
116
+ flict with the DOM types
117
+ [string] [default: false]
118
+ --fixConflicts Fix Inheritance and implementation type conflict
119
+ s [string] [default: true]
120
+ --gnomeShellTypes Generate types for GNOME Shell (Experimental)
121
+ [string] [default: false]
122
+ -a, --generateAlias Generate an alias tsconfig file to support GJS E
123
+ SM module imports [string] [default: false]
81
124
  ```
82
125
 
83
126
  ## List available GIR modules
@@ -96,16 +139,9 @@ Options:
96
139
  dules [array] [default: ["*"]]
97
140
  -g, --girDirectories GIR directories[array] [default: ["/usr/share/gir-1.0"]]
98
141
  -i, --ignore Modules that should be ignored [array] [default: []]
99
- -v, --verbose Switch on/off the verbose mode [string] [default: true]
142
+ -v, --verbose Switch on/off the verbose mode [string] [default: false]
100
143
  --configName Name of the config if you want to use a different name
101
- [string]
102
-
103
- Examples:
104
- ts-for-gir list -g ./vala-girs/gir-1.0 Lists all available GIR modules in .
105
- /vala-girs/gir-1.0
106
- ts-for-gir list --ignore=Gtk-3.0 xrandr- Lists all available GIR modules in /
107
- 1.3 usr/share/gir-1.0 but not Gtk-3.0 an
108
- d xrandr-1.3
144
+ [string] [default: ".ts-for-girrc.js"]
109
145
  ```
110
146
 
111
147
  ## Generate HTML documentation
@@ -126,7 +162,6 @@ To do that, create a new config file called `.ts-for-girrc.js` in your project r
126
162
  ```js
127
163
  // or on CommonJs: exports.default = {
128
164
  export default {
129
- pretty: false,
130
165
  print: false,
131
166
  verbose: true,
132
167
  environments: ['gjs', 'node'],
@@ -134,7 +169,7 @@ export default {
134
169
  girDirectories: ['/usr/share/gir-1.0'],
135
170
  modules: ['*'],
136
171
  ignore: [],
137
- useNamespace: true,
172
+ noNamespace: false,
138
173
  buildType: 'lib',
139
174
  moduleType: 'esm'
140
175
  }
@@ -142,24 +177,244 @@ export default {
142
177
 
143
178
  The javascript config files must also be in ESM format if you are inside a ESM Package, this is the case if `"type": "module"` is defined in your package.json. Alternatively, the file can be saved in json format, then it works in both cases.
144
179
 
145
- ## About the `--moduleType esm` option
180
+ You can pass the config file name to the CLI using [configName](#configName).
181
+
182
+ ## Options
183
+
184
+ ### girDirectories
185
+ Directories in which *.gir files are to be searched for. Default is `["/usr/share/gir-1.0"]`. More than one can be specified. If you want to generate the types for the GNOME Shell you have to search in several folders for the corresponding types:
186
+ ```js
187
+ girDirectories: [
188
+ // General gir files
189
+ '/usr/share/gir-1.0',
190
+
191
+ // GNOME Shell gir file (package: gnome-shell-common / gnome-shell)
192
+ '/usr/share/gnome-shell',
193
+ '/usr/share/gnome-shell/gir-1.0',
146
194
 
147
- Gjs now supports ES modules, which can be activated with its `gjs -m` flag. Using this in conjunction with `"module": "es6"` in tsconfig.json is generally more
148
- convenient than using the `imports` global object, because you no longer have to provide an implementation of `require`. However, it creates two new
149
- problems for Typescript/ts-for-gjs. The first is that `gi` imports use a URI format, which Typescript doesn't support yet. To work around this problem
150
- you can import from a relative filename as usual, and the Javascript stubs generated by ts-for-gjs now forward the imports from the `gi` URI.
195
+ // GNOME Shell gir file dependencies on Fedora Workstation 37 (package: mutter)
196
+ '/usr/lib64/mutter-11',
197
+
198
+ // GNOME Shell gir file dependencies on Ubuntu 22.10 (package: libmutter-11-dev)
199
+ '/usr/lib/x86_64-linux-gnu/mutter-11',
200
+ ]
201
+ ```
151
202
 
152
- Or you can use a bundler like Webpack, ESBuild, Vite or Parcel to handle the imports, see [examples](../../examples) for examples with different bundlers.
203
+ ### outdir
204
+ The `outdir` option is used to specify the name of the directory where the generated TypeScript types should be saved. The default value of the `outdir` option is `"./@types"`.
153
205
 
154
- The second problem is that in ES module mode, `gi` imports behave as if they were exported by `export default`, which is not backwards compatible with
155
- ts-for-gjs. Where you would previously write:
206
+ Here is an example of how you can use the outdir option in the CLI of `ts-for-gir`:
207
+
208
+ ```bash
209
+ ts-for-gir generate * --outdir ./types
210
+ ```
156
211
 
157
- `import * as Gtk from "<path to gi bindings>/Gtk-4.0.js"`
212
+ In this example, the generated TypeScript types will be saved in the `./types` directory.
158
213
 
159
- you now have to write:
214
+ It is important to note that the outdir option should be a valid directory path, and `ts-for-gir` will create the directory if it does not exist. If the specified directory already contains files, `ts-for-gir` will overwrite the existing files with the newly generated types.
160
215
 
161
- `import Gtk from "<path to gi bindings>/Gtk-4.0.js"`
216
+ ### environments
217
+ The `environments` option allows you to specify the JavaScript environment for which you want to generate the TypeScript type definitions. The available values are `"gjs"` and `"node"`. You can also specify both environments.
218
+
219
+ The default value for this option is `"gjs"`.
220
+
221
+ To specify the environments option when running ts-for-gir, you would add the `--environments` or `-e` flag, followed by a comma-separated list of values. For example:
222
+
223
+ ```bash
224
+ ts-for-gir generate * --environments gjs node
225
+ ```
226
+
227
+ This option is useful if you want to generate type definitions for use in different JavaScript environments, such as in a `GJS` application or in a `Node.js` application using [node-gtk](https://github.com/romgrk/node-gtk). By specifying the appropriate environment, ts-for-gir can generate type definitions that are optimized for that environment, ensuring that your code will be type-checked correctly and you will receive meaningful error messages in your development environment.
228
+
229
+ ### ignore
230
+ The `ignore` CLI option allows you to specify modules that should be ignored when generating TypeScript types. This can be useful if you have multiple versions of a library installed but only want to generate types for one of them.
231
+
232
+ To use the ignore option, pass one or more module names as arguments. For example, to ignore the `Gtk-3.0` module, you would use the following command:
233
+
234
+ ```bash
235
+ ts-for-gir generate Gtk-* --ignore Gtk-3.0
236
+ ```
237
+
238
+ You can also ignore multiple modules:
239
+
240
+ ```bash
241
+ ts-for-gir generate * --ignore Gtk-2.0 Gtk-3.0 Gtk-4.0
242
+ ```
243
+
244
+ Note that ignoring a module will prevent ts-for-gir from generating types for that module and any submodules that it might contain.
245
+
246
+ ### buildType
247
+ `ts-for-gir` supports two build types for generating the types: `"lib"` and `"types"`.
248
+
249
+ * If `"lib"` is specified, `.js` files are generated as well as `.d.ts`, this is useful for some bundlers that expect a `.js` file. Some bundlers are also able to generate the import of this file only once, even if it occurs multiple times in your code.
250
+ * If `"types"` is specified, only `.d.ts` files are generated. In this mode it is recommended to add the generated `"@types/Gjs/index.d.ts" ` under `"include"` in the `tsconfig` to make the generated types known in your project. If you also want to use imports in `ESM` format, you should also enable the `generateAlias` option.
251
+
252
+ ### moduleType
253
+ The `moduleType` CLI option determines the format in which the generated JavaScript files should be exported. The option takes either `"esm"` or `"commonjs"` as its value, with `"esm"` being the default.
254
+
255
+ > This option is only relevant if the `buildType` is set to `"lib"`. The choice of `moduleType` may affect how the generated code is used in other parts of your project, so it's important to choose the right format that works best for your use case.
256
+
257
+ The choice of `moduleType` is also important in the context of the bundler that you plan to use in your project. For example, if you are using a bundler that only supports ESM (such as Rollup), you would need to set `moduleType` to "esm". On the other hand, if you are using a bundler that supports both ESM and CommonJS (such as Webpack), you can choose whichever format you prefer. Ultimately, the choice of `moduleType` will depend on your project requirements and the tools that you are using. For Example, if you want to build a GNOME Shell Extension, you should use `"commonjs"` because `ESM` is currently not supported for GNOME Shell Extensions. For [node-gtk](https://github.com/romgrk/node-gtk) you also need to use `"commonjs"`. If you want to build a regular Gjs Application we recommend to use `ESM`.
258
+
259
+ When `"esm"` is set, the generated JavaScript files will use the ECMAScript module (ESM) format for imports and exports. For example, the generated code might look like this:
260
+
261
+ ```ts
262
+ // Gtk-4.0.d.ts
263
+ import type GLib from './GLib-2.0.js';
264
+
265
+ namespace Gtk {
266
+ class Window extends Widget {
267
+ ...
268
+ }
269
+ function builder_error_quark(): GLib.Quark
270
+ }
271
+
272
+ export default Gtk;
273
+ ```
162
274
 
163
- Destructuring individual items in the import statement is not supported for this type of import.
275
+ ```js
276
+ // Gtk-4.0.js
277
+ import Gtk from 'gi://Gtk?version=4.0';
278
+ export default Gtk;
279
+ ```
280
+
281
+ > The `"esm"` module type is recommended for Gjs applications as it makes use of the ESM import syntax, which is more modern and flexible compared to imports.gi / CommonJS imports. This allows for a more streamlined and convenient way of using the generated types in your Gjs application. Support for ES modules can be activated in `gjs` with its `gjs -m` flag.
282
+
283
+ When `"commonjs"` and [`noNamespace`](#nonamespace) is set, the generated JavaScript files will use the CommonJS format exports and the `imports.gi` object for imports. For example:
284
+
285
+ ```ts
286
+ // Gtk-4.0.d.ts
287
+ import type * as GLib from './GLib-2.0.js';
288
+
289
+ export class Window extends Widget {
290
+ ...
291
+ }
292
+ export function builder_error_quark(): GLib.Quark
293
+ ```
294
+
295
+ ```js
296
+ // Gtk-4.0.js
297
+ imports.gi.versions.Gtk = '4.0'
298
+ const Gtk = imports.gi.Gtk;
299
+
300
+ module.exports = { Gtk };
301
+ exports.default = Gtk;
302
+ ```
303
+
304
+ > It is recommended to also set the [noNamespace](#nonamespace) option to true when using the `"commonjs"` moduleType option. This will ensure that the generated code is fully compatible with the CommonJS format.
305
+
306
+
307
+ ### verbose
308
+ The `--verbose` or `-v` option is a flag that can be used to enable verbose output in the console when running the CLI. When this option is enabled, additional warnings and information about the processing of GIR files and the generation of TypeScript definitions will be printed to the console. This information can be useful for debugging purposes or for understanding what is happening behind the scenes when generating the TypeScript definitions.
309
+
310
+ ### ignoreVersionConflicts
311
+ The `ignoreVersionConflicts` CLI option allows you to disable the prompt to choose between multiple versions of a `.gir` file. When multiple versions of a `.gir` file are found, such as `Gtk-3.0.gir` and `Gtk-4.0.gir`, the user is normally asked to select which version to use. However, if the `ignoreVersionConflicts` option is set, all versions of the file will be loaded without prompt.
312
+
313
+ This option can be useful in certain scenarios where you want to generate types for all versions of a library, even if there are conflicts between the versions. Note that this may result in type conflicts and other issues, so it should be used with caution.
314
+
315
+ Another way to disable the prompt and ignore conflicting versions of `.gir` files is to use the [ignore CLI option](#ignore).
316
+
317
+ ### print
318
+ The `print` CLI option allows you to output the generated TypeScript definitions to the console, instead of saving them to files on disk. This is useful if you want to quickly inspect the generated types without having to save them to disk and open them in an editor.
319
+
320
+ By default, the print option is disabled and the generated types will be saved to disk. To enable the `print` option, you can pass the `--print` flag to the command line interface.
321
+
322
+ ### configName
323
+ The `configName` CLI option allows you to specify the name of the configuration file to be used when generating the TypeScript definitions. This option is useful if you want to use a custom configuration file instead of the default one.
324
+
325
+ By default,` ts-for-gir` looks for a configuration file named `.ts-for-girrc.js` in the current directory. If a different configuration file name is required, the `configName` option can be used to specify the name of the configuration file.
326
+
327
+ For example, if you have a configuration file named `custom-config.js`, you can use the following command to generate TypeScript definitions using this configuration file:
328
+
329
+ ```bash
330
+ ts-for-gir generate * --configName custom-config.js
331
+ ```
332
+
333
+ ### noNamespace
334
+ This option disables the namespaces for each module type.
335
+
336
+ * By default the types are exported as a namespace. Namespaces should be used when the types are generated and used in **ESM** format.
337
+ * If imports in `imports.gi` or **CJS** format are used, then namespaces should be disabled.
338
+
339
+ ### noComments
340
+ The `noComments` option for `ts-for-gir` is a CLI option used to control the generation of **TSDoc** comments in the generated TypeScript bindings.
341
+
342
+ When `noComments` is set to `false`, `ts-for-gir` will include TSDoc comments in the generated TypeScript bindings that are based on the comments found in the GObject Introspection (GIR) files. These comments provide helpful information to developers about the usage and behavior of the bindings, making it easier to work with them.
343
+
344
+ When `noComments` is set to `true`, `ts-for-gir` will not include TSDoc comments in the generated TypeScript bindings. This can be useful if you want to reduce the size of the generated code.
345
+
346
+ To use the noComments option, pass it as a command line argument to `ts-for-gir`:
347
+
348
+ ```bash
349
+ ts-for-gir generate * --noComments`
350
+ ```
351
+
352
+ ### noDebugComments
353
+ The `noDebugComments` CLI option is used to control the generation of inline comments in the generated TypeScript files. These comments are used for debugging purposes and can be useful in tracking down issues with the generated types.
354
+
355
+ By default, the `noDebugComments` option is disabled and these inline comments will be included in the generated TypeScript files. If you do not require these comments for debugging purposes, you can use the -`-noDebugComments` option to disable their generation and keep your TypeScript code more compact.
356
+
357
+ ### noDOMLib
358
+ The `noDOMLib` option helps to avoid conflicts between the generated GJS global types and the DOM types, which can cause lint warnings and compilation errors with TypeScript.
359
+
360
+ To utilize this option, it is recommended to either modify your `tsconfig.json` or `jsconfig.json` file to exclude the DOM lib, or to enable the `noLib` property. Doing so will prevent the generation of types that conflict with the DOM types.
361
+
362
+ For more information on the `lib` and `noLib` properties, please refer to the official TypeScript documentation at https://www.typescriptlang.org/tsconfig/#lib and https://www.typescriptlang.org/tsconfig#noLib.
363
+
364
+ In summary, the `noDOMLib` option provides a convenient way to prevent the generation of conflicting types, making it easier to build robust and error-free TypeScript applications with GJS.
365
+
366
+ ### fixConflicts
367
+ The `fixConflicts` CLI option is used to resolve type conflicts between the GObject Introspection descriptions in GIR XML format and TypeScript. For example, properties in the GIR XML format can be overwritten by methods, which is not allowed in TypeScript. When this option is active, `ts-for-gir` attempts to resolve these conflicts. However, it's important to note that this may result in generating types that do not exist.
368
+
369
+ > If you have found an issue with the `fixConflicts` CLI option, we encourage you to report it. Reporting issues helps improve the quality of `ts-for-gir` and makes it a better tool for everyone.
370
+
371
+ ### gnomeShellTypes
372
+ The `gnomeShellTypes` CLI option generates types for GNOME Shell Extensions and is currently experimental. It is recommended to use this option if you are developing a GNOME Shell Extension and would like to benefit from type checking and auto-completion while writing your code. When this option is enabled, additional types will be generated for the GNOME Shell API.
373
+
374
+ Note that the generated types may contain experimental or incomplete parts, so use this option with caution and report any issues you encounter. Also note that the generated types are specific to the version of GNOME Shell that you are targeting, so make sure that you are using the correct version of GNOME Shell and `gir` files.
375
+
376
+ > The example in [examples/Gjs/gnome-shell-hello-world](https://github.com/gjsify/ts-for-gir/tree/main/examples/Gjs/gnome-shell-hello-world) demonstrates the usage of the `gnomeShellTypes` option and how you can build a GNOME Shell Extension with TypeScript using the generated types from `ts-for-gir`.
377
+
378
+ ### generateAlias
379
+ The `generateAlias` CLI option, when active, generates an alias `tsconfig.alias.json` file to support ESM module imports in GJS. This is particularly useful if you want to import GIR modules in your GJS code using the `'gi://...'` syntax. The generated `tsconfig.alias.json` file will contain the necessary path aliases to enable TypeScript to properly resolve the imported modules, allowing for improved code editor functionality, such as type checking and code completion.
380
+
381
+ The generateAlias option is particularly useful for GJS applications, as it allows you to import GIR modules using the standard ESM syntax, rather than having to use the global imports object.
382
+
383
+ You can extend the generated `tsconfig.alias.json` file in your main tsconfig.json file by setting the extends field to `./tsconfig.alias.json`.
384
+
385
+ ```json
386
+ // tsconfig.alias.json
387
+ {
388
+ "compilerOptions": {
389
+ "baseUrl": ".",
390
+ "paths": {
391
+ "gi://Gio?version=2.0": ["./@types/Gjs/Gio-2.0.d.ts"],
392
+ "gi://Gio": ["./@types/Gjs/Gio-2.0.d.ts"],
393
+ "gi://GObject?version=2.0": ["./@types/Gjs/GObject-2.0.d.ts"],
394
+ "gi://GObject": ["./@types/Gjs/GObject-2.0.d.ts"],
395
+ "gi://GLib?version=2.0": ["./@types/Gjs/GLib-2.0.d.ts"],
396
+ "gi://GLib": ["./@types/Gjs/GLib-2.0.d.ts"]
397
+ }
398
+ },
399
+ "include": ["./@types/Gjs/*.ts"]
400
+ }
401
+ ```
402
+
403
+ ```json
404
+ // tsconfig.json
405
+ {
406
+ "extends": "./tsconfig.alias.json",
407
+ "compilerOptions": {
408
+ "lib": ["ESNext"],
409
+ "types": [],
410
+ "target": "ESNext",
411
+ "module": "ESNext"
412
+ },
413
+ "include": ["@types/Gjs/index.d.ts"],
414
+ "files": [
415
+ "main.ts",
416
+ ]
417
+ }
418
+ ```
164
419
 
165
- See `examples/Gjs/browser` for an example for Gjs with ESM.
420
+ > The example in [examples/Gjs/gio-2-cat-alias](https://github.com/gjsify/ts-for-gir/tree/main/examples/Gjs/gio-2-cat-alias) demonstrates the usage of the generateAlias option. This example shows how to use the generated tsconfig.alias.json file in a Gjs project and provides a clear understanding of how this option can be used in practice.
@@ -19,8 +19,6 @@ export declare const generate: {
19
19
  buildType: unknown;
20
20
  } & {
21
21
  moduleType: unknown;
22
- } & {
23
- pretty: unknown;
24
22
  } & {
25
23
  verbose: unknown;
26
24
  } & {
@@ -30,17 +28,19 @@ export declare const generate: {
30
28
  } & {
31
29
  configName: unknown;
32
30
  } & {
33
- useNamespace: unknown;
31
+ noNamespace: unknown;
34
32
  } & {
35
33
  noComments: unknown;
36
34
  } & {
37
35
  noDebugComments: unknown;
38
- } & {
39
- noCheck: unknown;
40
36
  } & {
41
37
  noDOMLib: unknown;
42
38
  } & {
43
39
  fixConflicts: unknown;
40
+ } & {
41
+ gnomeShellTypes: unknown;
42
+ } & {
43
+ generateAlias: unknown;
44
44
  }>;
45
45
  handler: (args: any) => Promise<void>;
46
46
  examples: readonly [string, (string | undefined)?][];
@@ -18,17 +18,17 @@ const builder = (yargs) => {
18
18
  .option('ignore', Config.generateOptions.ignore)
19
19
  .option('buildType', Config.generateOptions.buildType)
20
20
  .option('moduleType', Config.generateOptions.moduleType)
21
- .option('pretty', Config.generateOptions.pretty)
22
21
  .option('verbose', Config.generateOptions.verbose)
23
22
  .option('ignoreVersionConflicts', Config.generateOptions.ignoreVersionConflicts)
24
23
  .option('print', Config.generateOptions.print)
25
24
  .option('configName', Config.generateOptions.configName)
26
- .option('useNamespace', Config.generateOptions.useNamespace)
25
+ .option('noNamespace', Config.generateOptions.noNamespace)
27
26
  .option('noComments', Config.generateOptions.noComments)
28
27
  .option('noDebugComments', Config.generateOptions.noDebugComments)
29
- .option('noCheck', Config.generateOptions.noCheck)
30
28
  .option('noDOMLib', Config.generateOptions.noDOMLib)
31
29
  .option('fixConflicts', Config.generateOptions.fixConflicts)
30
+ .option('gnomeShellTypes', Config.generateOptions.gnomeShellTypes)
31
+ .option('generateAlias', Config.generateOptions.generateAlias)
32
32
  .example(examples);
33
33
  };
34
34
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -58,8 +58,8 @@ const examples = [
58
58
  [`${Config.appName} generate '*' -e node`, 'Generate .d.ts. files only for node'],
59
59
  [`${Config.appName} generate --configName='.ts-for-gir.gtk4.rc.js`, 'Use a special config file'],
60
60
  [
61
- `${Config.appName} generate --ignore=Gtk-3.0 xrandr-1.3`,
62
- 'Generate .d.ts. files but not for Gtk-3.0 and xrandr-1.3',
61
+ `${Config.appName} generate --ignore=Gtk-4.0 xrandr-1.3`,
62
+ 'Generate .d.ts. files but not for Gtk-4.0 and xrandr-1.3',
63
63
  ],
64
64
  ];
65
65
  export const generate = {
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/commands/generate.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AG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAEhD,MAAM,QAAQ,CAAC,KAAK,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAA;KACtD;AACL,CAAC,CAAA;AAED,MAAM,QAAQ,GAAqC;IAC/C;QACI,GAAG,MAAM,CAAC,OAAO,WAAW;QAC5B,QAAQ,MAAM,CAAC,OAAO,iIAAiI;KAC1J;IACD,CAAC,GAAG,MAAM,CAAC,OAAO,gBAAgB,EAAE,6BAA6B,CAAC;IAClE,CAAC,GAAG,MAAM,CAAC,OAAO,eAAe,EAAE,oEAAoE,CAAC;IACxG,CAAC,GAAG,MAAM,CAAC,OAAO,sBAAsB,EAAE,oCAAoC,CAAC;IAC/E,CAAC,GAAG,MAAM,CAAC,OAAO,uBAAuB,EAAE,qCAAqC,CAAC;IACjF,CAAC,GAAG,MAAM,CAAC,OAAO,gDAAgD,EAAE,2BAA2B,CAAC;IAChG;QACI,GAAG,MAAM,CAAC,OAAO,uCAAuC;QACxD,0DAA0D;KAC7D;CACJ,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,OAAO;IACP,WAAW;IACX,OAAO;IACP,OAAO;IACP,QAAQ;CACX,CAAA"}
package/lib/config.d.ts CHANGED
@@ -8,7 +8,6 @@ export declare class Config {
8
8
  */
9
9
  static defaults: {
10
10
  environments: string[];
11
- pretty: boolean;
12
11
  print: boolean;
13
12
  configName: string;
14
13
  outdir: string;
@@ -17,38 +16,22 @@ export declare class Config {
17
16
  ignore: never[];
18
17
  verbose: boolean;
19
18
  ignoreVersionConflicts: boolean;
20
- useNamespace: boolean;
19
+ noNamespace: boolean;
21
20
  buildType: string;
22
21
  moduleType: string;
23
22
  noComments: boolean;
24
23
  noDebugComments: boolean;
25
- noCheck: boolean;
26
24
  fixConflicts: boolean;
27
25
  noDOMLib: boolean;
26
+ gnomeShellTypes: boolean;
27
+ generateAlias: boolean;
28
28
  };
29
29
  static configFilePath: string;
30
30
  /**
31
31
  * CLI options used in commands/generate.ts and commands/list.ts
32
32
  */
33
33
  static options: {
34
- modules: Options;
35
- girDirectories: Options;
36
- outdir: Options;
37
- environments: Options;
38
- ignore: Options;
39
- buildType: Options;
40
- moduleType: Options;
41
- pretty: Options;
42
- verbose: Options;
43
- ignoreVersionConflicts: Options;
44
- print: Options;
45
- configName: Options;
46
- useNamespace: Options;
47
- noComments: Options;
48
- noDebugComments: Options;
49
- noCheck: Options;
50
- fixConflicts: Options;
51
- noDOMLib: Options;
34
+ [name: string]: Options;
52
35
  };
53
36
  /**
54
37
  * CLI flags used in commands/generate.ts
@@ -61,17 +44,17 @@ export declare class Config {
61
44
  ignore: Options;
62
45
  buildType: Options;
63
46
  moduleType: Options;
64
- pretty: Options;
65
47
  verbose: Options;
66
48
  ignoreVersionConflicts: Options;
67
49
  print: Options;
68
50
  configName: Options;
69
- useNamespace: Options;
51
+ noNamespace: Options;
70
52
  noComments: Options;
71
53
  noDebugComments: Options;
72
- noCheck: Options;
73
54
  noDOMLib: Options;
74
55
  fixConflicts: Options;
56
+ gnomeShellTypes: Options;
57
+ generateAlias: Options;
75
58
  };
76
59
  static listOptions: {
77
60
  modules: Options;