@ts-for-gir/lib 3.0.0-beta.12 → 3.0.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.
Files changed (212) hide show
  1. package/lib/constants.d.ts +7 -3
  2. package/lib/constants.js +14 -2
  3. package/lib/constants.js.map +1 -1
  4. package/lib/dependency-manager.d.ts +52 -3
  5. package/lib/dependency-manager.js +138 -18
  6. package/lib/dependency-manager.js.map +1 -1
  7. package/lib/gir-module.d.ts +12 -5
  8. package/lib/gir-module.js +25 -8
  9. package/lib/gir-module.js.map +1 -1
  10. package/lib/index.d.ts +3 -1
  11. package/lib/index.js +3 -1
  12. package/lib/index.js.map +1 -1
  13. package/lib/injection/classes/gjs/index.js +3 -3
  14. package/lib/injection/classes/index.js +1 -1
  15. package/lib/injection/classes/node-gtk/index.js +8 -8
  16. package/lib/messages.d.ts +0 -2
  17. package/lib/messages.js +1 -3
  18. package/lib/messages.js.map +1 -1
  19. package/lib/package-data-parser.d.ts +13 -0
  20. package/lib/package-data-parser.js +67 -0
  21. package/lib/package-data-parser.js.map +1 -0
  22. package/lib/package-data.d.ts +9 -0
  23. package/lib/package-data.js +41 -0
  24. package/lib/package-data.js.map +1 -0
  25. package/lib/symtable.js +2 -1
  26. package/lib/symtable.js.map +1 -1
  27. package/lib/template-processor.d.ts +59 -19
  28. package/lib/template-processor.js +128 -41
  29. package/lib/template-processor.js.map +1 -1
  30. package/lib/transformation.d.ts +2 -1
  31. package/lib/transformation.js +44 -26
  32. package/lib/transformation.js.map +1 -1
  33. package/lib/types/construct-name.d.ts +1 -1
  34. package/lib/types/dependency.d.ts +17 -2
  35. package/lib/types/generate-config.d.ts +9 -2
  36. package/lib/types/index.d.ts +5 -0
  37. package/lib/types/index.js +5 -0
  38. package/lib/types/index.js.map +1 -1
  39. package/lib/types/module-type.d.ts +1 -1
  40. package/lib/types/package-data-parsed.d.ts +28 -0
  41. package/lib/types/package-data-parsed.js +2 -0
  42. package/lib/types/package-data-parsed.js.map +1 -0
  43. package/lib/types/package-data.d.ts +23 -0
  44. package/lib/types/package-data.js +2 -0
  45. package/lib/types/package-data.js.map +1 -0
  46. package/lib/types/package-section-parsed.d.ts +8 -0
  47. package/lib/types/package-section-parsed.js +2 -0
  48. package/lib/types/package-section-parsed.js.map +1 -0
  49. package/lib/types/package-section.d.ts +8 -0
  50. package/lib/types/package-section.js +2 -0
  51. package/lib/types/package-section.js.map +1 -0
  52. package/lib/types/parsed-package-data.d.ts +6 -0
  53. package/lib/types/parsed-package-data.js +2 -0
  54. package/lib/types/parsed-package-data.js.map +1 -0
  55. package/lib/types/template-data.d.ts +2 -1
  56. package/lib/types/transformation-case.d.ts +1 -1
  57. package/lib/types/transformations.d.ts +1 -1
  58. package/lib/types/user-config.d.ts +6 -2
  59. package/lib/utils.d.ts +31 -16
  60. package/lib/utils.js +68 -30
  61. package/lib/utils.js.map +1 -1
  62. package/package.json +20 -19
  63. package/templates/README.md +102 -0
  64. package/templates/gjs/README-GJS.md +109 -0
  65. package/templates/gjs/ambient.d.ts +59 -0
  66. package/templates/gjs/cairo-1.0.d.ts +9 -0
  67. package/templates/gjs/cairo.d.ts +8 -0
  68. package/templates/gjs/cairo.js +11 -0
  69. package/templates/gjs/gettext.d.ts +41 -0
  70. package/templates/gjs/gettext.js +11 -0
  71. package/templates/{Gjs/Gio-2.0.d.ts → gjs/gio-2.0.d.ts} +1 -1
  72. package/templates/{Gjs/index.d.ts → gjs/gjs.d.ts} +221 -58
  73. package/templates/gjs/gjs.js +10 -0
  74. package/templates/{Gjs/GObject-2.0.d.ts → gjs/gobject-2.0.d.ts} +1 -1
  75. package/templates/gjs/module-ambient.d.ts +31 -0
  76. package/templates/gjs/module-import.d.ts +33 -0
  77. package/templates/gjs/module.append.d.ts +1 -0
  78. package/templates/gjs/module.d.ts +12 -0
  79. package/templates/gjs/module.js +17 -0
  80. package/templates/gjs/system.d.ts +32 -0
  81. package/templates/gjs/system.js +11 -0
  82. package/templates/gjs/tsconfig.alias.json +12 -0
  83. package/templates/node-gtk/README-NODE-GTK.md +71 -0
  84. package/templates/node-gtk/ambient.d.ts +19 -0
  85. package/templates/node-gtk/module-import.d.ts +29 -0
  86. package/templates/node-gtk/module.append.d.ts +1 -0
  87. package/templates/node-gtk/module.d.ts +4 -0
  88. package/templates/node-gtk/module.js +2 -1
  89. package/templates/node-gtk/node-gtk.d.ts +25 -0
  90. package/templates/node-gtk/{index.js → node-gtk.js} +0 -2
  91. package/templates/package.json +173 -0
  92. package/templates/tsconfig.doc.json +30 -0
  93. package/lib/injection/classes/GooCanvas-2.0.d.ts +0 -2
  94. package/lib/injection/classes/GooCanvas-2.0.js +0 -26
  95. package/lib/injection/classes/GooCanvas-2.0.js.map +0 -1
  96. package/lib/injection/classes/GooCanvas-3.0.d.ts +0 -2
  97. package/lib/injection/classes/GooCanvas-3.0.js +0 -26
  98. package/lib/injection/classes/GooCanvas-3.0.js.map +0 -1
  99. package/lib/injection/classes/GooCanvas-x.0.d.ts +0 -2
  100. package/lib/injection/classes/GooCanvas-x.0.js +0 -26
  101. package/lib/injection/classes/GooCanvas-x.0.js.map +0 -1
  102. package/lib/injection/classes/gjs/GooCanvas-2.0.d.ts +0 -2
  103. package/lib/injection/classes/gjs/GooCanvas-2.0.js +0 -14
  104. package/lib/injection/classes/gjs/GooCanvas-2.0.js.map +0 -1
  105. package/lib/types/library-version.d.ts +0 -7
  106. package/lib/types/library-version.js +0 -2
  107. package/lib/types/library-version.js.map +0 -1
  108. package/templates/Gjs/Gjs.d.ts +0 -204
  109. package/templates/Gjs/Gjs.js +0 -21
  110. package/templates/Gjs/GnomeShell.d.ts +0 -154
  111. package/templates/Gjs/GnomeShell.js +0 -10
  112. package/templates/Gjs/index.js +0 -4
  113. package/templates/Gjs/misc/dbusUtils.d.ts +0 -15
  114. package/templates/Gjs/misc/dbusUtils.js +0 -6
  115. package/templates/Gjs/misc/extensionUtils.d.ts +0 -99
  116. package/templates/Gjs/misc/extensionUtils.js +0 -6
  117. package/templates/Gjs/misc/fileUtils.d.ts +0 -51
  118. package/templates/Gjs/misc/fileUtils.js +0 -6
  119. package/templates/Gjs/misc/gnomeSession.d.ts +0 -74
  120. package/templates/Gjs/misc/gnomeSession.js +0 -6
  121. package/templates/Gjs/misc/parentalControlsManager.d.ts +0 -42
  122. package/templates/Gjs/misc/parentalControlsManager.js +0 -6
  123. package/templates/Gjs/misc/signals.d.ts +0 -15
  124. package/templates/Gjs/misc/signals.js +0 -6
  125. package/templates/Gjs/module.d.ts +0 -6
  126. package/templates/Gjs/module.js +0 -16
  127. package/templates/Gjs/tsconfig.alias.json +0 -10
  128. package/templates/Gjs/ui/accessDialog.d.ts +0 -19
  129. package/templates/Gjs/ui/accessDialog.js +0 -6
  130. package/templates/Gjs/ui/altTab.d.ts +0 -124
  131. package/templates/Gjs/ui/altTab.js +0 -6
  132. package/templates/Gjs/ui/animation.d.ts +0 -58
  133. package/templates/Gjs/ui/animation.js +0 -6
  134. package/templates/Gjs/ui/appDisplay.d.ts +0 -204
  135. package/templates/Gjs/ui/appDisplay.js +0 -6
  136. package/templates/Gjs/ui/appFavorites.d.ts +0 -34
  137. package/templates/Gjs/ui/appFavorites.js +0 -6
  138. package/templates/Gjs/ui/appMenu.d.ts +0 -74
  139. package/templates/Gjs/ui/appMenu.js +0 -6
  140. package/templates/Gjs/ui/audioDeviceSelection.d.ts +0 -51
  141. package/templates/Gjs/ui/audioDeviceSelection.js +0 -6
  142. package/templates/Gjs/ui/background.d.ts +0 -255
  143. package/templates/Gjs/ui/background.js +0 -5
  144. package/templates/Gjs/ui/backgroundMenu.d.ts +0 -19
  145. package/templates/Gjs/ui/backgroundMenu.js +0 -5
  146. package/templates/Gjs/ui/barLevel.d.ts +0 -42
  147. package/templates/Gjs/ui/barLevel.js +0 -5
  148. package/templates/Gjs/ui/boxpointer.d.ts +0 -103
  149. package/templates/Gjs/ui/boxpointer.js +0 -5
  150. package/templates/Gjs/ui/calendar.d.ts +0 -261
  151. package/templates/Gjs/ui/calendar.js +0 -5
  152. package/templates/Gjs/ui/checkBox.d.ts +0 -22
  153. package/templates/Gjs/ui/checkBox.js +0 -5
  154. package/templates/Gjs/ui/closeDialog.d.ts +0 -40
  155. package/templates/Gjs/ui/closeDialog.js +0 -5
  156. package/templates/Gjs/ui/components/__init__.d.ts +0 -9
  157. package/templates/Gjs/ui/components/__init__.js +0 -6
  158. package/templates/Gjs/ui/components/automountManager.d.ts +0 -8
  159. package/templates/Gjs/ui/components/automountManager.js +0 -6
  160. package/templates/Gjs/ui/components/autorunManager.d.ts +0 -8
  161. package/templates/Gjs/ui/components/autorunManager.js +0 -6
  162. package/templates/Gjs/ui/components/index.d.ts +0 -6
  163. package/templates/Gjs/ui/components/index.js +0 -6
  164. package/templates/Gjs/ui/components/keyring.d.ts +0 -19
  165. package/templates/Gjs/ui/components/keyring.js +0 -6
  166. package/templates/Gjs/ui/components/networkAgent.d.ts +0 -10
  167. package/templates/Gjs/ui/components/networkAgent.js +0 -6
  168. package/templates/Gjs/ui/components/polkitAgent.d.ts +0 -19
  169. package/templates/Gjs/ui/components/polkitAgent.js +0 -6
  170. package/templates/Gjs/ui/components/telepathyClient.d.ts +0 -10
  171. package/templates/Gjs/ui/components/telepathyClient.js +0 -6
  172. package/templates/Gjs/ui/dialog.d.ts +0 -78
  173. package/templates/Gjs/ui/dialog.js +0 -6
  174. package/templates/Gjs/ui/dnd.d.ts +0 -127
  175. package/templates/Gjs/ui/dnd.js +0 -6
  176. package/templates/Gjs/ui/iconGrid.d.ts +0 -172
  177. package/templates/Gjs/ui/iconGrid.js +0 -6
  178. package/templates/Gjs/ui/layout.d.ts +0 -311
  179. package/templates/Gjs/ui/layout.js +0 -6
  180. package/templates/Gjs/ui/main.d.ts +0 -215
  181. package/templates/Gjs/ui/main.js +0 -6
  182. package/templates/Gjs/ui/messageList.d.ts +0 -113
  183. package/templates/Gjs/ui/messageList.js +0 -6
  184. package/templates/Gjs/ui/messageTray.d.ts +0 -423
  185. package/templates/Gjs/ui/messageTray.js +0 -6
  186. package/templates/Gjs/ui/modalDialog.d.ts +0 -96
  187. package/templates/Gjs/ui/modalDialog.js +0 -6
  188. package/templates/Gjs/ui/mpris.d.ts +0 -78
  189. package/templates/Gjs/ui/mpris.js +0 -6
  190. package/templates/Gjs/ui/notificationDaemon.d.ts +0 -5
  191. package/templates/Gjs/ui/notificationDaemon.js +0 -6
  192. package/templates/Gjs/ui/panel.d.ts +0 -65
  193. package/templates/Gjs/ui/panel.js +0 -6
  194. package/templates/Gjs/ui/panelMenu.d.ts +0 -51
  195. package/templates/Gjs/ui/panelMenu.js +0 -6
  196. package/templates/Gjs/ui/popupMenu.d.ts +0 -228
  197. package/templates/Gjs/ui/popupMenu.js +0 -6
  198. package/templates/Gjs/ui/ripples.d.ts +0 -44
  199. package/templates/Gjs/ui/ripples.js +0 -6
  200. package/templates/Gjs/ui/search.d.ts +0 -158
  201. package/templates/Gjs/ui/search.js +0 -6
  202. package/templates/Gjs/ui/switcherPopup.d.ts +0 -107
  203. package/templates/Gjs/ui/switcherPopup.js +0 -6
  204. package/templates/Gjs/ui/userWidget.d.ts +0 -13
  205. package/templates/Gjs/ui/userWidget.js +0 -6
  206. package/templates/node-gtk/index.d.ts +0 -40
  207. /package/templates/{Cogl-2.0.d.ts → cogl-2-0.d.ts} +0 -0
  208. /package/templates/{Granite-1.0.d.ts → granite-1.0.d.ts} +0 -0
  209. /package/templates/{Granite-7.0.d.ts → granite-7.0.d.ts} +0 -0
  210. /package/templates/{GstBase-0.10.d.ts → gstbase-0.10.d.ts} +0 -0
  211. /package/templates/node-gtk/{GObject-2.0.d.ts → gobject-2.0.d.ts} +0 -0
  212. /package/templates/{RygelServer-2.6.d.ts → rygelserver-2.6.d.ts} +0 -0
