@girs/gdkwin32-4.0 4.3.0 → 4.5.0

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 (3) hide show
  1. package/README.md +36 -41
  2. package/gdkwin32-4.0.d.ts +26 -5
  3. package/package.json +14 -14
package/README.md CHANGED
@@ -4,82 +4,77 @@
4
4
  ![version](https://img.shields.io/npm/v/@girs/gdkwin32-4.0)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gdkwin32-4.0)
6
6
 
7
+ GJS TypeScript type definitions for GdkWin32-4.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.5.0.
7
8
 
8
- GJS TypeScript type definitions for GdkWin32-4.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.3.0.
9
+ This package contains type declarations only. It ships no runtime code, so it adds
10
+ nothing to your program and works with any bundler or none at all.
9
11
 
10
12
  ## Install
11
13
 
12
- Install the type definitions with npm:
13
14
  ```bash
14
15
  npm install @girs/gdkwin32-4.0
15
16
  ```
16
17
 
17
- ## Usage
18
+ Any package manager works. The package has no dependencies beyond other `@girs/*`
19
+ type packages.
20
+
21
+ ## What it exports
22
+
23
+ | Import | What you get |
24
+ |---|---|
25
+ | `@girs/gdkwin32-4.0` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/gdkwin32-4.0/ambient` | only the `gi://` module declarations |
27
+ | `@girs/gdkwin32-4.0/import` | only the `imports.gi` declarations |
28
+ | `@girs/gdkwin32-4.0/gdkwin32-4.0` | the namespace, without the side-effecting declarations |
29
+
30
+ ## Three ways to import
31
+
32
+ Which one you use depends on how you write imports elsewhere, not on your toolchain.
33
+
34
+ ### As a module
18
35
 
19
- Import it like any other module:
20
36
  ```ts
21
37
  import GdkWin32 from '@girs/gdkwin32-4.0';
22
38
  ```
23
39
 
24
- ### Ambient Modules
40
+ ### As `gi://`
25
41
 
26
- [Ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) let you write the same import you would in plain JavaScript.
27
- For this you need to include `@girs/gdkwin32-4.0` or `@girs/gdkwin32-4.0/ambient` in your `tsconfig` or entry point Typescript file:
42
+ GJS resolves `gi://` at runtime. To give it types, reference the package once, either
43
+ from your entry point or from `tsconfig.json`:
28
44
 
29
- `index.ts`:
30
45
  ```ts
31
- import '@girs/gdkwin32-4.0'
46
+ import '@girs/gdkwin32-4.0';
32
47
  ```
33
48
 
34
- `tsconfig.json`:
35
49
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/gdkwin32-4.0"],
41
- ...
42
- }
50
+ { "include": ["@girs/gdkwin32-4.0"] }
43
51
  ```
44
52
 
45
- The ambient module now resolves with types:
53
+ Then the runtime spelling type-checks:
46
54
 
47
55
  ```ts
48
56
  import GdkWin32 from 'gi://GdkWin32?version=4.0';
49
57
  ```
50
58
 
51
- ### Global import
52
-
53
- GJS's global `imports.gi` works too, with types.
54
- For this you need to include `@girs/gdkwin32-4.0` or `@girs/gdkwin32-4.0/import` in your `tsconfig` or entry point Typescript file:
59
+ Referencing `@girs/gdkwin32-4.0/ambient` instead pulls in these declarations
60
+ alone. See [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules).
55
61
 
56
- `index.ts`:
57
- ```ts
58
- import '@girs/gdkwin32-4.0'
59
- ```
60
-
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/gdkwin32-4.0"],
68
- ...
69
- }
70
- ```
62
+ ### As `imports.gi`
71
63
 
72
- That form carries types as well:
64
+ GJS's global object works the same way, via `@girs/gdkwin32-4.0/import`:
73
65
 
74
66
  ```ts
75
67
  const GdkWin32 = imports.gi.GdkWin32;
76
68
  ```
