@ts-for-gir/lib 3.0.1 → 3.0.2

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 (104) hide show
  1. package/lib/constants.d.ts +9 -1
  2. package/lib/constants.js +4 -1
  3. package/lib/constants.js.map +1 -1
  4. package/lib/dependency-manager.d.ts +11 -0
  5. package/lib/dependency-manager.js +28 -14
  6. package/lib/dependency-manager.js.map +1 -1
  7. package/lib/gir-module.js +2 -3
  8. package/lib/gir-module.js.map +1 -1
  9. package/lib/index.d.ts +0 -3
  10. package/lib/index.js +0 -3
  11. package/lib/index.js.map +1 -1
  12. package/lib/symtable.js +1 -2
  13. package/lib/symtable.js.map +1 -1
  14. package/lib/types/generate-config.d.ts +2 -0
  15. package/lib/types/user-config.d.ts +2 -0
  16. package/lib/utils.d.ts +6 -0
  17. package/lib/utils.js +10 -0
  18. package/lib/utils.js.map +1 -1
  19. package/package.json +9 -11
  20. package/lib/injection/classes/GLib-2-0.d.ts +0 -2
  21. package/lib/injection/classes/GLib-2-0.js +0 -35
  22. package/lib/injection/classes/GLib-2-0.js.map +0 -1
  23. package/lib/injection/classes/gjs/GLib-2.0.d.ts +0 -2
  24. package/lib/injection/classes/gjs/GLib-2.0.js +0 -205
  25. package/lib/injection/classes/gjs/GLib-2.0.js.map +0 -1
  26. package/lib/injection/classes/gjs/GObject-2.0.d.ts +0 -2
  27. package/lib/injection/classes/gjs/GObject-2.0.js +0 -634
  28. package/lib/injection/classes/gjs/GObject-2.0.js.map +0 -1
  29. package/lib/injection/classes/gjs/Gio-2.0.d.ts +0 -5
  30. package/lib/injection/classes/gjs/Gio-2.0.js +0 -218
  31. package/lib/injection/classes/gjs/Gio-2.0.js.map +0 -1
  32. package/lib/injection/classes/node-gtk/GLib-2.0.d.ts +0 -2
  33. package/lib/injection/classes/node-gtk/GLib-2.0.js +0 -19
  34. package/lib/injection/classes/node-gtk/GLib-2.0.js.map +0 -1
  35. package/lib/injection/classes/node-gtk/GObject-2.0.d.ts +0 -2
  36. package/lib/injection/classes/node-gtk/GObject-2.0.js +0 -66
  37. package/lib/injection/classes/node-gtk/GObject-2.0.js.map +0 -1
  38. package/lib/injection/classes/node-gtk/Gdk-4.0.d.ts +0 -2
  39. package/lib/injection/classes/node-gtk/Gdk-4.0.js +0 -32
  40. package/lib/injection/classes/node-gtk/Gdk-4.0.js.map +0 -1
  41. package/lib/injection/classes/node-gtk/Gio-2.0.d.ts +0 -2
  42. package/lib/injection/classes/node-gtk/Gio-2.0.js +0 -14
  43. package/lib/injection/classes/node-gtk/Gio-2.0.js.map +0 -1
  44. package/lib/injection/classes/node-gtk/Graphene-1.0.d.ts +0 -2
  45. package/lib/injection/classes/node-gtk/Graphene-1.0.js +0 -133
  46. package/lib/injection/classes/node-gtk/Graphene-1.0.js.map +0 -1
  47. package/lib/injection/classes/node-gtk/Gtk-3.0.d.ts +0 -2
  48. package/lib/injection/classes/node-gtk/Gtk-3.0.js +0 -31
  49. package/lib/injection/classes/node-gtk/Gtk-3.0.js.map +0 -1
  50. package/lib/injection/classes/node-gtk/Gtk-4.0.d.ts +0 -2
  51. package/lib/injection/classes/node-gtk/Gtk-4.0.js +0 -52
  52. package/lib/injection/classes/node-gtk/Gtk-4.0.js.map +0 -1
  53. package/lib/injection/classes/node-gtk/Pango-1.0.d.ts +0 -2
  54. package/lib/injection/classes/node-gtk/Pango-1.0.js +0 -31
  55. package/lib/injection/classes/node-gtk/Pango-1.0.js.map +0 -1
  56. package/lib/package-data-parser.d.ts +0 -13
  57. package/lib/package-data-parser.js +0 -67
  58. package/lib/package-data-parser.js.map +0 -1
  59. package/lib/package-data.d.ts +0 -9
  60. package/lib/package-data.js +0 -41
  61. package/lib/package-data.js.map +0 -1
  62. package/lib/template-processor.d.ts +0 -114
  63. package/lib/template-processor.js +0 -252
  64. package/lib/template-processor.js.map +0 -1
  65. package/lib/types/package-section.d.ts +0 -8
  66. package/lib/types/package-section.js +0 -2
  67. package/lib/types/package-section.js.map +0 -1
  68. package/packages.xml +0 -1213
  69. package/templates/README.md +0 -102
  70. package/templates/cogl-2-0.d.ts +0 -0
  71. package/templates/gjs/README-GJS.md +0 -109
  72. package/templates/gjs/ambient.d.ts +0 -59
  73. package/templates/gjs/cairo-1.0.d.ts +0 -9
  74. package/templates/gjs/cairo.d.ts +0 -8
  75. package/templates/gjs/cairo.js +0 -11
  76. package/templates/gjs/gettext.d.ts +0 -41
  77. package/templates/gjs/gettext.js +0 -11
  78. package/templates/gjs/gio-2.0.d.ts +0 -101
  79. package/templates/gjs/gjs.d.ts +0 -757
  80. package/templates/gjs/gjs.js +0 -10
  81. package/templates/gjs/gobject-2.0.d.ts +0 -238
  82. package/templates/gjs/module-ambient.d.ts +0 -31
  83. package/templates/gjs/module-import.d.ts +0 -33
  84. package/templates/gjs/module.append.d.ts +0 -1
  85. package/templates/gjs/module.d.ts +0 -12
  86. package/templates/gjs/module.js +0 -17
  87. package/templates/gjs/system.d.ts +0 -32
  88. package/templates/gjs/system.js +0 -11
  89. package/templates/gjs/tsconfig.alias.json +0 -12
  90. package/templates/granite-1.0.d.ts +0 -7
  91. package/templates/granite-7.0.d.ts +0 -7
  92. package/templates/gstbase-0.10.d.ts +0 -5
  93. package/templates/node-gtk/README-NODE-GTK.md +0 -71
  94. package/templates/node-gtk/ambient.d.ts +0 -19
  95. package/templates/node-gtk/gobject-2.0.d.ts +0 -57
  96. package/templates/node-gtk/module-import.d.ts +0 -29
  97. package/templates/node-gtk/module.append.d.ts +0 -1
  98. package/templates/node-gtk/module.d.ts +0 -10
  99. package/templates/node-gtk/module.js +0 -18
  100. package/templates/node-gtk/node-gtk.d.ts +0 -25
  101. package/templates/node-gtk/node-gtk.js +0 -7
  102. package/templates/package.json +0 -173
  103. package/templates/rygelserver-2.6.d.ts +0 -3
  104. package/templates/tsconfig.doc.json +0 -30
