@girs/gjs 4.0.0-beta.2 → 4.0.0-beta.21
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 +1 -1
- package/cairo.d.ts +485 -3
- package/console.d.ts +21 -0
- package/console.js +6 -0
- package/dom.d.ts +51 -63
- package/gettext.d.ts +28 -29
- package/gjs-ambient.d.ts +25 -0
- package/gjs.d.ts +251 -93
- package/index.d.ts +13 -0
- package/index.js +5 -0
- package/package.json +20 -8
- package/system.d.ts +31 -32
- package/tsconfig.json +5 -3
- package/ambient.d.ts +0 -20
- /package/{ambient.js → gjs-ambient.js} +0 -0
package/gjs.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
2
|
* Type Definitions for Gjs (https://gjs.guide/)
|
|
3
3
|
*
|
|
4
4
|
* These type definitions are automatically generated, do not edit them by hand.
|
|
5
5
|
* If you found a bug fix it in ts-for-gir itself or create a bug report on https://github.com/gjsify/ts-for-gir
|
|
6
6
|
*/
|
|
7
|
-
import './ambient.d.ts';
|
|
8
7
|
|
|
9
8
|
import type GObject from '@girs/gobject-2.0';
|
|
10
9
|
import type GLib from '@girs/glib-2.0';
|
|
10
|
+
|
|
11
11
|
import gettext from './gettext.js';
|
|
12
12
|
import system from './system.js';
|
|
13
13
|
import cairo from './cairo.js';
|
|
@@ -20,73 +20,208 @@ declare namespace package {
|
|
|
20
20
|
* and all the other have their values derived from them.
|
|
21
21
|
*/
|
|
22
22
|
interface PackageInitParams {
|
|
23
|
-
name
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
/** The base name of the entry point (eg. org.foo.Bar.App) */
|
|
24
|
+
name: string;
|
|
25
|
+
/** The version of the package */
|
|
26
|
+
version: string;
|
|
27
|
+
/** The prefix of the package */
|
|
28
|
+
prefix: string;
|
|
29
|
+
/**
|
|
30
|
+
* The final datadir and libdir when installed;
|
|
31
|
+
* usually, these would be prefix + '/share' and
|
|
32
|
+
* and prefix + '/lib' (or '/lib64')
|
|
33
|
+
*/
|
|
34
|
+
libdir: string;
|
|
35
|
+
/**
|
|
36
|
+
* The final datadir and libdir when installed;
|
|
37
|
+
* usually, these would be prefix + '/share' and
|
|
38
|
+
* and prefix + '/lib' (or '/lib64')
|
|
39
|
+
*/
|
|
40
|
+
datadir?: string;
|
|
27
41
|
}
|
|
28
42
|
|
|
29
|
-
|
|
30
|
-
export const
|
|
31
|
-
|
|
32
|
-
export const
|
|
33
|
-
|
|
34
|
-
export const
|
|
35
|
-
|
|
36
|
-
export const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export
|
|
41
|
-
/**
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
/** The base name of the entry point (eg. org.foo.Bar.App) */
|
|
44
|
+
export const name: string | undefined;
|
|
45
|
+
/** The version of the package */
|
|
46
|
+
export const version: string | undefined;
|
|
47
|
+
/** The prefix of the package */
|
|
48
|
+
export const prefix: string | undefined;
|
|
49
|
+
/** The final datadir when installed; usually, these would be prefix + '/share' */
|
|
50
|
+
export const datadir: string | undefined;
|
|
51
|
+
/** The final libdir when installed; usually, these would be prefix + '/lib' (or '/lib64') */
|
|
52
|
+
export const libdir: string | undefined;
|
|
53
|
+
/** The final pkgdatadir when installed; usually, this would be prefix + '/share' */
|
|
54
|
+
export const pkgdatadir: string | undefined;
|
|
55
|
+
/** The final pkglibdir when installed; usually, this would be prefix + '/lib' (or '/lib64') */
|
|
56
|
+
export const pkglibdir: string | undefined;
|
|
57
|
+
/** The final moduledir when installed; usually, this would be prefix + '/lib' (or '/lib64') */
|
|
58
|
+
export const moduledir: string | undefined;
|
|
59
|
+
/** The directory containing gettext translation files; this will be datadir + '/locale' when installed and './po' in the source tree */
|
|
60
|
+
export const localedir: string | undefined;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Initialize directories and global variables. Must be called
|
|
64
|
+
* before any of other API in Package is used.
|
|
65
|
+
* `params` must be an object with at least the following keys:
|
|
66
|
+
* - name: the package name ($(PACKAGE_NAME) in autotools,
|
|
67
|
+
* eg. org.foo.Bar)
|
|
68
|
+
* - version: the package version
|
|
69
|
+
* - prefix: the installation prefix
|
|
70
|
+
*
|
|
71
|
+
* init() will take care to check if the program is running from
|
|
72
|
+
* the source directory or not, by looking for a 'src' directory.
|
|
73
|
+
*
|
|
74
|
+
* At the end, the global variable 'pkg' will contain the
|
|
75
|
+
* Package module (imports.package). Additionally, the following
|
|
76
|
+
* module variables will be available:
|
|
77
|
+
* - name: the base name of the entry point (eg. org.foo.Bar.App)
|
|
78
|
+
* - version: same as in @params
|
|
79
|
+
* - prefix: the installation prefix (as passed in @params)
|
|
80
|
+
* - datadir, libdir: the final datadir and libdir when installed;
|
|
81
|
+
* usually, these would be prefix + '/share' and
|
|
82
|
+
* and prefix + '/lib' (or '/lib64')
|
|
83
|
+
* - pkgdatadir: the directory to look for private data files, such as
|
|
84
|
+
* images, stylesheets and UI definitions;
|
|
85
|
+
* this will be datadir + name when installed and
|
|
86
|
+
* './data' when running from the source tree
|
|
87
|
+
* - pkglibdir: the directory to look for private typelibs and C
|
|
88
|
+
* libraries;
|
|
89
|
+
* this will be libdir + name when installed and
|
|
90
|
+
* './lib' when running from the source tree
|
|
91
|
+
* - moduledir: the directory to look for JS modules;
|
|
92
|
+
* this will be pkglibdir when installed and
|
|
93
|
+
* './src' when running from the source tree
|
|
94
|
+
* - localedir: the directory containing gettext translation files;
|
|
95
|
+
* this will be datadir + '/locale' when installed
|
|
96
|
+
* and './po' in the source tree
|
|
97
|
+
*
|
|
98
|
+
* All paths are absolute and will not end with '/'.
|
|
99
|
+
*
|
|
100
|
+
* As a side effect, init() calls GLib.set_prgname().
|
|
101
|
+
*
|
|
102
|
+
* @param {object} params package parameters
|
|
103
|
+
*/
|
|
104
|
+
export function init(params: PackageInitParams): void;
|
|
105
|
+
/**
|
|
106
|
+
* This is the function to use if you want to have multiple
|
|
107
|
+
* entry points in one package.
|
|
108
|
+
* You must define a main(ARGV) function inside the passed
|
|
109
|
+
* in module, and then the launcher would be
|
|
110
|
+
*
|
|
111
|
+
* imports.package.init(...);
|
|
112
|
+
* imports.package.run(imports.entrypoint);
|
|
113
|
+
*
|
|
114
|
+
* @param module the module to run
|
|
115
|
+
* @returns the exit code of the module's main() function
|
|
116
|
+
*/
|
|
117
|
+
export function run(module: { main: (argv: string[]) => void }): number | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* This is a convenience function if your package has a
|
|
120
|
+
* single entry point.
|
|
121
|
+
* You must define a main(ARGV) function inside a main.js
|
|
122
|
+
* module in moduledir.
|
|
123
|
+
*
|
|
124
|
+
* @param params see init()
|
|
125
|
+
*/
|
|
126
|
+
export function start(params: PackageInitParams): void;
|
|
127
|
+
/**
|
|
128
|
+
* Mark a dependency on a specific version of one or more
|
|
129
|
+
* external GI typelibs.
|
|
130
|
+
* `libs` must be an object whose keys are a typelib name,
|
|
131
|
+
* and values are the respective version. The empty string
|
|
132
|
+
* indicates any version.
|
|
133
|
+
* @param deps The external dependencies to import
|
|
134
|
+
*/
|
|
135
|
+
export function require(deps: Record<string, string>): void;
|
|
136
|
+
/**
|
|
137
|
+
* As checkSymbol(), but exit with an error if the
|
|
138
|
+
* dependency cannot be satisfied.
|
|
139
|
+
*
|
|
140
|
+
* @param lib an external dependency to import
|
|
141
|
+
* @param ver version of the dependency
|
|
142
|
+
* @param symbol symbol to check for
|
|
143
|
+
*/
|
|
144
|
+
export function requireSymbol(lib: string, ver?: string, symbol?: string): void;
|
|
145
|
+
/**
|
|
146
|
+
* Check whether an external GI typelib can be imported
|
|
147
|
+
* and provides @symbol.
|
|
148
|
+
*
|
|
149
|
+
* Symbols may refer to
|
|
150
|
+
* - global functions ('main_quit')
|
|
151
|
+
* - classes ('Window')
|
|
152
|
+
* - class / instance methods ('IconTheme.get_default' / 'IconTheme.has_icon')
|
|
153
|
+
* - GObject properties ('Window.default_height')
|
|
154
|
+
*
|
|
155
|
+
* @param lib an external dependency to import
|
|
156
|
+
* @param ver version of the dependency
|
|
157
|
+
* @param symbol symbol to check for
|
|
158
|
+
* @returns true if `lib` can be imported and provides `symbol`, false
|
|
159
|
+
* otherwise
|
|
160
|
+
*/
|
|
161
|
+
export function checkSymbol(lib: string, ver: string, symbol: string): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Initialize `gettext`.
|
|
164
|
+
* After calling this method `globalThis._`, `globalThis.C_` and `globalThis.N_` will be available.
|
|
165
|
+
*/
|
|
166
|
+
export function initGettext(): void;
|
|
167
|
+
/**
|
|
168
|
+
* @deprecated Use JS string interpolation
|
|
169
|
+
*/
|
|
170
|
+
export function initFormat(): void;
|
|
171
|
+
/**
|
|
172
|
+
* As checkSymbol(), but exit with an error if the
|
|
173
|
+
* dependency cannot be satisfied.
|
|
174
|
+
*
|
|
175
|
+
* @param lib an external dependency to import
|
|
176
|
+
* @param ver version of the dependency
|
|
177
|
+
* @param symbol symbol to check for
|
|
178
|
+
*/
|
|
179
|
+
export function initSubmodule(lib: string, ver?: string, symbol?: string): void;
|
|
180
|
+
/**
|
|
181
|
+
* Load and register a GResource named @name. @name is optional and defaults to ${package-name}
|
|
182
|
+
* @param name The name of the GResource to load
|
|
183
|
+
*/
|
|
184
|
+
export function loadResource(name?: string): void;
|
|
50
185
|
}
|
|
51
186
|
|
|
52
187
|
declare namespace byteArray {
|
|
53
188
|
export class ByteArray {
|
|
54
|
-
static get(target: any, property: string, receiver: any): any
|
|
55
|
-
static set(target: any, property: string, value: any, receiver: any): boolean
|
|
189
|
+
static get(target: any, property: string, receiver: any): any;
|
|
190
|
+
static set(target: any, property: string, value: any, receiver: any): boolean;
|
|
56
191
|
|
|
57
|
-
length: number
|
|
58
|
-
protected _array: Uint8Array
|
|
192
|
+
length: number;
|
|
193
|
+
protected _array: Uint8Array;
|
|
59
194
|
|
|
60
|
-
constructor(x: Uint8Array | number)
|
|
61
|
-
toString(encoding?: TextDecoderEncoding): string
|
|
62
|
-
fromString(input: string, encoding?: TextDecoderEncoding): ByteArray
|
|
63
|
-
toGBytes(): GLib.Bytes
|
|
195
|
+
constructor(x: Uint8Array | number);
|
|
196
|
+
toString(encoding?: TextDecoderEncoding): string;
|
|
197
|
+
fromString(input: string, encoding?: TextDecoderEncoding): ByteArray;
|
|
198
|
+
toGBytes(): GLib.Bytes;
|
|
64
199
|
}
|
|
65
200
|
|
|
66
201
|
/** @deprecated Use {@link TextEncoder.encode} instead */
|
|
67
|
-
export function fromString(input: string, encoding?: TextDecoderEncoding): Uint8Array
|
|
202
|
+
export function fromString(input: string, encoding?: TextDecoderEncoding): Uint8Array;
|
|
68
203
|
|
|
69
204
|
/** @deprecated Use {@link GLib.Bytes.toArray} instead */
|
|
70
|
-
export function fromGBytes(input: GLib.Bytes): Uint8Array
|
|
205
|
+
export function fromGBytes(input: GLib.Bytes): Uint8Array;
|
|
71
206
|
|
|
72
207
|
/** @deprecated Use {@link TextDecoder.decode} instead */
|
|
73
|
-
export function toString(x: Uint8Array, encoding?: TextDecoderEncoding): string
|
|
208
|
+
export function toString(x: Uint8Array, encoding?: TextDecoderEncoding): string;
|
|
74
209
|
|
|
75
210
|
/** @deprecated Use {@link GLib.Bytes new GLib.Bytes() } instead */
|
|
76
|
-
export function toGBytes(x: Uint8Array): GLib.Bytes
|
|
211
|
+
export function toGBytes(x: Uint8Array): GLib.Bytes;
|
|
77
212
|
|
|
78
213
|
/** @deprecated Use {@link ByteArray new ByteArray()} instead */
|
|
79
|
-
export function fromArray(array: Iterable<number>): ByteArray
|
|
214
|
+
export function fromArray(array: Iterable<number>): ByteArray;
|
|
80
215
|
}
|
|
81
216
|
|
|
82
217
|
declare namespace lang {
|
|
83
218
|
// TODO: There is a lot more in Lang
|
|
84
|
-
export function Class(props: any): void
|
|
219
|
+
export function Class(props: any): void;
|
|
85
220
|
}
|
|
86
221
|
|
|
87
222
|
declare namespace format {
|
|
88
|
-
export function vprintf(str: string, args: string[]): string
|
|
89
|
-
export function printf(fmt: string, ...args: any[]): void
|
|
223
|
+
export function vprintf(str: string, args: string[]): string;
|
|
224
|
+
export function printf(fmt: string, ...args: any[]): void;
|
|
90
225
|
// Following docs from gjs/modules/format.js
|
|
91
226
|
/**
|
|
92
227
|
* This function is intended to extend the String object and provide
|
|
@@ -99,19 +234,19 @@ declare namespace format {
|
|
|
99
234
|
* field width, e.g. "%5s".format("foo"). Unless the width is prefixed
|
|
100
235
|
* with '0', the formatted string will be padded with spaces.
|
|
101
236
|
*/
|
|
102
|
-
export function format(fmt: string, ...args: any[]): string
|
|
237
|
+
export function format(fmt: string, ...args: any[]): string;
|
|
103
238
|
}
|
|
104
239
|
|
|
105
240
|
declare namespace mainloop {
|
|
106
|
-
export function quit(name: string): void
|
|
107
|
-
export function idle_source(handler: any, priority?: number): any
|
|
108
|
-
export function idle_add(handler: any, priority?: number): any
|
|
109
|
-
export function timeout_source(timeout: any, handler: any, priority?: number): any
|
|
110
|
-
export function timeout_seconds_source(timeout: any, handler: any, priority?: number): any
|
|
111
|
-
export function timeout_add(timeout: any, handler: any, priority?: number): any
|
|
112
|
-
export function timeout_add_seconds(timeout: any, handler: any, priority?: number): any
|
|
113
|
-
export function source_remove(id: any): any
|
|
114
|
-
export function run(name: string): void
|
|
241
|
+
export function quit(name: string): void;
|
|
242
|
+
export function idle_source(handler: any, priority?: number): any;
|
|
243
|
+
export function idle_add(handler: any, priority?: number): any;
|
|
244
|
+
export function timeout_source(timeout: any, handler: any, priority?: number): any;
|
|
245
|
+
export function timeout_seconds_source(timeout: any, handler: any, priority?: number): any;
|
|
246
|
+
export function timeout_add(timeout: any, handler: any, priority?: number): any;
|
|
247
|
+
export function timeout_add_seconds(timeout: any, handler: any, priority?: number): any;
|
|
248
|
+
export function source_remove(id: any): any;
|
|
249
|
+
export function run(name: string): void;
|
|
115
250
|
}
|
|
116
251
|
|
|
117
252
|
/**
|
|
@@ -121,15 +256,15 @@ declare namespace mainloop {
|
|
|
121
256
|
* @example
|
|
122
257
|
* ```ts
|
|
123
258
|
* const Signals = imports.signals;
|
|
124
|
-
*
|
|
259
|
+
*
|
|
125
260
|
* // Define an interface with the same name of your class to make the methods known
|
|
126
261
|
* interface Events extends Signals.Methods {}
|
|
127
|
-
*
|
|
262
|
+
*
|
|
128
263
|
* class Events {}
|
|
129
264
|
* Signals.addSignalMethods(Events.prototype);
|
|
130
|
-
*
|
|
265
|
+
*
|
|
131
266
|
* const events = new Events();
|
|
132
|
-
*
|
|
267
|
+
*
|
|
133
268
|
* // Typescript will not complain here
|
|
134
269
|
* events.emit("test-signal", "test argument");
|
|
135
270
|
* ```
|
|
@@ -138,13 +273,13 @@ export interface SignalMethods {
|
|
|
138
273
|
/**
|
|
139
274
|
* Connects a callback to a signal for an object. Pass the returned ID to
|
|
140
275
|
* `disconnect()` to remove the handler.
|
|
141
|
-
*
|
|
276
|
+
*
|
|
142
277
|
* If `callback` returns `true`, emission will stop and no other handlers will be
|
|
143
278
|
* invoked.
|
|
144
|
-
*
|
|
279
|
+
*
|
|
145
280
|
* > Warning: Unlike GObject signals, `this` within a signal callback will always
|
|
146
281
|
* > refer to the global object (ie. `globalThis`).
|
|
147
|
-
*
|
|
282
|
+
*
|
|
148
283
|
* @param sigName A signal name
|
|
149
284
|
* @param callback A callback function
|
|
150
285
|
* @returns A handler ID
|
|
@@ -152,7 +287,7 @@ export interface SignalMethods {
|
|
|
152
287
|
connect(sigName: string, callback: (self: any, ...args: any[]) => void): number;
|
|
153
288
|
/**
|
|
154
289
|
* Emits a signal for an object. Emission stops if a signal handler returns `true`.
|
|
155
|
-
*
|
|
290
|
+
*
|
|
156
291
|
* Unlike GObject signals, it is not necessary to declare signals or define their
|
|
157
292
|
* signature. Simply call `emit()` with whatever signal name you wish, with
|
|
158
293
|
* whatever arguments you wish.
|
|
@@ -168,7 +303,7 @@ export interface SignalMethods {
|
|
|
168
303
|
/**
|
|
169
304
|
* Disconnects all signal handlers for an object.
|
|
170
305
|
*/
|
|
171
|
-
disconnectAll(): void
|
|
306
|
+
disconnectAll(): void;
|
|
172
307
|
/**
|
|
173
308
|
* Checks if a handler ID is connected.
|
|
174
309
|
* @param id The ID of the handler to be disconnected
|
|
@@ -182,7 +317,6 @@ declare namespace signals {
|
|
|
182
317
|
}
|
|
183
318
|
|
|
184
319
|
declare global {
|
|
185
|
-
|
|
186
320
|
// https://gitlab.gnome.org/GNOME/gjs/-/blob/1.73.2/modules/esm/_encoding/encodingMap.js#L7-232
|
|
187
321
|
type TextDecoderEncoding =
|
|
188
322
|
| 'unicode-1-1-utf-8'
|
|
@@ -404,56 +538,80 @@ declare global {
|
|
|
404
538
|
| 'unicode'
|
|
405
539
|
| 'unicodefeff'
|
|
406
540
|
| 'utf-16'
|
|
407
|
-
| 'utf-16le'
|
|
541
|
+
| 'utf-16le';
|
|
408
542
|
|
|
409
543
|
interface GjsGiImports {
|
|
410
544
|
// Will be extended by the import of more gir types
|
|
411
545
|
versions: {
|
|
412
|
-
[namespace: string]: string
|
|
413
|
-
}
|
|
546
|
+
[namespace: string]: string;
|
|
547
|
+
};
|
|
414
548
|
}
|
|
415
|
-
|
|
549
|
+
|
|
416
550
|
interface GjsImports {
|
|
417
|
-
gi: GjsGiImports
|
|
418
|
-
lang: typeof lang
|
|
419
|
-
system: typeof system
|
|
420
|
-
signals: typeof signals
|
|
421
|
-
package: typeof package
|
|
422
|
-
mainloop: typeof mainloop
|
|
423
|
-
searchPath: string[]
|
|
424
|
-
gettext: typeof gettext
|
|
425
|
-
byteArray: typeof byteArray
|
|
426
|
-
format: typeof format
|
|
427
|
-
cairo: typeof cairo
|
|
551
|
+
gi: GjsGiImports;
|
|
552
|
+
lang: typeof lang;
|
|
553
|
+
system: typeof system;
|
|
554
|
+
signals: typeof signals;
|
|
555
|
+
package: typeof package;
|
|
556
|
+
mainloop: typeof mainloop;
|
|
557
|
+
searchPath: string[];
|
|
558
|
+
gettext: typeof gettext;
|
|
559
|
+
byteArray: typeof byteArray;
|
|
560
|
+
format: typeof format;
|
|
561
|
+
cairo: typeof cairo;
|
|
428
562
|
}
|
|
429
563
|
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
564
|
+
// Overwrites, see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/script/package.js
|
|
565
|
+
/**
|
|
566
|
+
* Run `pkg.initGettext()` before using this.
|
|
567
|
+
* See {@link gettext.gettext}
|
|
568
|
+
*/
|
|
569
|
+
const _: undefined | typeof gettext.gettext;
|
|
570
|
+
/**
|
|
571
|
+
* Run `pkg.initGettext()` before using this.
|
|
572
|
+
* See {@link gettext.pgettext}
|
|
573
|
+
*/
|
|
574
|
+
const C_: undefined | typeof gettext.pgettext;
|
|
575
|
+
/**
|
|
576
|
+
* Run `pkg.initGettext()` before using this.
|
|
577
|
+
* Currently not implemented.
|
|
578
|
+
*/
|
|
579
|
+
const N_: undefined | ((x: string) => string);
|
|
580
|
+
|
|
581
|
+
function print(...args: any[]): void;
|
|
582
|
+
function printerr(...args: any[]): void;
|
|
583
|
+
function log(obj: object, others?: object[]): void;
|
|
584
|
+
function log(msg: string, substitutions?: any[]): void;
|
|
585
|
+
function logError(exception: object, message?: any): void;
|
|
586
|
+
function logError(message?: any): void;
|
|
435
587
|
|
|
436
|
-
const pkg: typeof package
|
|
588
|
+
const pkg: typeof package;
|
|
437
589
|
|
|
438
590
|
interface BooleanConstructor {
|
|
439
|
-
$gtype: GObject.GType<boolean
|
|
591
|
+
$gtype: GObject.GType<boolean>;
|
|
440
592
|
}
|
|
441
593
|
|
|
442
594
|
interface NumberConstructor {
|
|
443
|
-
$gtype: GObject.GType<number
|
|
595
|
+
$gtype: GObject.GType<number>;
|
|
444
596
|
}
|
|
445
597
|
|
|
446
598
|
interface StringConstructor {
|
|
447
|
-
$gtype: GObject.GType<string
|
|
599
|
+
$gtype: GObject.GType<string>;
|
|
448
600
|
}
|
|
449
601
|
|
|
450
|
-
|
|
602
|
+
interface StringConstructor {
|
|
603
|
+
$gtype: GObject.GType<string>;
|
|
604
|
+
}
|
|
451
605
|
|
|
452
|
-
|
|
453
|
-
|
|
606
|
+
interface ObjectConstructor {
|
|
607
|
+
$gtype: GObject.GType<Object>;
|
|
608
|
+
}
|
|
454
609
|
|
|
455
|
-
|
|
456
|
-
export default _imports
|
|
457
|
-
export { _imports as imports }
|
|
610
|
+
const imports: GjsImports;
|
|
458
611
|
|
|
612
|
+
const ARGV: string[];
|
|
613
|
+
}
|
|
459
614
|
|
|
615
|
+
declare const _imports: GjsImports;
|
|
616
|
+
export default _imports;
|
|
617
|
+
export { _imports as imports };
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
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 './gjs-ambient.d.ts';
|
|
11
|
+
|
|
12
|
+
import gjs from './gjs.js';
|
|
13
|
+
export default gjs;
|
package/index.js
ADDED
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/gjs",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.21",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Gjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "gjs.js",
|
|
7
7
|
"main": "gjs.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
"./ambient": {
|
|
10
|
-
"types": "./ambient.d.ts",
|
|
11
|
-
"import": "./ambient.js",
|
|
12
|
-
"default": "./ambient.js"
|
|
10
|
+
"types": "./gjs-ambient.d.ts",
|
|
11
|
+
"import": "./gjs-ambient.js",
|
|
12
|
+
"default": "./gjs-ambient.js"
|
|
13
13
|
},
|
|
14
14
|
"./dom": {
|
|
15
15
|
"types": "./dom.d.ts",
|
|
@@ -31,18 +31,30 @@
|
|
|
31
31
|
"import": "./cairo.js",
|
|
32
32
|
"default": "./cairo.js"
|
|
33
33
|
},
|
|
34
|
-
"
|
|
34
|
+
"./console": {
|
|
35
|
+
"types": "./console.d.ts",
|
|
36
|
+
"import": "./console.js",
|
|
37
|
+
"default": "./console.js"
|
|
38
|
+
},
|
|
39
|
+
"./gjs": {
|
|
35
40
|
"types": "./gjs.d.ts",
|
|
36
41
|
"import": "./gjs.js",
|
|
37
42
|
"default": "./gjs.js"
|
|
43
|
+
},
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./index.d.ts",
|
|
46
|
+
"import": "./index.js",
|
|
47
|
+
"default": "./index.js"
|
|
38
48
|
}
|
|
39
49
|
},
|
|
40
50
|
"scripts": {
|
|
41
|
-
"test": "
|
|
51
|
+
"test": "tsc --project tsconfig.json"
|
|
42
52
|
},
|
|
43
53
|
"dependencies": {
|
|
44
|
-
"@girs/
|
|
45
|
-
"@girs/
|
|
54
|
+
"@girs/cairo-1.0": "^1.0.0-4.0.0-beta.21",
|
|
55
|
+
"@girs/gio-2.0": "^2.83.3-4.0.0-beta.21",
|
|
56
|
+
"@girs/glib-2.0": "^2.83.3-4.0.0-beta.21",
|
|
57
|
+
"@girs/gobject-2.0": "^2.83.3-4.0.0-beta.21"
|
|
46
58
|
},
|
|
47
59
|
"devDependencies": {
|
|
48
60
|
"typescript": "*"
|