@girs/gdkpixbuf-2.0 2.0.0-3.2.4 → 2.0.0-3.2.6
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 +14 -1
- package/gdkpixbuf-2.0-ambient.d.ts +0 -1
- package/gdkpixbuf-2.0-import.d.ts +0 -1
- package/gdkpixbuf-2.0.d.cts +34 -0
- package/gdkpixbuf-2.0.d.ts +34 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for GdkPixbuf-2.0, generated from library version 2.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.
|
|
8
|
+
GJS TypeScript type definitions for GdkPixbuf-2.0, generated from library version 2.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v3.2.6.
|
|
9
9
|
|
|
10
10
|
GdkPixbuf is a library for image loading and manipulation. The GdkPixbuf documentation contains both the programmer's guide and the API reference.
|
|
11
11
|
|
|
@@ -82,6 +82,19 @@ Now you have also type support for this, too:
|
|
|
82
82
|
const GdkPixbuf = imports.gi.GdkPixbuf;
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
|
|
86
|
+
### ESM vs. CommonJS
|
|
87
|
+
|
|
88
|
+
GJS supports two different import syntaxes. The new modern ESM syntax and the old global imports syntax.
|
|
89
|
+
|
|
90
|
+
In TypeScript projects for GJS and GNOME Shell extensions, you have the flexibility to use `ESM` syntax and then decide the import syntax for your bundled file. If your bundler is configured to use `CommonJS`, it will convert to the GJS-specific global imports syntax, like `const moduleName = imports.gi[moduleName]`. This is different from the traditional `require` syntax seen in Node.js. The global imports syntax is chosen because it aligns with the CommonJS format supported by NPM, which is used for the generated type definitions and this package.
|
|
91
|
+
|
|
92
|
+
On the other hand, if you configure your bundler to use ESM, it will retain the ESM import syntax. It's crucial to ensure that your bundler is set up to correctly translate and bundle these imports into either CommonJS or ESM format, depending on your project's requirements.
|
|
93
|
+
|
|
94
|
+
This approach is particularly important due to the `@girs` types, which include both `*.cjs `files, using the GJS global imports syntax, and `*.js` files, which utilize the ESM syntax. By appropriately setting up your bundler, you can control which syntax—CommonJS or ESM—is used in your project. The choice of CommonJS in this context is also due to the similarity between the GJS-specific global imports and CommonJS syntax, allowing for easier management and bundling in these specific types of projects.
|
|
95
|
+
|
|
96
|
+
Since GNOME Shell 45, you should only use ESM, even for GNOME Shell extensions. Before that, extensions had to use the global import syntax, unlike normal GJS applications, where ESM has been available for some time.
|
|
97
|
+
|
|
85
98
|
### Bundle
|
|
86
99
|
|
|
87
100
|
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).
|
package/gdkpixbuf-2.0.d.cts
CHANGED
|
@@ -434,6 +434,23 @@ export module Pixbuf {
|
|
|
434
434
|
* The number of columns of the pixbuf.
|
|
435
435
|
*/
|
|
436
436
|
width?: number | null
|
|
437
|
+
/**
|
|
438
|
+
* The number of bits per sample.
|
|
439
|
+
*
|
|
440
|
+
* Currently only 8 bit per sample are supported.
|
|
441
|
+
*/
|
|
442
|
+
bitsPerSample?: number | null
|
|
443
|
+
/**
|
|
444
|
+
* Whether the pixbuf has an alpha channel.
|
|
445
|
+
*/
|
|
446
|
+
hasAlpha?: boolean | null
|
|
447
|
+
/**
|
|
448
|
+
* The number of samples per pixel.
|
|
449
|
+
*
|
|
450
|
+
* Currently, only 3 or 4 samples per pixel are supported.
|
|
451
|
+
*/
|
|
452
|
+
nChannels?: number | null
|
|
453
|
+
pixelBytes?: GLib.Bytes | null
|
|
437
454
|
}
|
|
438
455
|
|
|
439
456
|
}
|
|
@@ -448,6 +465,12 @@ export interface Pixbuf extends Gio.Icon, Gio.LoadableIcon {
|
|
|
448
465
|
* Currently only 8 bit per sample are supported.
|
|
449
466
|
*/
|
|
450
467
|
readonly bits_per_sample: number
|
|
468
|
+
/**
|
|
469
|
+
* The number of bits per sample.
|
|
470
|
+
*
|
|
471
|
+
* Currently only 8 bit per sample are supported.
|
|
472
|
+
*/
|
|
473
|
+
readonly bitsPerSample: number
|
|
451
474
|
/**
|
|
452
475
|
* The color space of the pixbuf.
|
|
453
476
|
*
|
|
@@ -458,6 +481,10 @@ export interface Pixbuf extends Gio.Icon, Gio.LoadableIcon {
|
|
|
458
481
|
* Whether the pixbuf has an alpha channel.
|
|
459
482
|
*/
|
|
460
483
|
readonly has_alpha: boolean
|
|
484
|
+
/**
|
|
485
|
+
* Whether the pixbuf has an alpha channel.
|
|
486
|
+
*/
|
|
487
|
+
readonly hasAlpha: boolean
|
|
461
488
|
/**
|
|
462
489
|
* The number of rows of the pixbuf.
|
|
463
490
|
*/
|
|
@@ -468,7 +495,14 @@ export interface Pixbuf extends Gio.Icon, Gio.LoadableIcon {
|
|
|
468
495
|
* Currently, only 3 or 4 samples per pixel are supported.
|
|
469
496
|
*/
|
|
470
497
|
readonly n_channels: number
|
|
498
|
+
/**
|
|
499
|
+
* The number of samples per pixel.
|
|
500
|
+
*
|
|
501
|
+
* Currently, only 3 or 4 samples per pixel are supported.
|
|
502
|
+
*/
|
|
503
|
+
readonly nChannels: number
|
|
471
504
|
readonly pixel_bytes: GLib.Bytes
|
|
505
|
+
readonly pixelBytes: GLib.Bytes
|
|
472
506
|
/**
|
|
473
507
|
* A pointer to the pixel data of the pixbuf.
|
|
474
508
|
*/
|
package/gdkpixbuf-2.0.d.ts
CHANGED
|
@@ -436,6 +436,23 @@ module Pixbuf {
|
|
|
436
436
|
* The number of columns of the pixbuf.
|
|
437
437
|
*/
|
|
438
438
|
width?: number | null
|
|
439
|
+
/**
|
|
440
|
+
* The number of bits per sample.
|
|
441
|
+
*
|
|
442
|
+
* Currently only 8 bit per sample are supported.
|
|
443
|
+
*/
|
|
444
|
+
bitsPerSample?: number | null
|
|
445
|
+
/**
|
|
446
|
+
* Whether the pixbuf has an alpha channel.
|
|
447
|
+
*/
|
|
448
|
+
hasAlpha?: boolean | null
|
|
449
|
+
/**
|
|
450
|
+
* The number of samples per pixel.
|
|
451
|
+
*
|
|
452
|
+
* Currently, only 3 or 4 samples per pixel are supported.
|
|
453
|
+
*/
|
|
454
|
+
nChannels?: number | null
|
|
455
|
+
pixelBytes?: GLib.Bytes | null
|
|
439
456
|
}
|
|
440
457
|
|
|
441
458
|
}
|
|
@@ -450,6 +467,12 @@ interface Pixbuf extends Gio.Icon, Gio.LoadableIcon {
|
|
|
450
467
|
* Currently only 8 bit per sample are supported.
|
|
451
468
|
*/
|
|
452
469
|
readonly bits_per_sample: number
|
|
470
|
+
/**
|
|
471
|
+
* The number of bits per sample.
|
|
472
|
+
*
|
|
473
|
+
* Currently only 8 bit per sample are supported.
|
|
474
|
+
*/
|
|
475
|
+
readonly bitsPerSample: number
|
|
453
476
|
/**
|
|
454
477
|
* The color space of the pixbuf.
|
|
455
478
|
*
|
|
@@ -460,6 +483,10 @@ interface Pixbuf extends Gio.Icon, Gio.LoadableIcon {
|
|
|
460
483
|
* Whether the pixbuf has an alpha channel.
|
|
461
484
|
*/
|
|
462
485
|
readonly has_alpha: boolean
|
|
486
|
+
/**
|
|
487
|
+
* Whether the pixbuf has an alpha channel.
|
|
488
|
+
*/
|
|
489
|
+
readonly hasAlpha: boolean
|
|
463
490
|
/**
|
|
464
491
|
* The number of rows of the pixbuf.
|
|
465
492
|
*/
|
|
@@ -470,7 +497,14 @@ interface Pixbuf extends Gio.Icon, Gio.LoadableIcon {
|
|
|
470
497
|
* Currently, only 3 or 4 samples per pixel are supported.
|
|
471
498
|
*/
|
|
472
499
|
readonly n_channels: number
|
|
500
|
+
/**
|
|
501
|
+
* The number of samples per pixel.
|
|
502
|
+
*
|
|
503
|
+
* Currently, only 3 or 4 samples per pixel are supported.
|
|
504
|
+
*/
|
|
505
|
+
readonly nChannels: number
|
|
473
506
|
readonly pixel_bytes: GLib.Bytes
|
|
507
|
+
readonly pixelBytes: GLib.Bytes
|
|
474
508
|
/**
|
|
475
509
|
* A pointer to the pixel data of the pixbuf.
|
|
476
510
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/gdkpixbuf-2.0",
|
|
3
|
-
"version": "2.0.0-3.2.
|
|
3
|
+
"version": "2.0.0-3.2.6",
|
|
4
4
|
"description": "GJS TypeScript type definitions for GdkPixbuf-2.0, generated from library version 2.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "gdkpixbuf-2.0.js",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"test:cjs": "NODE_OPTIONS=--max_old_space_size=9216 tsc --noEmit gdkpixbuf-2.0.d.cts"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@girs/gio-2.0": "^2.78.0-3.2.
|
|
29
|
-
"@girs/gjs": "^3.2.
|
|
30
|
-
"@girs/glib-2.0": "^2.78.0-3.2.
|
|
31
|
-
"@girs/gmodule-2.0": "^2.0.0-3.2.
|
|
32
|
-
"@girs/gobject-2.0": "^2.78.0-3.2.
|
|
28
|
+
"@girs/gio-2.0": "^2.78.0-3.2.6",
|
|
29
|
+
"@girs/gjs": "^3.2.6",
|
|
30
|
+
"@girs/glib-2.0": "^2.78.0-3.2.6",
|
|
31
|
+
"@girs/gmodule-2.0": "^2.0.0-3.2.6",
|
|
32
|
+
"@girs/gobject-2.0": "^2.78.0-3.2.6"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "*"
|