@@ -1,757 +0,0 @@
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 <%= APP_NAME %> itself or create a bug report on <%= APP_SOURCE %>
6
- */
7
- import './ambient.d.ts';
8
-
9
- <%_ const GObject = dep.find('GObject') _%>
10
- <%_ const GLib = dep.find('GLib') _%>
11
- <%- GObject ? GObject.importDef : '' %>
12
- <%- GLib ? GLib.importDef : '' %>
13
- import gettext from './gettext.js';
14
- import system from './system.js';
15
- import cairo from './cairo.js';
16
-
17
- // https://gitlab.gnome.org/GNOME/gjs/-/blob/1.72.0/modules/script/package.js
18
- declare namespace package {
19
- /**
20
- * Although there are references in the documentation of more properties that
21
- * this object should accepts, only the following are actually used in the init code,
22
- * and all the other have their values derived from them.
23
- */
24
- interface PackageInitParams {
25
- name: string
26
- version: string
27
- prefix: string
28
- libdir: string
29
- }
30
-
31
- export const name: string | undefined
32
- export const version: string | undefined
33
- export const prefix: string | undefined
34
- export const datadir: string | undefined
35
- export const libdir: string | undefined
36
- export const pkgdatadir: string | undefined
37
- export const pkglibdir: string | undefined
38
- export const moduledir: string | undefined
39
- export const localedir: string | undefined
40
-
41
- export function init(params: PackageInitParams): void
42
- export function run(module: { main: (argv: string[]) => void }): void
43
- /** shortcut to init+run */
44
- export function start(params: PackageInitParams): void
45
- export function require(libs: Record<string, string>): void
46
- export function requireSymbol(lib: string, ver: string, symbol: string): void
47
- export function checkSymbol(lib: string, ver: string, symbol: string): void
48
- export function initGettext(): void
49
- /** @deprecated Use JS string interpolation */
50
- export function initFormat(): void
51
- export function initSubmodule(module: string): void
52
- }
53
-
54
- declare namespace byteArray {
55
- export class ByteArray {
56
- static get(target: any, property: string, receiver: any): any
57
- static set(target: any, property: string, value: any, receiver: any): boolean
58
-
59
- length: number
60
- protected _array: Uint8Array
61
-
62
- constructor(x: Uint8Array | number)
63
- toString(encoding?: TextDecoderEncoding): string
64
- fromString(input: string, encoding?: TextDecoderEncoding): ByteArray
65
- toGBytes(): GLib.Bytes
66
- }
67
-
68
- /** @deprecated Use {@link TextEncoder.encode} instead */
69
- export function fromString(input: string, encoding?: TextDecoderEncoding): Uint8Array
70
-
71
- /** @deprecated Use {@link GLib.Bytes.toArray} instead */
72
- export function fromGBytes(input: GLib.Bytes): Uint8Array
73
-
74
- /** @deprecated Use {@link TextEncoder.encode} instead */
75
- export function toString(x: Uint8Array, encoding?: TextDecoderEncoding): string
76
-
77
- /** @deprecated Use {@link GLib.Bytes new GLib.Bytes() } instead */
78
- export function toGBytes(x: Uint8Array): GLib.Bytes
79
-
80
- /** @deprecated Use {@link ByteArray new ByteArray()} instead */
81
- export function fromArray(array: Iterable<number>): ByteArray
82
- }
83
-
84
- declare namespace console {
85
- export function interact(): void
86
- }
87
-
88
- declare namespace lang {
89
- // TODO: There is a lot more in Lang
90
- export function Class(props: any): void
91
- }
92
-
93
- declare namespace format {
94
- export function vprintf(str: string, args: string[]): string
95
- export function printf(fmt: string, ...args: any[]): void
96
- // Following docs from gjs/modules/format.js
97
- /**
98
- * This function is intended to extend the String object and provide
99
- * an String.format API for string formatting.
100
- * It has to be set up using String.prototype.format = Format.format;
101
- * Usage:
102
- * "somestring %s %d".format('hello', 5);
103
- * It supports %s, %d, %x and %f, for %f it also support precisions like
104
- * "%.2f".format(1.526). All specifiers can be prefixed with a minimum
105
- * field width, e.g. "%5s".format("foo"). Unless the width is prefixed
106
- * with '0', the formatted string will be padded with spaces.
107
- */
108
- export function format(fmt: string, ...args: any[]): string
109
- }
110
-
111
- declare namespace mainloop {
112
- export function quit(name: string): void
113
- export function idle_source(handler: any, priority?: number): any
114
- export function idle_add(handler: any, priority?: number): any
115
- export function timeout_source(timeout: any, handler: any, priority?: number): any
116
- export function timeout_seconds_source(timeout: any, handler: any, priority?: number): any
117
- export function timeout_add(timeout: any, handler: any, priority?: number): any
118
- export function timeout_add_seconds(timeout: any, handler: any, priority?: number): any
119
- export function source_remove(id: any): any
120
- export function run(name: string): void
121
- }
122
-
123
- /**
124
- * You can use the `Signals.addSignalMethods` method to apply the `Signals` convenience methods to an `Object`.
125
- * Generally, this is called on an object prototype, but may also be called on an object instance.
126
- * You can use this Interface for this object or prototype to make the methods in typescript known
127
- * @example
128
- * ```ts
129
- * const Signals = imports.signals;
130
- *
131
- * // Define an interface with the same name of your class to make the methods known
132
- * interface Events extends Signals.Methods {}
133
- *
134
- * class Events {}
135
- * Signals.addSignalMethods(Events.prototype);
136
- *
137
- * const events = new Events();
138
- *
139
- * // Typescript will not complain here
140
- * events.emit("test-signal", "test argument");
141
- * ```
142
- */
143
- export interface SignalMethods {
144
- /**
145
- * Connects a callback to a signal for an object. Pass the returned ID to
146
- * `disconect()` to remove the handler.
147
- *
148
- * If `callback` returns `true`, emission will stop and no other handlers will be
149
- * invoked.
150
- *
151
- * > Warning: Unlike GObject signals, `this` within a signal callback will always
152
- * > refer to the global object (ie. `globalThis`).
153
- *
154
- * @param sigName A signal name
155
- * @param callback A callback function
156
- * @returns A handler ID
157
- */
158
- connect(sigName: string, callback: (self: any, ...args: any[]) => void): number;
159
- /**
160
- * Emits a signal for an object. Emission stops if a signal handler returns `true`.
161
- *
162
- * Unlike GObject signals, it is not necessary to declare signals or define their
163
- * signature. Simply call `emit()` with whatever signal name you wish, with
164
- * whatever arguments you wish.
165
- * @param sigName A signal name
166
- * @param args Any number of arguments, of any type
167
- */
168
- emit(sigName: string, ...args: any[]): void;
169
- /**
170
- * Disconnects a handler for a signal.
171
- * @param id The ID of the handler to be disconnected
172
- */
173
- disconnect(id: number): void;
174
- /**
175
- * Disconnects all signal handlers for an object.
176
- */
177
- disconnectAll(): void
178
- /**
179
- * Checks if a handler ID is connected.
180
- * @param id The ID of the handler to be disconnected
181
- * @returns `true` if connected, or `false` if not
182
- */
183
- signalHandlerIsConnected(id: number): boolean;
184
- }
185
-
186
- declare namespace signals {
187
- export function addSignalMethods<T = any>(proto: T): proto is T & SignalMethods;
188
- }
189
-
190
- // See also https://github.com/microsoft/TypeScript/blob/main/lib/lib.dom.d.ts
191
- declare global {
192
-
193
- interface GjsGiImports {
194
- // Will be extended by the import of more gir types
195
- versions: {
196
- [namespace: string]: string
197
- }
198
- }
199
-
200
- interface GjsImports {
201
- gi: GjsGiImports
202
- lang: typeof lang
203
- system: typeof system
204
- signals: typeof signals
205
- package: typeof package
206
- mainloop: typeof mainloop
207
- searchPath: string[]
208
- gettext: typeof gettext
209
- byteArray: typeof byteArray
210
- format: typeof format
211
- cairo: typeof cairo
212
- }
213
-
214
- function print(...args: any[]): void
215
- function printerr(...args: any[]): void
216
- function log(message: any): void
217
- function logError(exception: object, message?: any): void
218
- function logError(message?: any): void
219
-
220
- const pkg: typeof package
221
- interface Console {
222
- /**
223
- * Logs a critical message if the condition is not truthy.
224
- * {@link console.error()} for additional information.
225
- *
226
- * @param condition a boolean condition which, if false, causes
227
- * the log to print
228
- * @param data formatting substitutions, if applicable
229
- * @returns
230
- */
231
- assert(condition: boolean, ...data: any[]): void
232
-
233
- /**
234
- * Resets grouping and clears the terminal on systems supporting ANSI
235
- * terminal control sequences.
236
- *
237
- * In file-based stdout or systems which do not support clearing,
238
- * console.clear() has no visual effect.
239
- *
240
- */
241
- clear(): void
242
-
243
- /**
244
- * Logs a message with severity equal to {@link GLib.LogLevelFlags.DEBUG}.
245
- *
246
- * @param {...any} data formatting substitutions, if applicable
247
- */
248
- debug(...data: any[]): void
249
-
250
- /**
251
- * Logs a message with severity equal to {@link GLib.LogLevelFlags.CRITICAL}.
252
- * Does not use {@link GLib.LogLevelFlags.ERROR} to avoid asserting and
253
- * forcibly shutting down the application.
254
- *
255
- * @param data formatting substitutions, if applicable
256
- */
257
- error(...data: any[]): void
258
-
259
- /**
260
- * Logs a message with severity equal to {@link GLib.LogLevelFlags.INFO}.
261
- *
262
- * @param data formatting substitutions, if applicable
263
- */
264
- info(...data: any[]): void
265
-
266
- /**
267
- * Logs a message with severity equal to {@link GLib.LogLevelFlags.MESSAGE}.
268
- *
269
- * @param data formatting substitutions, if applicable
270
- */
271
- log(...data: any[]): void
272
-
273
- // 1.1.7 table(tabularData, properties)
274
- table(tabularData: any, _properties: never): void
275
-
276
- /**
277
- * @param data formatting substitutions, if applicable
278
- */
279
- trace(...data: any[]): void
280
-
281
- /**
282
- * @param data formatting substitutions, if applicable
283
- */
284
- warn(...data: any[]): void
285
-
286
- /**
287
- * @param item an item to format generically
288
- * @param [options] any additional options for the formatter. Unused
289
- * in our implementation.
290
- */
291
- dir(item: object, options: never): void
292
-
293
- /**
294
- * @param data formatting substitutions, if applicable
295
- */
296
- dirxml(...data: any[]): void
297
-
298
- // 1.2 Counting functions
299
- // https://console.spec.whatwg.org/#counting
300
-
301
- /**
302
- * Logs how many times console.count(label) has been called with a given
303
- * label.
304
- * {@link console.countReset()} for resetting a count.
305
- *
306
- * @param label unique identifier for this action
307
- */
308
- count(label: string): void
309
-
310
- /**
311
- * @param label the unique label to reset the count for
312
- */
313
- countReset(label: string): void
314
-
315
- // 1.3 Grouping functions
316
- // https://console.spec.whatwg.org/#grouping
317
-
318
- /**
319
- * @param data formatting substitutions, if applicable
320
- */
321
- group(...data: any[]): void
322
-
323
- /**
324
- * Alias for console.group()
325
- *
326
- * @param {...any} data formatting substitutions, if applicable
327
- */
328
- groupCollapsed(...data: any[]): void
329
-
330
- /**
331
- */
332
- groupEnd(): void
333
-
334
- // 1.4 Timing functions
335
- // https://console.spec.whatwg.org/#timing
336
-
337
- /**
338
- * @param label unique identifier for this action, pass to
339
- * console.timeEnd() to complete
340
- */
341
- time(label: string): void
342
-
343
- /**
344
- * Logs the time since the last call to console.time(label) where label is
345
- * the same.
346
- *
347
- * @param label unique identifier for this action, pass to
348
- * console.timeEnd() to complete
349
- * @param data string substitutions, if applicable
350
- */
351
- timeLog(label: string, ...data: any[]): void
352
-
353
- /**
354
- * Logs the time since the last call to console.time(label) and completes
355
- * the action.
356
- * Call console.time(label) again to re-measure.
357
- *
358
- * @param label unique identifier for this action
359
- */
360
- timeEnd(label: string): void
361
-
362
- // Non-standard functions which are de-facto standards.
363
- // Similar to Node, we define these as no-ops for now.
364
-
365
- /**
366
- * @deprecated Not implemented in GJS
367
- *
368
- * @param _label unique identifier for this action, pass to
369
- * console.profileEnd to complete
370
- */
371
- profile(_label: string): void
372
-
373
- /**
374
- * @deprecated Not implemented in GJS
375
- *
376
- * @param _label unique identifier for this action
377
- */
378
- profileEnd(_label: string): void
379
-
380
- /**
381
- * @deprecated Not implemented in GJS
382
- *
383
- * @param _label unique identifier for this action
384
- */
385
- timeStamp(_label: string): void
386
-
387
- // GJS-specific extensions for integrating with GLib structured logging
388
-
389
- /**
390
- * @param logDomain the GLib log domain this Console should print
391
- * with. Defaults to 'Gjs-Console'.
392
- */
393
- setLogDomain(logDomain: string): void
394
-
395
- logDomain: string
396
- }
397
-
398
- <% if(!noDOMLib){ %>
399
- const console: Console
400
- <% } %>
401
-
402
- // https://gitlab.gnome.org/GNOME/gjs/-/blob/1.73.2/modules/esm/_encoding/encodingMap.js#L7-232
403
- type TextDecoderEncoding =
404
- | 'unicode-1-1-utf-8'
405
- | 'unicode11utf8'
406
- | 'unicode20utf8'
407
- | 'utf-8'
408
- | 'utf8'
409
- | 'x-unicode20utf8'
410
- | '866'
411
- | 'cp866'
412
- | 'csibm866'
413
- | 'ibm866'
414
- | 'csisolatin2'
415
- | 'iso-8859-2'
416
- | 'iso-ir-101'
417
- | 'iso8859-2'
418
- | 'iso88592'
419
- | 'iso_8859-2'
420
- | 'iso_8859-2:1987'
421
- | 'l2'
422
- | 'latin2'
423
- | 'csisolatin3'
424
- | 'iso-8859-3'
425
- | 'iso-ir-109'
426
- | 'iso8859-3'
427
- | 'iso88593'
428
- | 'iso_8859-3'
429
- | 'iso_8859-3:1988'
430
- | 'l3'
431
- | 'latin3'
432
- | 'csisolatin4'
433
- | 'iso-8859-4'
434
- | 'iso-ir-110'
435
- | 'iso8859-4'
436
- | 'iso88594'
437
- | 'iso_8859-4'
438
- | 'iso_8859-4:1988'
439
- | 'l4'
440
- | 'latin4'
441
- | 'csisolatincyrillic'
442
- | 'cyrillic'
443
- | 'iso-8859-5'
444
- | 'iso-ir-144'
445
- | 'iso8859-5'
446
- | 'iso88595'
447
- | 'iso_8859-5'
448
- | 'iso_8859-5:1988'
449
- | 'arabic'
450
- | 'asmo-708'
451
- | 'csiso88596e'
452
- | 'csiso88596i'
453
- | 'csisolatinarabic'
454
- | 'ecma-114'
455
- | 'iso-8859-6'
456
- | 'iso-8859-6-e'
457
- | 'iso-8859-6-i'
458
- | 'iso-ir-127'
459
- | 'iso8859-6'
460
- | 'iso88596'
461
- | 'iso_8859-6'
462
- | 'iso_8859-6:1987'
463
- | 'csisolatingreek'
464
- | 'ecma-118'
465
- | 'elot_928'
466
- | 'greek'
467
- | 'greek8'
468
- | 'iso-8859-7'
469
- | 'iso-ir-126'
470
- | 'iso8859-7'
471
- | 'iso88597'
472
- | 'iso_8859-7'
473
- | 'iso_8859-7:1987'
474
- | 'sun_eu_greek'
475
- | 'csiso88598e'
476
- | 'csisolatinhebrew'
477
- | 'hebrew'
478
- | 'iso-8859-8'
479
- | 'iso-8859-8-e'
480
- | 'iso-ir-138'
481
- | 'iso8859-8'
482
- | 'iso88598'
483
- | 'iso_8859-8'
484
- | 'iso_8859-8:1988'
485
- | 'visual'
486
- | 'csiso88598i'
487
- | 'iso-8859-8-i'
488
- | 'logical'
489
- | 'csisolatin6'
490
- | 'iso-8859-10'
491
- | 'iso-ir-157'
492
- | 'iso8859-10'
493
- | 'iso885910'
494
- | 'l6'
495
- | 'latin6'
496
- | 'iso-8859-13'
497
- | 'iso8859-13'
498
- | 'iso885913'
499
- | 'iso-8859-14'
500
- | 'iso8859-14'
501
- | 'iso885914'
502
- | 'csisolatin9'
503
- | 'iso-8859-15'
504
- | 'iso8859-15'
505
- | 'iso885915'
506
- | 'iso_8859-15'
507
- | 'l9'
508
- | 'iso-8859-16'
509
- | 'cskoi8r'
510
- | 'koi'
511
- | 'koi8'
512
- | 'koi8-r'
513
- | 'koi8_r'
514
- | 'koi8-ru'
515
- | 'koi8-u'
516
- | 'csmacintosh'
517
- | 'mac'
518
- | 'macintosh'
519
- | 'x-mac-roman'
520
- | 'dos-874'
521
- | 'iso-8859-11'
522
- | 'iso8859-11'
523
- | 'iso885911'
524
- | 'tis-620'
525
- | 'windows-874'
526
- | 'cp1250'
527
- | 'windows-1250'
528
- | 'x-cp1250'
529
- | 'cp1251'
530
- | 'windows-1251'
531
- | 'x-cp1251'
532
- | 'ansi_x3.4-1968'
533
- | 'ascii'
534
- | 'cp1252'
535
- | 'cp819'
536
- | 'csisolatin1'
537
- | 'ibm819'
538
- | 'iso-8859-1'
539
- | 'iso-ir-100'
540
- | 'iso8859-1'
541
- | 'iso88591'
542
- | 'iso_8859-1'
543
- | 'iso_8859-1:1987'
544
- | 'l1'
545
- | 'latin1'
546
- | 'us-ascii'
547
- | 'windows-1252'
548
- | 'x-cp1252'
549
- | 'cp1253'
550
- | 'windows-1253'
551
- | 'x-cp1253'
552
- | 'cp1254'
553
- | 'csisolatin5'
554
- | 'iso-8859-9'
555
- | 'iso-ir-148'
556
- | 'iso8859-9'
557
- | 'iso88599'
558
- | 'iso_8859-9'
559
- | 'iso_8859-9:1989'
560
- | 'l5'
561
- | 'latin5'
562
- | 'windows-1254'
563
- | 'x-cp1254'
564
- | 'cp1255'
565
- | 'windows-1255'
566
- | 'x-cp1255'
567
- | 'cp1256'
568
- | 'windows-1256'
569
- | 'x-cp1256'
570
- | 'cp1257'
571
- | 'windows-1257'
572
- | 'x-cp1257'
573
- | 'cp1258'
574
- | 'windows-1258'
575
- | 'x-cp1258'
576
- | 'x-mac-cyrillic'
577
- | 'x-mac-ukrainian'
578
- | 'chinese'
579
- | 'csgb2312'
580
- | 'csiso58gb231280'
581
- | 'gb2312'
582
- | 'gb_2312'
583
- | 'gb_2312-80'
584
- | 'gbk'
585
- | 'iso-ir-58'
586
- | 'x-gbk'
587
- | 'gb18030'
588
- | 'big5'
589
- | 'cn-big5'
590
- | 'csbig5'
591
- | 'x-x-big5'
592
- | 'cseucpkdfmtjapanese'
593
- | 'euc-jp'
594
- | 'x-euc-jp'
595
- | 'csiso2022jp'
596
- | 'iso-2022-jp'
597
- | 'csshiftjis'
598
- | 'ms932'
599
- | 'ms_kanji'
600
- | 'shift-jis'
601
- | 'shift_jis'
602
- | 'sjis'
603
- | 'windows-31j'
604
- | 'x-sjis'
605
- | 'cseuckr'
606
- | 'csksc56011987'
607
- | 'euc-kr'
608
- | 'iso-ir-149'
609
- | 'korean'
610
- | 'ks_c_5601-1987'
611
- | 'ks_c_5601-1989'
612
- | 'ksc5601'
613
- | 'ksc_5601'
614
- | 'windows-949'
615
- | 'unicodefffe'
616
- | 'utf-16be'
617
- | 'csunicode'
618
- | 'iso-10646-ucs-2'
619
- | 'ucs-2'
620
- | 'unicode'
621
- | 'unicodefeff'
622
- | 'utf-16'
623
- | 'utf-16le'
624
-
625
- interface TextDecodeOptions {
626
- // As of Gjs 1.73.2 stream mode is not supported yet.
627
- // stream?: boolean
628
- }
629
-
630
- interface TextDecoderOptions {
631
- /** Indicates whether the error mode is fatal. */
632
- fatal?: boolean
633
- /** Indicates whether whether the byte order mark is ignored. */
634
- ignoreBOM?: boolean
635
- }
636
-
637
- /**
638
- * The TextDecoder interface represents a decoder for a specific text encoding.
639
- * It takes a stream of bytes as input and emits a stream of code points.
640
- *
641
- * @version Gjs 1.69.2
642
- */
643
- interface TextDecoder {
644
- /** A string containing the name of the decoder, that is a string describing the method the TextDecoder will use. */
645
- readonly encoding: TextDecoderEncoding
646
- /** A Boolean indicating whether the error mode is fatal. */
647
- readonly fatal: boolean
648
- /** A Boolean indicating whether the byte order mark is ignored. */
649
- readonly ignoreBOM: boolean
650
-
651
- /**
652
- * Returns a string containing the text decoded with the method of the specific TextDecoder object.
653
- *
654
- * If the error mode is "fatal" and the encoder method encounter an error it WILL THROW a TypeError.
655
- *
656
- * @param input Buffer containing the text to decode
657
- * @param options Object defining the decode options
658
- */
659
- decode(input?: ArrayBufferView | ArrayBuffer, options?: TextDecodeOptions): string
660
- }
661
-
662
- <% if(!noDOMLib){ %>
663
- const TextDecoder: {
664
- prototype: TextDecoder
665
- new (label?: TextDecoderEncoding, options?: TextDecoderOptions): TextDecoder
666
- }
667
- <% } %>
668
-
669
- interface TextEncoderEncodeIntoResult {
670
- read?: number
671
- written?: number
672
- }
673
-
674
- /**
675
- * TextEncoder takes a stream of code points as input and emits a stream of bytes.
676
- *
677
- * @version Gjs 1.69.2
678
- */
679
- interface TextEncoder {
680
- readonly encoding: 'utf-8'
681
-
682
- /**
683
- * Takes a string as input, and returns a buffer containing the text given in parameters encoded with the UTF-8 method.
684
- *
685
- * @param input Text to encode.
686
- */
687
- encode(input?: string): Uint8Array
688
- /**
689
- * Takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into,
690
- * and returns a dictionary object indicating the progress of the encoding.
691
- *
692
- * This is potentially more performant than the older encode() method.
693
- *
694
- * @param source Text to encode.
695
- * @param destination Buffer where to place the resulting UTF-8 encoded text into.
696
- */
697
- encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult
698
- }
699
-
700
- <% if(!noDOMLib){ %>
701
- const TextEncoder: {
702
- prototype: TextEncoder
703
- new (): TextEncoder
704
- }
705
- <% } %>
706
-
707
- interface BooleanConstructor {
708
- $gtype: GObject.GType<boolean>
709
- }
710
-
711
- interface NumberConstructor {
712
- $gtype: GObject.GType<number>
713
- }
714
-
715
- interface StringConstructor {
716
- $gtype: GObject.GType<string>
717
- }
718
-
719
- const ARGV: string[]
720
-
721
- // Timers
722
- // See https://gitlab.gnome.org/GNOME/gjs/-/blob/master/modules/esm/_timers.js
723
-
724
- /**
725
- * @version Gjs 1.71.1
726
- * @param callback a callback function
727
- * @param delay the duration in milliseconds to wait before running callback
728
- * @param args arguments to pass to callback
729
- */
730
- function setTimeout(callback: (...args: any[]) => any, delay?: number, ...args: any[]): GLib.Source
731
-
732
- /**
733
- * @version Gjs 1.71.1
734
- * @param callback a callback function
735
- * @param delay the duration in milliseconds to wait between calling callback
736
- * @param args arguments to pass to callback
737
- */
738
- function setInterval(callback: (...args: any[]) => any, delay?: number, ...args: any[]): GLib.Source
739
-
740
- /**
741
- * @version Gjs 1.71.1
742
- * @param timeout the timeout to clear
743
- */
744
- function clearTimeout(timeout: GLib.Source): void
745
-
746
- /**
747
- * @version Gjs 1.71.1
748
- * @param timeout the timeout to clear
749
- */
750
- function clearInterval(timeout: GLib.Source): void
751
-
752
- const imports: GjsImports
753
- }
754
-
755
- declare const _imports: GjsImports
756
- export default _imports
757
- export { _imports as imports }