@girs/giowin32-2.0 2.0.0-4.0.0-rc.1

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 ADDED
@@ -0,0 +1,85 @@
1
+
2
+ # GioWin32-2.0
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/giowin32-2.0)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/giowin32-2.0)
6
+
7
+
8
+ GJS TypeScript type definitions for GioWin32-2.0, generated from library version 2.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-rc.1.
9
+
10
+ ## Install
11
+
12
+ To use this type definitions, install them with NPM:
13
+ ```bash
14
+ npm install @girs/giowin32-2.0
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ You can import this package into your project like this:
20
+ ```ts
21
+ import GioWin32 from '@girs/giowin32-2.0';
22
+ ```
23
+
24
+ ### Ambient Modules
25
+
26
+ 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.
27
+ For this you need to include `@girs/giowin32-2.0` or `@girs/giowin32-2.0/ambient` in your `tsconfig` or entry point Typescript file:
28
+
29
+ `index.ts`:
30
+ ```ts
31
+ import '@girs/giowin32-2.0'
32
+ ```
33
+
34
+ `tsconfig.json`:
35
+ ```json
36
+ {
37
+ "compilerOptions": {
38
+ ...
39
+ },
40
+ "include": ["@girs/giowin32-2.0"],
41
+ ...
42
+ }
43
+ ```
44
+
45
+ Now you can import the ambient module with TypeScript support:
46
+
47
+ ```ts
48
+ import GioWin32 from 'gi://GioWin32?version=2.0';
49
+ ```
50
+
51
+ ### Global import
52
+
53
+ You can also import the module with Typescript support using the global `imports.gi` object of GJS.
54
+ For this you need to include `@girs/giowin32-2.0` or `@girs/giowin32-2.0/import` in your `tsconfig` or entry point Typescript file:
55
+
56
+ `index.ts`:
57
+ ```ts
58
+ import '@girs/giowin32-2.0'
59
+ ```
60
+
61
+ `tsconfig.json`:
62
+ ```json
63
+ {
64
+ "compilerOptions": {
65
+ ...
66
+ },
67
+ "include": ["@girs/giowin32-2.0"],
68
+ ...
69
+ }
70
+ ```
71
+
72
+ Now you have also type support for this, too:
73
+
74
+ ```ts
75
+ const GioWin32 = imports.gi.GioWin32;
76
+ ```
77
+
78
+ ### Bundle
79
+
80
+ 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).
81
+
82
+ ## Other packages
83
+
84
+ All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
85
+
@@ -0,0 +1,9 @@
1
+ declare module 'gi://GioWin32?version=2.0' {
2
+ import GioWin3220 from '@girs/giowin32-2.0';
3
+ export default GioWin3220;
4
+ }
5
+
6
+ declare module 'gi://GioWin32' {
7
+ import GioWin3220 from 'gi://GioWin32?version=2.0';
8
+ export default GioWin3220;
9
+ }
@@ -0,0 +1,2 @@
1
+ export {}
2
+
@@ -0,0 +1,9 @@
1
+ import type GioWin3220 from '@girs/giowin32-2.0';
2
+
3
+ declare global {
4
+ export interface GjsGiImports {
5
+ GioWin32: typeof GioWin3220;
6
+ }
7
+ }
8
+
9
+ export default GjsGiImports;
@@ -0,0 +1,3 @@
1
+ const gi = globalThis.imports?.gi || {};
2
+ export default gi;
3
+
@@ -0,0 +1,312 @@
1
+ /**
2
+ * Type Definitions for Gjs (https://gjs.guide/)
3
+ *
4
+ * These type definitions are automatically generated, do not edit them by hand.
5
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
6
+ *
7
+ * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
8
+ */
9
+
10
+ import '@girs/gjs';
11
+
12
+ // Module dependencies
13
+ import type Gio from '@girs/gio-2.0';
14
+ import type GObject from '@girs/gobject-2.0';
15
+ import type GLib from '@girs/glib-2.0';
16
+ import type GModule from '@girs/gmodule-2.0';
17
+
18
+ export namespace GioWin32 {
19
+ /**
20
+ * GioWin32-2.0
21
+ */
22
+
23
+ /**
24
+ * If `registry_key` is `null` then the default path
25
+ * `HKEY_CURRENT_USER\Software\GSettings` is used.
26
+ * @param registry_key the path to the registry key where settings are stored, or `null`.
27
+ * @returns a registry-backed {@link Gio.SettingsBackend}
28
+ * @since 2.78
29
+ */
30
+ function registry_settings_backend_new(registry_key?: string | null): Gio.SettingsBackend;
31
+ namespace InputStream {
32
+ // Signal signatures
33
+ interface SignalSignatures extends Gio.InputStream.SignalSignatures {
34
+ 'notify::close-handle': (pspec: GObject.ParamSpec) => void;
35
+ 'notify::handle': (pspec: GObject.ParamSpec) => void;
36
+ }
37
+
38
+ // Constructor properties interface
39
+
40
+ interface ConstructorProps extends Gio.InputStream.ConstructorProps {
41
+ close_handle: boolean;
42
+ closeHandle: boolean;
43
+ handle: any;
44
+ }
45
+ }
46
+
47
+ /**
48
+ * {@link GioWin32.InputStream} implements {@link Gio.InputStream} for reading from a
49
+ * Windows file handle.
50
+ *
51
+ * Note that `<gio/gwin32inputstream.h>` belongs to the Windows-specific GIO
52
+ * interfaces, thus you have to use the `gio-windows-2.0.pc` pkg-config file
53
+ * when using it.
54
+ * @gir-type Class
55
+ */
56
+ class InputStream extends Gio.InputStream {
57
+ static $gtype: GObject.GType<InputStream>;
58
+
59
+ // Properties
60
+
61
+ /**
62
+ * Whether to close the file handle when the stream is closed.
63
+ * @since 2.26
64
+ */
65
+ get close_handle(): boolean;
66
+ set close_handle(val: boolean);
67
+ /**
68
+ * Whether to close the file handle when the stream is closed.
69
+ * @since 2.26
70
+ */
71
+ get closeHandle(): boolean;
72
+ set closeHandle(val: boolean);
73
+ /**
74
+ * The handle that the stream reads from.
75
+ * @since 2.26
76
+ * @construct-only
77
+ */
78
+ get handle(): any;
79
+
80
+ /**
81
+ * Compile-time signal type information.
82
+ *
83
+ * This instance property is generated only for TypeScript type checking.
84
+ * It is not defined at runtime and should not be accessed in JS code.
85
+ * @internal
86
+ */
87
+ $signals: InputStream.SignalSignatures;
88
+
89
+ // Constructors
90
+
91
+ constructor(properties?: Partial<InputStream.ConstructorProps>, ...args: any[]);
92
+
93
+ _init(...args: any[]): void;
94
+
95
+ static ['new'](handle: any | null, close_handle: boolean): InputStream;
96
+
97
+ // Signals
98
+
99
+ /** @signal */
100
+ connect<K extends keyof InputStream.SignalSignatures>(
101
+ signal: K,
102
+ callback: GObject.SignalCallback<this, InputStream.SignalSignatures[K]>,
103
+ ): number;
104
+ connect(signal: string, callback: (...args: any[]) => any): number;
105
+ /** @signal */
106
+ connect_after<K extends keyof InputStream.SignalSignatures>(
107
+ signal: K,
108
+ callback: GObject.SignalCallback<this, InputStream.SignalSignatures[K]>,
109
+ ): number;
110
+ connect_after(signal: string, callback: (...args: any[]) => any): number;
111
+ /** @signal */
112
+ emit<K extends keyof InputStream.SignalSignatures>(
113
+ signal: K,
114
+ ...args: GObject.GjsParameters<InputStream.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
115
+ ): void;
116
+ emit(signal: string, ...args: any[]): void;
117
+
118
+ // Methods
119
+
120
+ /**
121
+ * Returns whether the handle of `stream` will be
122
+ * closed when the stream is closed.
123
+ * @returns `true` if the handle is closed when done
124
+ */
125
+ get_close_handle(): boolean;
126
+ /**
127
+ * Return the Windows file handle that the stream reads from.
128
+ * @returns The file handle of `stream`
129
+ */
130
+ get_handle(): any | null;
131
+ /**
132
+ * Sets whether the handle of `stream` shall be closed
133
+ * when the stream is closed.
134
+ * @param close_handle `true` to close the handle when done
135
+ */
136
+ set_close_handle(close_handle: boolean): void;
137
+ }
138
+
139
+ namespace OutputStream {
140
+ // Signal signatures
141
+ interface SignalSignatures extends Gio.OutputStream.SignalSignatures {
142
+ 'notify::close-handle': (pspec: GObject.ParamSpec) => void;
143
+ 'notify::handle': (pspec: GObject.ParamSpec) => void;
144
+ }
145
+
146
+ // Constructor properties interface
147
+
148
+ interface ConstructorProps extends Gio.OutputStream.ConstructorProps {
149
+ close_handle: boolean;
150
+ closeHandle: boolean;
151
+ handle: any;
152
+ }
153
+ }
154
+
155
+ /**
156
+ * {@link GioWin32.OutputStream} implements {@link Gio.OutputStream} for writing to a
157
+ * Windows file handle.
158
+ *
159
+ * Note that `<gio/gwin32outputstream.h>` belongs to the Windows-specific GIO
160
+ * interfaces, thus you have to use the `gio-windows-2.0.pc` pkg-config file
161
+ * when using it.
162
+ * @gir-type Class
163
+ */
164
+ class OutputStream extends Gio.OutputStream {
165
+ static $gtype: GObject.GType<OutputStream>;
166
+
167
+ // Properties
168
+
169
+ /**
170
+ * Whether to close the file handle when the stream is closed.
171
+ * @since 2.26
172
+ */
173
+ get close_handle(): boolean;
174
+ set close_handle(val: boolean);
175
+ /**
176
+ * Whether to close the file handle when the stream is closed.
177
+ * @since 2.26
178
+ */
179
+ get closeHandle(): boolean;
180
+ set closeHandle(val: boolean);
181
+ /**
182
+ * The file handle that the stream writes to.
183
+ * @since 2.26
184
+ * @construct-only
185
+ */
186
+ get handle(): any;
187
+
188
+ /**
189
+ * Compile-time signal type information.
190
+ *
191
+ * This instance property is generated only for TypeScript type checking.
192
+ * It is not defined at runtime and should not be accessed in JS code.
193
+ * @internal
194
+ */
195
+ $signals: OutputStream.SignalSignatures;
196
+
197
+ // Constructors
198
+
199
+ constructor(properties?: Partial<OutputStream.ConstructorProps>, ...args: any[]);
200
+
201
+ _init(...args: any[]): void;
202
+
203
+ static ['new'](handle: any | null, close_handle: boolean): OutputStream;
204
+
205
+ // Signals
206
+
207
+ /** @signal */
208
+ connect<K extends keyof OutputStream.SignalSignatures>(
209
+ signal: K,
210
+ callback: GObject.SignalCallback<this, OutputStream.SignalSignatures[K]>,
211
+ ): number;
212
+ connect(signal: string, callback: (...args: any[]) => any): number;
213
+ /** @signal */
214
+ connect_after<K extends keyof OutputStream.SignalSignatures>(
215
+ signal: K,
216
+ callback: GObject.SignalCallback<this, OutputStream.SignalSignatures[K]>,
217
+ ): number;
218
+ connect_after(signal: string, callback: (...args: any[]) => any): number;
219
+ /** @signal */
220
+ emit<K extends keyof OutputStream.SignalSignatures>(
221
+ signal: K,
222
+ ...args: GObject.GjsParameters<OutputStream.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
223
+ ): void;
224
+ emit(signal: string, ...args: any[]): void;
225
+
226
+ // Methods
227
+
228
+ /**
229
+ * Returns whether the handle of `stream` will be closed when the
230
+ * stream is closed.
231
+ * @returns `true` if the handle is closed when done
232
+ */
233
+ get_close_handle(): boolean;
234
+ /**
235
+ * Return the Windows handle that the stream writes to.
236
+ * @returns The handle descriptor of `stream`
237
+ */
238
+ get_handle(): any | null;
239
+ /**
240
+ * Sets whether the handle of `stream` shall be closed when the stream
241
+ * is closed.
242
+ * @param close_handle `true` to close the handle when done
243
+ */
244
+ set_close_handle(close_handle: boolean): void;
245
+ }
246
+
247
+ /**
248
+ * @gir-type Alias
249
+ */
250
+ type InputStreamClass = typeof InputStream;
251
+ /**
252
+ * @gir-type Struct
253
+ */
254
+ abstract class InputStreamPrivate {
255
+ static $gtype: GObject.GType<InputStreamPrivate>;
256
+ }
257
+
258
+ /**
259
+ * @gir-type Struct
260
+ */
261
+ class NetworkMonitor {
262
+ static $gtype: GObject.GType<NetworkMonitor>;
263
+ }
264
+
265
+ /**
266
+ * @gir-type Struct
267
+ */
268
+ class NetworkMonitorClass {
269
+ static $gtype: GObject.GType<NetworkMonitorClass>;
270
+
271
+ // Constructors
272
+
273
+ constructor(
274
+ properties?: Partial<{
275
+ parent_class: any;
276
+ }>,
277
+ );
278
+ }
279
+
280
+ /**
281
+ * @gir-type Struct
282
+ */
283
+ abstract class NetworkMonitorPrivate {
284
+ static $gtype: GObject.GType<NetworkMonitorPrivate>;
285
+ }
286
+
287
+ /**
288
+ * @gir-type Alias
289
+ */
290
+ type OutputStreamClass = typeof OutputStream;
291
+ /**
292
+ * @gir-type Struct
293
+ */
294
+ abstract class OutputStreamPrivate {
295
+ static $gtype: GObject.GType<OutputStreamPrivate>;
296
+ }
297
+
298
+ /**
299
+ * Name of the imported GIR library
300
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
301
+ */
302
+ const __name__: string;
303
+ /**
304
+ * Version of the imported GIR library
305
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
306
+ */
307
+ const __version__: string;
308
+ }
309
+
310
+ export default GioWin32;
311
+
312
+ // END
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import GioWin32 from 'gi://GioWin32?version=2.0';
4
+ export default GioWin32;
5
+
package/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Type Definitions for Gjs (https://gjs.guide/)
3
+ *
4
+ * These type definitions are automatically generated, do not edit them by hand.
5
+ * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
6
+ *
7
+ * This template is used to generate the index.d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
8
+ */
9
+
10
+ import './giowin32-2.0-ambient.d.ts';
11
+
12
+ import './giowin32-2.0-import.d.ts';
13
+
14
+ import GioWin32 from './giowin32-2.0.js';
15
+ export default GioWin32;
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import GioWin32 from './giowin32-2.0.js';
4
+ export default GioWin32;
5
+
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@girs/giowin32-2.0",
3
+ "version": "2.0.0-4.0.0-rc.1",
4
+ "description": "GJS TypeScript type definitions for GioWin32-2.0, generated from library version 2.0.0",
5
+ "type": "module",
6
+ "module": "giowin32-2.0.js",
7
+ "main": "giowin32-2.0.js",
8
+ "exports": {
9
+ "./ambient": {
10
+ "types": "./giowin32-2.0-ambient.d.ts",
11
+ "import": "./giowin32-2.0-ambient.js",
12
+ "default": "./giowin32-2.0-ambient.js"
13
+ },
14
+ "./import": {
15
+ "types": "./giowin32-2.0-import.d.ts",
16
+ "import": "./giowin32-2.0-import.js",
17
+ "default": "./giowin32-2.0-import.js"
18
+ },
19
+ "./giowin32-2.0": {
20
+ "types": "./giowin32-2.0.d.ts",
21
+ "import": "./giowin32-2.0.js",
22
+ "default": "./giowin32-2.0.js"
23
+ },
24
+ ".": {
25
+ "types": "./index.d.ts",
26
+ "import": "./index.js",
27
+ "default": "./index.js"
28
+ }
29
+ },
30
+ "scripts": {
31
+ "test": "tsc --project tsconfig.json"
32
+ },
33
+ "dependencies": {
34
+ "@girs/gjs": "4.0.0-rc.1",
35
+ "@girs/gio-2.0": "2.88.0-4.0.0-rc.1",
36
+ "@girs/gobject-2.0": "2.88.0-4.0.0-rc.1",
37
+ "@girs/glib-2.0": "2.88.0-4.0.0-rc.1",
38
+ "@girs/gmodule-2.0": "2.0.0-4.0.0-rc.1" },
39
+ "devDependencies": {
40
+ "typescript": "*"
41
+ },
42
+ "keywords": ["Gir", "TypeScript", "types", "GObject-Introspection", "GJS", "GioWin32-2.0"],
43
+ "author": "ts-for-gir",
44
+ "license": "MIT",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/gjsify/types.git"
48
+ },
49
+ "bugs": {
50
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
51
+ },
52
+ "homepage": "https://github.com/gjsify/types/tree/main/giowin32-2.0#readme"
53
+ }
54
+
55
+
package/tsconfig.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "compilerOptions": {
3
+ // General settings for code interpretation
4
+ "target": "ESNext",
5
+ "module": "NodeNext",
6
+ "lib": ["ESNext"],
7
+ "types": [],
8
+ "experimentalDecorators": true,
9
+ "moduleResolution": "NodeNext",
10
+ "noEmit": true,
11
+ "noEmitOnError": false,
12
+ "baseUrl": "./",
13
+ "rootDir": ".",
14
+ // General settings for code generation
15
+ "removeComments": false,
16
+ "inlineSourceMap": false,
17
+ "inlineSources": false,
18
+ "newLine": "LF",
19
+ // Show diagnostics
20
+ "diagnostics": true,
21
+ "paths": {
22
+ "@girs/gio-2.0": [
23
+ "../gio-2.0/index.d.ts"
24
+ ],
25
+ "@girs/gobject-2.0": [
26
+ "../gobject-2.0/index.d.ts"
27
+ ],
28
+ "@girs/glib-2.0": [
29
+ "../glib-2.0/index.d.ts"
30
+ ],
31
+ "@girs/gmodule-2.0": [
32
+ "../gmodule-2.0/index.d.ts"
33
+ ],
34
+ "@girs/gjs": [
35
+ "../gjs/index.d.ts"
36
+ ]
37
+ }
38
+ },
39
+ "include": ["./giowin32-2.0.d.ts"]
40
+ }
41
+
42
+
package/typedoc.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "entryPoints": ["./giowin32-2.0.d.ts"],
3
+ "readme": "./README.md",
4
+ "name": "GioWin32-2.0",
5
+ "tsconfig": "./tsconfig.json",
6
+ "skipErrorChecking": true,
7
+ "highlightLanguages": ["typescript", "javascript", "c", "cpp", "xml", "bash", "json", "css"]
8
+ }
9
+