@ts-for-gir/cli 3.0.0-beta.2 → 3.0.0-beta.3
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/lib/config.d.ts +0 -3
- package/lib/config.js +33 -1
- package/lib/config.js.map +1 -1
- package/lib/conflict-resolver.d.ts +2 -1
- package/lib/conflict-resolver.js +4 -2
- package/lib/conflict-resolver.js.map +1 -1
- package/lib/gir-module.js +1 -1
- package/lib/gir-module.js.map +1 -1
- package/lib/logger.js +8 -4
- package/lib/logger.js.map +1 -1
- package/lib/type-definition-generator.js +59 -0
- package/lib/type-definition-generator.js.map +1 -1
- package/lib/types/generate-config.d.ts +2 -0
- package/lib/types/user-config.d.ts +2 -0
- package/lib/utils.d.ts +8 -0
- package/lib/utils.js +34 -0
- package/lib/utils.js.map +1 -1
- package/package.json +6 -6
- package/src/config.ts +37 -1
- package/src/conflict-resolver.ts +2 -2
- package/src/gir-module.ts +1 -1
- package/src/logger.ts +4 -4
- package/src/type-definition-generator.ts +71 -0
- package/src/types/generate-config.ts +2 -0
- package/src/types/user-config.ts +2 -0
- package/src/utils.ts +38 -0
- package/templates/Gjs/Gjs.d.ts +6 -6
- package/templates/Gjs/index.d.ts +308 -1
package/templates/Gjs/index.d.ts
CHANGED
|
@@ -199,7 +199,314 @@ declare global {
|
|
|
199
199
|
logDomain: string
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
-
|
|
202
|
+
<% if(!hasDOMLib){ %>
|
|
203
|
+
const console: Console
|
|
204
|
+
<% } %>
|
|
205
|
+
|
|
206
|
+
// https://gitlab.gnome.org/GNOME/gjs/-/blob/1.73.2/modules/esm/_encoding/encodingMap.js#L7-232
|
|
207
|
+
type TextDecoderEncoding =
|
|
208
|
+
| 'unicode-1-1-utf-8'
|
|
209
|
+
| 'unicode11utf8'
|
|
210
|
+
| 'unicode20utf8'
|
|
211
|
+
| 'utf-8'
|
|
212
|
+
| 'utf8'
|
|
213
|
+
| 'x-unicode20utf8'
|
|
214
|
+
| '866'
|
|
215
|
+
| 'cp866'
|
|
216
|
+
| 'csibm866'
|
|
217
|
+
| 'ibm866'
|
|
218
|
+
| 'csisolatin2'
|
|
219
|
+
| 'iso-8859-2'
|
|
220
|
+
| 'iso-ir-101'
|
|
221
|
+
| 'iso8859-2'
|
|
222
|
+
| 'iso88592'
|
|
223
|
+
| 'iso_8859-2'
|
|
224
|
+
| 'iso_8859-2:1987'
|
|
225
|
+
| 'l2'
|
|
226
|
+
| 'latin2'
|
|
227
|
+
| 'csisolatin3'
|
|
228
|
+
| 'iso-8859-3'
|
|
229
|
+
| 'iso-ir-109'
|
|
230
|
+
| 'iso8859-3'
|
|
231
|
+
| 'iso88593'
|
|
232
|
+
| 'iso_8859-3'
|
|
233
|
+
| 'iso_8859-3:1988'
|
|
234
|
+
| 'l3'
|
|
235
|
+
| 'latin3'
|
|
236
|
+
| 'csisolatin4'
|
|
237
|
+
| 'iso-8859-4'
|
|
238
|
+
| 'iso-ir-110'
|
|
239
|
+
| 'iso8859-4'
|
|
240
|
+
| 'iso88594'
|
|
241
|
+
| 'iso_8859-4'
|
|
242
|
+
| 'iso_8859-4:1988'
|
|
243
|
+
| 'l4'
|
|
244
|
+
| 'latin4'
|
|
245
|
+
| 'csisolatincyrillic'
|
|
246
|
+
| 'cyrillic'
|
|
247
|
+
| 'iso-8859-5'
|
|
248
|
+
| 'iso-ir-144'
|
|
249
|
+
| 'iso8859-5'
|
|
250
|
+
| 'iso88595'
|
|
251
|
+
| 'iso_8859-5'
|
|
252
|
+
| 'iso_8859-5:1988'
|
|
253
|
+
| 'arabic'
|
|
254
|
+
| 'asmo-708'
|
|
255
|
+
| 'csiso88596e'
|
|
256
|
+
| 'csiso88596i'
|
|
257
|
+
| 'csisolatinarabic'
|
|
258
|
+
| 'ecma-114'
|
|
259
|
+
| 'iso-8859-6'
|
|
260
|
+
| 'iso-8859-6-e'
|
|
261
|
+
| 'iso-8859-6-i'
|
|
262
|
+
| 'iso-ir-127'
|
|
263
|
+
| 'iso8859-6'
|
|
264
|
+
| 'iso88596'
|
|
265
|
+
| 'iso_8859-6'
|
|
266
|
+
| 'iso_8859-6:1987'
|
|
267
|
+
| 'csisolatingreek'
|
|
268
|
+
| 'ecma-118'
|
|
269
|
+
| 'elot_928'
|
|
270
|
+
| 'greek'
|
|
271
|
+
| 'greek8'
|
|
272
|
+
| 'iso-8859-7'
|
|
273
|
+
| 'iso-ir-126'
|
|
274
|
+
| 'iso8859-7'
|
|
275
|
+
| 'iso88597'
|
|
276
|
+
| 'iso_8859-7'
|
|
277
|
+
| 'iso_8859-7:1987'
|
|
278
|
+
| 'sun_eu_greek'
|
|
279
|
+
| 'csiso88598e'
|
|
280
|
+
| 'csisolatinhebrew'
|
|
281
|
+
| 'hebrew'
|
|
282
|
+
| 'iso-8859-8'
|
|
283
|
+
| 'iso-8859-8-e'
|
|
284
|
+
| 'iso-ir-138'
|
|
285
|
+
| 'iso8859-8'
|
|
286
|
+
| 'iso88598'
|
|
287
|
+
| 'iso_8859-8'
|
|
288
|
+
| 'iso_8859-8:1988'
|
|
289
|
+
| 'visual'
|
|
290
|
+
| 'csiso88598i'
|
|
291
|
+
| 'iso-8859-8-i'
|
|
292
|
+
| 'logical'
|
|
293
|
+
| 'csisolatin6'
|
|
294
|
+
| 'iso-8859-10'
|
|
295
|
+
| 'iso-ir-157'
|
|
296
|
+
| 'iso8859-10'
|
|
297
|
+
| 'iso885910'
|
|
298
|
+
| 'l6'
|
|
299
|
+
| 'latin6'
|
|
300
|
+
| 'iso-8859-13'
|
|
301
|
+
| 'iso8859-13'
|
|
302
|
+
| 'iso885913'
|
|
303
|
+
| 'iso-8859-14'
|
|
304
|
+
| 'iso8859-14'
|
|
305
|
+
| 'iso885914'
|
|
306
|
+
| 'csisolatin9'
|
|
307
|
+
| 'iso-8859-15'
|
|
308
|
+
| 'iso8859-15'
|
|
309
|
+
| 'iso885915'
|
|
310
|
+
| 'iso_8859-15'
|
|
311
|
+
| 'l9'
|
|
312
|
+
| 'iso-8859-16'
|
|
313
|
+
| 'cskoi8r'
|
|
314
|
+
| 'koi'
|
|
315
|
+
| 'koi8'
|
|
316
|
+
| 'koi8-r'
|
|
317
|
+
| 'koi8_r'
|
|
318
|
+
| 'koi8-ru'
|
|
319
|
+
| 'koi8-u'
|
|
320
|
+
| 'csmacintosh'
|
|
321
|
+
| 'mac'
|
|
322
|
+
| 'macintosh'
|
|
323
|
+
| 'x-mac-roman'
|
|
324
|
+
| 'dos-874'
|
|
325
|
+
| 'iso-8859-11'
|
|
326
|
+
| 'iso8859-11'
|
|
327
|
+
| 'iso885911'
|
|
328
|
+
| 'tis-620'
|
|
329
|
+
| 'windows-874'
|
|
330
|
+
| 'cp1250'
|
|
331
|
+
| 'windows-1250'
|
|
332
|
+
| 'x-cp1250'
|
|
333
|
+
| 'cp1251'
|
|
334
|
+
| 'windows-1251'
|
|
335
|
+
| 'x-cp1251'
|
|
336
|
+
| 'ansi_x3.4-1968'
|
|
337
|
+
| 'ascii'
|
|
338
|
+
| 'cp1252'
|
|
339
|
+
| 'cp819'
|
|
340
|
+
| 'csisolatin1'
|
|
341
|
+
| 'ibm819'
|
|
342
|
+
| 'iso-8859-1'
|
|
343
|
+
| 'iso-ir-100'
|
|
344
|
+
| 'iso8859-1'
|
|
345
|
+
| 'iso88591'
|
|
346
|
+
| 'iso_8859-1'
|
|
347
|
+
| 'iso_8859-1:1987'
|
|
348
|
+
| 'l1'
|
|
349
|
+
| 'latin1'
|
|
350
|
+
| 'us-ascii'
|
|
351
|
+
| 'windows-1252'
|
|
352
|
+
| 'x-cp1252'
|
|
353
|
+
| 'cp1253'
|
|
354
|
+
| 'windows-1253'
|
|
355
|
+
| 'x-cp1253'
|
|
356
|
+
| 'cp1254'
|
|
357
|
+
| 'csisolatin5'
|
|
358
|
+
| 'iso-8859-9'
|
|
359
|
+
| 'iso-ir-148'
|
|
360
|
+
| 'iso8859-9'
|
|
361
|
+
| 'iso88599'
|
|
362
|
+
| 'iso_8859-9'
|
|
363
|
+
| 'iso_8859-9:1989'
|
|
364
|
+
| 'l5'
|
|
365
|
+
| 'latin5'
|
|
366
|
+
| 'windows-1254'
|
|
367
|
+
| 'x-cp1254'
|
|
368
|
+
| 'cp1255'
|
|
369
|
+
| 'windows-1255'
|
|
370
|
+
| 'x-cp1255'
|
|
371
|
+
| 'cp1256'
|
|
372
|
+
| 'windows-1256'
|
|
373
|
+
| 'x-cp1256'
|
|
374
|
+
| 'cp1257'
|
|
375
|
+
| 'windows-1257'
|
|
376
|
+
| 'x-cp1257'
|
|
377
|
+
| 'cp1258'
|
|
378
|
+
| 'windows-1258'
|
|
379
|
+
| 'x-cp1258'
|
|
380
|
+
| 'x-mac-cyrillic'
|
|
381
|
+
| 'x-mac-ukrainian'
|
|
382
|
+
| 'chinese'
|
|
383
|
+
| 'csgb2312'
|
|
384
|
+
| 'csiso58gb231280'
|
|
385
|
+
| 'gb2312'
|
|
386
|
+
| 'gb_2312'
|
|
387
|
+
| 'gb_2312-80'
|
|
388
|
+
| 'gbk'
|
|
389
|
+
| 'iso-ir-58'
|
|
390
|
+
| 'x-gbk'
|
|
391
|
+
| 'gb18030'
|
|
392
|
+
| 'big5'
|
|
393
|
+
| 'cn-big5'
|
|
394
|
+
| 'csbig5'
|
|
395
|
+
| 'x-x-big5'
|
|
396
|
+
| 'cseucpkdfmtjapanese'
|
|
397
|
+
| 'euc-jp'
|
|
398
|
+
| 'x-euc-jp'
|
|
399
|
+
| 'csiso2022jp'
|
|
400
|
+
| 'iso-2022-jp'
|
|
401
|
+
| 'csshiftjis'
|
|
402
|
+
| 'ms932'
|
|
403
|
+
| 'ms_kanji'
|
|
404
|
+
| 'shift-jis'
|
|
405
|
+
| 'shift_jis'
|
|
406
|
+
| 'sjis'
|
|
407
|
+
| 'windows-31j'
|
|
408
|
+
| 'x-sjis'
|
|
409
|
+
| 'cseuckr'
|
|
410
|
+
| 'csksc56011987'
|
|
411
|
+
| 'euc-kr'
|
|
412
|
+
| 'iso-ir-149'
|
|
413
|
+
| 'korean'
|
|
414
|
+
| 'ks_c_5601-1987'
|
|
415
|
+
| 'ks_c_5601-1989'
|
|
416
|
+
| 'ksc5601'
|
|
417
|
+
| 'ksc_5601'
|
|
418
|
+
| 'windows-949'
|
|
419
|
+
| 'unicodefffe'
|
|
420
|
+
| 'utf-16be'
|
|
421
|
+
| 'csunicode'
|
|
422
|
+
| 'iso-10646-ucs-2'
|
|
423
|
+
| 'ucs-2'
|
|
424
|
+
| 'unicode'
|
|
425
|
+
| 'unicodefeff'
|
|
426
|
+
| 'utf-16'
|
|
427
|
+
| 'utf-16le'
|
|
428
|
+
|
|
429
|
+
interface TextDecodeOptions {
|
|
430
|
+
// As of Gjs 1.73.2 stream mode is not supported yet.
|
|
431
|
+
// stream?: boolean
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
interface TextDecoderOptions {
|
|
435
|
+
/** Indicates whether the error mode is fatal. */
|
|
436
|
+
fatal?: boolean
|
|
437
|
+
/** Indicates whether whether the byte order mark is ignored. */
|
|
438
|
+
ignoreBOM?: boolean
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* The TextDecoder interface represents a decoder for a specific text encoding.
|
|
443
|
+
* It takes a stream of bytes as input and emits a stream of code points.
|
|
444
|
+
*
|
|
445
|
+
* @version Gjs 1.69.2
|
|
446
|
+
*/
|
|
447
|
+
interface TextDecoder {
|
|
448
|
+
/** A string containing the name of the decoder, that is a string describing the method the TextDecoder will use. */
|
|
449
|
+
readonly encoding: TextDecoderEncoding
|
|
450
|
+
/** A Boolean indicating whether the error mode is fatal. */
|
|
451
|
+
readonly fatal: boolean
|
|
452
|
+
/** A Boolean indicating whether the byte order mark is ignored. */
|
|
453
|
+
readonly ignoreBOM: boolean
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Returns a string containing the text decoded with the method of the specific TextDecoder object.
|
|
457
|
+
*
|
|
458
|
+
* If the error mode is "fatal" and the encoder method encounter an error it WILL THROW a TypeError.
|
|
459
|
+
*
|
|
460
|
+
* @param input Buffer containing the text to decode
|
|
461
|
+
* @param options Object defining the decode options
|
|
462
|
+
*/
|
|
463
|
+
decode(input?: ArrayBufferView | ArrayBuffer, options?: TextDecodeOptions): string
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
<% if(!hasDOMLib){ %>
|
|
467
|
+
const TextDecoder: {
|
|
468
|
+
prototype: TextDecoder
|
|
469
|
+
new (label?: TextDecoderEncoding, options?: TextDecoderOptions): TextDecoder
|
|
470
|
+
}
|
|
471
|
+
<% } %>
|
|
472
|
+
|
|
473
|
+
interface TextEncoderEncodeIntoResult {
|
|
474
|
+
read?: number
|
|
475
|
+
written?: number
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* TextEncoder takes a stream of code points as input and emits a stream of bytes.
|
|
480
|
+
*
|
|
481
|
+
* @version Gjs 1.69.2
|
|
482
|
+
*/
|
|
483
|
+
interface TextEncoder {
|
|
484
|
+
readonly encoding: 'utf-8'
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Takes a string as input, and returns a buffer containing the text given in parameters encoded with the UTF-8 method.
|
|
488
|
+
*
|
|
489
|
+
* @param input Text to encode.
|
|
490
|
+
*/
|
|
491
|
+
encode(input?: string): Uint8Array
|
|
492
|
+
/**
|
|
493
|
+
* Takes a string to encode and a destination Uint8Array to put resulting UTF-8 encoded text into,
|
|
494
|
+
* and returns a dictionary object indicating the progress of the encoding.
|
|
495
|
+
*
|
|
496
|
+
* This is potentially more performant than the older encode() method.
|
|
497
|
+
*
|
|
498
|
+
* @param source Text to enconde.
|
|
499
|
+
* @param destination Buffer where to place the resulting UTF-8 encoded text into.
|
|
500
|
+
*/
|
|
501
|
+
encodeInto(source: string, destination: Uint8Array): TextEncoderEncodeIntoResult
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
<% if(!hasDOMLib){ %>
|
|
505
|
+
const TextEncoder: {
|
|
506
|
+
prototype: TextEncoder
|
|
507
|
+
new (): TextEncoder
|
|
508
|
+
}
|
|
509
|
+
<% } %>
|
|
203
510
|
|
|
204
511
|
interface BooleanConstructor {
|
|
205
512
|
$gtype: GObject20.GType<boolean>
|