77
69
 
78
- ### Bundle
70
+ ## Building
79
71
 
80
- Most projects want a bundler. [esbuild](https://esbuild.github.io/) is the smallest thing that works; the [examples directory](https://github.com/gjsify/ts-for-gir/tree/main/examples) has setups for several others.
72
+ The declarations need no build step. If you bundle, every bundler works, since there is
73
+ no runtime code to resolve. The [examples](https://github.com/gjsify/ts-for-gir/tree/main/examples)
74
+ show working setups for several.
81
75
 
82
76
  ## Other packages
83
77
 
84
- All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
78
+ Every pre-generated package is at [gjsify/types](https://github.com/gjsify/types).
79
+
85
80
 
package/gdkwin32-4.0.d.ts CHANGED
@@ -42,16 +42,16 @@ export namespace GdkWin32 {
42
42
  * is not Windows, the Windows version is not recent enough, or it was explicitly
43
43
  * disabled at compile- or runtime
44
44
  */
45
- NOT_AVAILABLE,
45
+ NOT_AVAILABLE = 0,
46
46
  /**
47
47
  * The requested format is not supported
48
48
  */
49
- UNSUPPORTED_FORMAT,
49
+ UNSUPPORTED_FORMAT = 1,
50
50
  /**
51
51
  * GTK failed to create the resource for other
52
52
  * reasons
53
53
  */
54
- CREATION_FAILED,
54
+ CREATION_FAILED = 2,
55
55
  }
56
56
 
57
57
 
@@ -63,11 +63,11 @@ export namespace GdkWin32 {
63
63
  /**
64
64
  * event not handled, continue processing.
65
65
  */
66
- CONTINUE,
66
+ CONTINUE = 0,
67
67
  /**
68
68
  * event handled, terminate processing.
69
69
  */
70
- REMOVE,
70
+ REMOVE = 1,
71
71
  }
72
72
 
73
73
 
@@ -378,6 +378,7 @@ export namespace GdkWin32 {
378
378
  * makes sense to transfer the {@link GLib.Variant} between processes on the same machine,
379
379
  * (as opposed to over the network), and within the same file system namespace.
380
380
  * @returns a {@link GLib.Variant}, or `null` when serialization fails. The {@link GLib.Variant} will not be floating.
381
+ * @since 2.38
381
382
  */
382
383
  serialize(): GLib.Variant | null;
383
384
 
@@ -399,6 +400,7 @@ export namespace GdkWin32 {
399
400
  * - If `icon` is a {@link Gio.ThemedIcon} with exactly one name and no fallbacks,
400
401
  * the encoding is simply the name (such as `network-server`).
401
402
  * @returns An allocated NUL-terminated UTF8 string or `null` if `icon` can't be serialized. Use `g_free()` to free.
403
+ * @since 2.20
402
404
  */
403
405
  to_string(): string | null;
404
406
 
@@ -421,6 +423,7 @@ export namespace GdkWin32 {
421
423
  * As serialization will avoid using raw icon data when possible, it only
422
424
  * makes sense to transfer the {@link GLib.Variant} between processes on the same machine,
423
425
  * (as opposed to over the network), and within the same file system namespace.
426
+ * @since 2.38
424
427
  * @virtual
425
428
  */
426
429
  vfunc_serialize(): GLib.Variant | null;
@@ -428,6 +431,7 @@ export namespace GdkWin32 {
428
431
  /**
429
432
  * Serializes the `icon` into string tokens.
430
433
  * This is can be invoked when `g_icon_new_for_string()` is called.
434
+ * @since 2.20
431
435
  * @virtual
432
436
  */
433
437
  vfunc_to_tokens(): [boolean, string[], number];
@@ -438,6 +442,7 @@ export namespace GdkWin32 {
438
442
  * @param size an integer.
439
443
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
440
444
  * @returns a {@link Gio.InputStream} to read the icon from.
445
+ * @throws GLib.Error
441
446
  */
442
447
  load(size: number, cancellable: Gio.Cancellable | null): [Gio.InputStream, string];
443
448
 
@@ -474,6 +479,7 @@ export namespace GdkWin32 {
474
479
  * Finishes an asynchronous icon load started in `g_loadable_icon_load_async()`.
475
480
  * @param res a {@link Gio.AsyncResult}.
476
481
  * @returns a {@link Gio.InputStream} to read the icon from.
482
+ * @throws GLib.Error
477
483
  */
478
484
  load_finish(res: Gio.AsyncResult): [Gio.InputStream, string];
479
485
 
@@ -685,12 +691,15 @@ export namespace GdkWin32 {
685
691
  * possibly with changing properties in between.
686
692
  * @param data user data to pass to the destroy function
687
693
  * @returns a newly built {@link Gdk.Texture} or `NULL` if the format is not supported
694
+ * @since 4.20
695
+ * @throws GLib.Error
688
696
  */
689
697
  build(data: null): Gdk.Texture | null;
690
698
 
691
699
  /**
692
700
  * Gets the color state previously set via `gdk_d3d12_texture_builder_set_color_state()`.
693
701
  * @returns the color state
702
+ * @since 4.20
694
703
  */
695
704
  get_color_state(): Gdk.ColorState | null;
696
705
 
@@ -698,12 +707,14 @@ export namespace GdkWin32 {
698
707
  * Returns the value that GTK should wait for on the fence
699
708
  * before using the resource.
700
709
  * @returns the fence wait value
710
+ * @since 4.20
701
711
  */
702
712
  get_fence_wait(): number;
703
713
 
704
714
  /**
705
715
  * Whether the data is premultiplied.
706
716
  * @returns whether the data is premultiplied
717
+ * @since 4.20
707
718
  */
708
719
  get_premultiplied(): boolean;
709
720
 
@@ -711,6 +722,7 @@ export namespace GdkWin32 {
711
722
  * Gets the region previously set via `gdk_d3d12_texture_builder_set_update_region()` or
712
723
  * `null` if none was set.
713
724
  * @returns The region
725
+ * @since 4.20
714
726
  */
715
727
  get_update_region(): cairo.Region | null;
716
728
 
@@ -718,6 +730,7 @@ export namespace GdkWin32 {
718
730
  * Gets the texture previously set via `gdk_d3d12_texture_builder_set_update_texture()` or
719
731
  * `null` if none was set.
720
732
  * @returns The texture
733
+ * @since 4.20
721
734
  */
722
735
  get_update_texture(): Gdk.Texture | null;
723
736
 
@@ -728,6 +741,7 @@ export namespace GdkWin32 {
728
741
  * correct colorstate based on the format.
729
742
  * If you don't know what colorstates are, this is probably the right thing.
730
743
  * @param color_state a {@link Gdk.ColorState} or `NULL` to unset the colorstate.
744
+ * @since 4.20
731
745
  */
732
746
  set_color_state(color_state: Gdk.ColorState | null): void;
733
747
 
@@ -737,6 +751,7 @@ export namespace GdkWin32 {
737
751
  *
738
752
  * When no fence is set, this value has no effect.
739
753
  * @param fence_wait the value to wait on
754
+ * @since 4.20
740
755
  */
741
756
  set_fence_wait(fence_wait: bigint | number): void;
742
757
 
@@ -746,6 +761,7 @@ export namespace GdkWin32 {
746
761
  * Unless otherwise specified, all formats including alpha channels are assumed
747
762
  * to be premultiplied.
748
763
  * @param premultiplied whether the data is premultiplied
764
+ * @since 4.20
749
765
  */
750
766
  set_premultiplied(premultiplied: boolean): void;
751
767
 
@@ -761,6 +777,7 @@ export namespace GdkWin32 {
761
777
  *
762
778
  * An example would be a screen recording where only the mouse pointer moves.
763
779
  * @param region the region to update
780
+ * @since 4.20
764
781
  */
765
782
  set_update_region(region: cairo.Region | null): void;
766
783
 
@@ -768,6 +785,7 @@ export namespace GdkWin32 {
768
785
  * Sets the texture to be updated by this texture. See
769
786
  * {@link Gdk.D3d12TextureBuilder.set_update_region} for an explanation.
770
787
  * @param texture the texture to update
788
+ * @since 4.20
771
789
  */
772
790
  set_update_texture(texture: Gdk.Texture | null): void;
773
791
  }
@@ -840,6 +858,7 @@ export namespace GdkWin32 {
840
858
  /**
841
859
  * Retrieves the EGL display connection object for the given GDK display.
842
860
  * @returns the EGL display
861
+ * @since 4.4
843
862
  */
844
863
  get_egl_display(): null;
845
864
 
@@ -1202,11 +1221,13 @@ export namespace GdkWin32 {
1202
1221
  // Static methods
1203
1222
  /**
1204
1223
  * @param surface a {@link Gdk.Surface}
1224
+ * @deprecated since 4.8: Use `gdk_win32_surface_get_handle()` instead.
1205
1225
  */
1206
1226
  static get_impl_hwnd(surface: Gdk.Surface): win32.HWND;
1207
1227
 
1208
1228
  /**
1209
1229
  * @param surface a {@link Gdk.Surface}
1230
+ * @deprecated since 4.8: Use `GDK_IS_WIN32_SURFACE` instead.
1210
1231
  */
1211
1232
  static is_win32(surface: Gdk.Surface): boolean;
1212
1233
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gdkwin32-4.0",
3
- "version": "4.3.0",
3
+ "version": "4.5.0",
4
4
  "description": "GJS TypeScript type definitions for GdkWin32-4.0",
5
5
  "type": "module",
6
6
  "module": "gdkwin32-4.0.js",
@@ -31,19 +31,19 @@
31
31
  "test": "tsc --project tsconfig.json"
32
32
  },
33
33
  "dependencies": {
34
- "@girs/gjs": "^4.3.0",
35
- "@girs/win32-1.0": "^4.3.0",
36
- "@girs/gdk-4.0": "^4.3.0",
37
- "@girs/cairo-1.0": "^4.3.0",
38
- "@girs/gobject-2.0": "^4.3.0",
39
- "@girs/glib-2.0": "^4.3.0",
40
- "@girs/pangocairo-1.0": "^4.3.0",
41
- "@girs/pango-1.0": "^4.3.0",
42
- "@girs/harfbuzz-0.0": "^4.3.0",
43
- "@girs/freetype2-2.0": "^4.3.0",
44
- "@girs/gio-2.0": "^4.3.0",
45
- "@girs/gmodule-2.0": "^4.3.0",
46
- "@girs/gdkpixbuf-2.0": "^4.3.0" },
34
+ "@girs/gjs": "^4.5.0",
35
+ "@girs/win32-1.0": "^4.5.0",
36
+ "@girs/gdk-4.0": "^4.5.0",
37
+ "@girs/cairo-1.0": "^4.5.0",
38
+ "@girs/gobject-2.0": "^4.5.0",
39
+ "@girs/glib-2.0": "^4.5.0",
40
+ "@girs/pangocairo-1.0": "^4.5.0",
41
+ "@girs/pango-1.0": "^4.5.0",
42
+ "@girs/harfbuzz-0.0": "^4.5.0",
43
+ "@girs/freetype2-2.0": "^4.5.0",
44
+ "@girs/gio-2.0": "^4.5.0",
45
+ "@girs/gmodule-2.0": "^4.5.0",
46
+ "@girs/gdkpixbuf-2.0": "^4.5.0" },
47
47
  "devDependencies": {
48
48
  "typescript": "*"
49
49
  },