@@ -0,0 +1,102 @@
1
+ <%# This template is used if the Option `package` is enabled %>
2
+ # <%- packageName %>
3
+
4
+ <%- PACKAGE_DESC %> using [<%- APP_NAME %>](<%- APP_SOURCE %>) v<%- APP_VERSION %>.
5
+
6
+ <%_ if (typeof pkgData !== 'undefined' && pkgData.description) { _%>
7
+ <%- pkgData.description %>
8
+ <%_ } _%>
9
+
10
+ ## Install
11
+
12
+ To use this type definitions, install them with NPM:
13
+ ```bash
14
+ npm install <%- npmScope %>/<%- importName %>
15
+ ```
16
+
17
+ <%_ const pkg = dep.get(packageName) _%>
18
+ <%_ if(!pkg){ _%>
19
+ <%_ return `Package with package name "${packageName}" not found!` _%>
20
+ <%_ } _%>
21
+ ## Usage
22
+
23
+ You can import this package into your project like this:
24
+ ```ts
25
+ import <%- pkg.namespace %> from '<%- pkg.importPath %>';
26
+ ```
27
+
28
+ Or if you prefer CommonJS, you can also use this:
29
+ ```ts
30
+ const <%- pkg.namespace %> = require('<%- pkg.importPath %>');
31
+ ```
32
+
33
+ ### Ambient Modules
34
+
35
+ 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.
36
+ For this you need to include `<%- npmScope %>/<%- importName %>` or `<%- npmScope %>/<%- importName %>/<%= environment === 'gjs' ? "ambient" : "import" %>` in your `tsconfig` or entry point Typescript file:
37
+
38
+ `index.ts`:
39
+ ```ts
40
+ import '<%- npmScope %>/<%- importName %>'
41
+ ```
42
+
43
+ `tsconfig.json`:
44
+ ```json
45
+ {
46
+ "compilerOptions": {
47
+ ...
48
+ },
49
+ "include": ["<%- npmScope %>/<%- importName %>"],
50
+ ...
51
+ }
52
+ ```
53
+
54
+ Now you can import the ambient module with TypeScript support:
55
+
56
+ <%_ if(environment === 'gjs'){ _%>
57
+ ```ts
58
+ import <%= pkg.namespace %> from 'gi://<%= pkg.namespace %>?version=<%= pkg.version %>';
59
+ ```
60
+ <%_ } else { _%>
61
+ ```ts
62
+ const gi = require('node-gtk')
63
+ const <%= pkg.namespace %> = gi.require('<%= pkg.namespace %>', '<%= pkg.version %>')
64
+ ```
65
+ <%_ } _%>
66
+
67
+ <%_ if(environment === 'gjs'){ _%>
68
+ ### Global import
69
+
70
+ You can also import the module with Typescript support using the global `imports.gi` object of GJS.
71
+ For this you need to include `<%- npmScope %>/<%- importName %>` or `<%- npmScope %>/<%- importName %>/import` in your `tsconfig` or entry point Typescript file:
72
+
73
+ `index.ts`:
74
+ ```ts
75
+ import '<%- npmScope %>/<%- importName %>'
76
+ ```
77
+
78
+ `tsconfig.json`:
79
+ ```json
80
+ {
81
+ "compilerOptions": {
82
+ ...
83
+ },
84
+ "include": ["<%- npmScope %>/<%- importName %>"],
85
+ ...
86
+ }
87
+ ```
88
+
89
+ Now you have also type support for this, too:
90
+
91
+ ```ts
92
+ const <%= pkg.namespace %> = imports.gi.<%= pkg.namespace %>;
93
+ ```
94
+ <%_ } _%>
95
+
96
+ ### Bundle
97
+
98
+ 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).
99
+
100
+ ## Other packages
101
+
102
+ All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
@@ -0,0 +1,109 @@
1
+ <%# This template is used for the README.md of @girs/gjs if the Option `package` is enabled %>
2
+ # <%- packageName %>
3
+
4
+ <%- PACKAGE_DESC %> using [<%- APP_NAME %>](<%- APP_SOURCE %>) v<%- APP_VERSION %>.
5
+
6
+ <%_ if (typeof pkgData !== 'undefined' && pkgData.description) { _%>
7
+ <%- pkgData.description %>
8
+ <%_ } else { _%>
9
+ [GJS](https://gitlab.gnome.org/GNOME/gjs) is a JavaScript runtime for the GNOME ecosystem. Using GJS and the type definitions in this NPM package, you can build GTK applications in JavaScript or TypeScript with type checking, better autocompletion and inline documentations.
10
+ <%_ } _%>
11
+
12
+ ## Install
13
+
14
+ To use this type definitions, install them with NPM:
15
+ ```bash
16
+ npm install <%- npmScope %>/<%- importName %>
17
+ ```
18
+
19
+ <%_ const pkg = dep.get(packageName) _%>
20
+ <%_ if(!pkg){ _%>
21
+ <%_ return `Package with package name "${packageName}" not found!` _%>
22
+ <%_ } _%>
23
+
24
+ ## Usage
25
+
26
+ You can import this package into your project like this:
27
+ ```ts
28
+ import <%- pkg.namespace %> from '<%- pkg.importPath %>';
29
+ ```
30
+
31
+ Or if you prefer CommonJS, you can also use this:
32
+ ```ts
33
+ const <%- pkg.namespace %> = require('<%- pkg.importPath %>');
34
+ ```
35
+
36
+ ### Global types
37
+
38
+ After the import, the global types of GJS are also available:
39
+
40
+ ```ts
41
+ console.log('Hello World from console');
42
+ print('Hello World from print');
43
+
44
+ const ByteArray = imports.byteArray;
45
+
46
+ const encoder = new TextEncoder();
47
+ const encoded = encoder.encode('𝓽𝓮𝔁𝓽');
48
+
49
+ // And so on...
50
+ ```
51
+
52
+ ### Ambient Modules
53
+
54
+ You can import the built in [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) of GJS.
55
+ For this you need to include the `<%- npmScope %>/<%- importName %>` or `<%- npmScope %>/<%- importName %>/ambient` in your `tsconfig` or entry point Typescript file:
56
+
57
+ `index.ts`:
58
+ ```ts
59
+ import '<%- npmScope %>/<%- importName %>'
60
+ ```
61
+
62
+ `tsconfig.json`:
63
+ ```json
64
+ {
65
+ "compilerOptions": {
66
+ ...
67
+ },
68
+ "include": ["<%- npmScope %>/<%- importName %>"],
69
+ ...
70
+ }
71
+ ```
72
+
73
+ Now you can import `gettext`, `system` and `cairo` in ESM style with Typescript support:
74
+
75
+ ```ts
76
+ import gettext from 'gettext';
77
+ import system from 'system';
78
+ import cairo from 'cairo';
79
+ ```
80
+
81
+ ### GIR modules
82
+
83
+ If you want to have types for [GObject Introspection](https://gi.readthedocs.io/en/latest/) 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), [gio-2.0](https://www.npmjs.com/package/@girs/gio-2.0), [adw-1](https://www.npmjs.com/package/@girs/adw-1) and [much more](https://github.com/gjsify/types).
84
+
85
+ These types will then be available to you:
86
+
87
+ ```ts
88
+ import '@girs/gjs'
89
+ import '@girs/gio-2.0'
90
+ import '@girs/gtk-4.0'
91
+ import '@girs/adw-1'
92
+
93
+ import Gio from 'gi://Gio?version=2.0';
94
+ import Gtk from 'gi://Gtk?version=4.0';
95
+ import Adwaita from 'gi://adw?version=1';
96
+
97
+ const button = new Gtk.Button();
98
+
99
+ // ...
100
+
101
+ ```
102
+
103
+ ### Bundle
104
+
105
+ 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).
106
+
107
+ ## Other packages
108
+
109
+ All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
@@ -0,0 +1,59 @@
1
+ // https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules
2
+ // https://stackoverflow.com/questions/45099605/ambient-declaration-with-an-imported-type-in-typescript
3
+
4
+ declare module 'gettext' {
5
+ <%_ if(package){ _%>
6
+ export * from '@girs/gjs/gettext';
7
+ import Gettext from '@girs/gjs/gettext';
8
+ export default Gettext;
9
+ <%_ } else { _%>
10
+ const Gettext: typeof import('./gettext.js').default;
11
+ export default Gettext;
12
+
13
+ export const LocaleCategory: typeof import('./gettext.js').LocaleCategory;
14
+ export const setlocale: typeof import('./gettext.js').setlocale;
15
+ export const textdomain: typeof import('./gettext.js').textdomain;
16
+ export const bindtextdomain: typeof import('./gettext.js').bindtextdomain;
17
+ export const gettext: typeof import('./gettext.js').gettext;
18
+ export const dgettext: typeof import('./gettext.js').dgettext;
19
+ export const dcgettext: typeof import('./gettext.js').dcgettext;
20
+ export const ngettext: typeof import('./gettext.js').ngettext;
21
+ export const dngettext: typeof import('./gettext.js').dngettext;
22
+ export const pgettext: typeof import('./gettext.js').pgettext;
23
+ export const dpgettext: typeof import('./gettext.js').dpgettext;
24
+ export const domain: typeof import('./gettext.js').domain;
25
+ <%_ } _%>
26
+ }
27
+
28
+ declare module 'system' {
29
+ <%_ if(package){ _%>
30
+ export * from '@girs/gjs/system';
31
+ import System from '@girs/gjs/system';
32
+ export default System;
33
+ <%_ } else { _%>
34
+ const System: typeof import('./gettext.js').default;
35
+ export default System;
36
+
37
+ export const programInvocationName: typeof import('./system.js').programInvocationName;
38
+ export const version: typeof import('./system.js').version;
39
+ export const programPath: typeof import('./system.js').programPath;
40
+ export const programArgs: typeof import('./system.js').programArgs;
41
+ export const exit: typeof import('./system.js').exit;
42
+ export const addressOfGObject: typeof import('./system.js').addressOfGObject;
43
+ export const addressOf: typeof import('./system.js').addressOf;
44
+ export const gc: typeof import('./system.js').gc;
45
+ export const refcount: typeof import('./system.js').refcount;
46
+ export const dumpHeap: typeof import('./system.js').dumpHeap;
47
+ export const dumpMemoryInfo: typeof import('./system.js').dumpMemoryInfo;
48
+ <%_ } _%>
49
+ }
50
+
51
+ declare module 'cairo' {
52
+ <%_ if(package){ _%>
53
+ import Cairo from '@girs/gjs/cairo';
54
+ export default Cairo;
55
+ <%_ } else { _%>
56
+ const Cairo: typeof import('./cairo.js').default;
57
+ export default Cairo;
58
+ <%_ } _%>
59
+ }
@@ -0,0 +1,9 @@
1
+ // TODO
2
+ // See
3
+ // - https://gitlab.gnome.org/GNOME/gjs/-/blob/master/installed-tests/js/testCairoModule.js
4
+ // - https://gitlab.gnome.org/GNOME/gjs/-/blob/master/installed-tests/js/testCairo.js
5
+ // - https://gitlab.gnome.org/GNOME/gjs/-/blob/master/doc/cairo.md
6
+
7
+ // image_surface_create -> ImageSurface
8
+ // Context.constructor(surface: cairo.ImageSurface)
9
+ // ...
@@ -0,0 +1,8 @@
1
+ // TODO: See ./cairo-1.0.d.ts
2
+ declare const Cairo: any;
3
+
4
+ export default Cairo;
5
+
6
+ <% if(moduleType === 'cjs') { %>
7
+ // TODO declare named exports here, cairo doesn't have named exports for its esm module but for cjs we can use `const { Context } = imports.cairo` for that, see `./cairo.js`
8
+ <% } %>
@@ -0,0 +1,11 @@
1
+ <% if(moduleType === 'esm') { %>
2
+ import Cairo from 'cairo';
3
+
4
+ // cairo doesn't have named exports, see https://gitlab.gnome.org/GNOME/gjs/-/blob/c2a714f348d6848037f072063e0a914fd537c4f4/installed-tests/js/testCairoModule.js#L14
5
+ export default Cairo;
6
+ <% } else { %>
7
+ const Cairo = imports.cairo;
8
+
9
+ module.exports = Cairo;
10
+ exports.default = Cairo;
11
+ <% } %>
@@ -0,0 +1,41 @@
1
+ export enum LocaleCategory {
2
+ ALL,
3
+ COLLATE,
4
+ CTYPE,
5
+ MESSAGES,
6
+ MONETARY,
7
+ NUMERIC,
8
+ TIME,
9
+ }
10
+ export function setlocale(category: number, locale: string | null): string
11
+ export function textdomain(domainname: string | null): string
12
+ export function bindtextdomain(domainname: string, dirname: string | null): string
13
+ export function gettext(msgid: string): string
14
+ export function dgettext(domainname: string | null, msgid: string): string
15
+ export function dcgettext(domainname: string | null, msgid: string, category: number): string
16
+ export function ngettext(msgid: string, msgid_plural: string, n: number): string
17
+ export function dngettext(domainname: string, msgid: string, msgid_plural: string, n: number): string
18
+ export function pgettext(context: string, msgid: string): string
19
+ export function dpgettext(dom: string | null, context: string, msgid: string): string
20
+ export function domain(domainName: string): {
21
+ gettext: (msgid: string) => string
22
+ ngettext: (msgid: string, msgid_plural: string, n: number) => string
23
+ pgettext: (context: string, msgid: string) => string
24
+ }
25
+
26
+ declare const Gettext: {
27
+ LocaleCategory: typeof LocaleCategory,
28
+ setlocale: typeof setlocale,
29
+ textdomain: typeof textdomain,
30
+ bindtextdomain: typeof bindtextdomain,
31
+ gettext: typeof gettext,
32
+ dgettext: typeof dgettext,
33
+ dcgettext: typeof dcgettext,
34
+ ngettext: typeof ngettext,
35
+ dngettext: typeof dngettext,
36
+ pgettext: typeof pgettext,
37
+ dpgettext: typeof dpgettext,
38
+ domain: typeof domain,
39
+ }
40
+
41
+ export default Gettext
@@ -0,0 +1,11 @@
1
+ <% if(moduleType === 'esm') { %>
2
+ import Gettext, { setlocale, textdomain, bindtextdomain, gettext, dgettext, dcgettext, ngettext, dngettext, pgettext, dpgettext, domain } from 'gettext';
3
+
4
+ export { setlocale, textdomain, bindtextdomain, gettext, dgettext, dcgettext, ngettext, dngettext, pgettext, dpgettext, domain }
5
+ export default Gettext;
6
+ <% } else { %>
7
+ const Gettext = imports.gettext;
8
+
9
+ module.exports = Gettext;
10
+ exports.default = Gettext;
11
+ <% } %>
@@ -82,7 +82,7 @@ export class DBusExportedObject {
82
82
  *
83
83
  * @example
84
84
  * ```js
85
- * import Gio from "gi://Gio";
85
+ * import Gio from "gi://Gio?version=2.0";
86
86
  *
87
87
  * Gio._promisify(Gio.InputStream.prototype, 'read_bytes_async', 'read_bytes_finish');
88
88
  *