@girs/gtk4layershell-1.0 1.0.0-4.0.0-beta.16

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 ADDED
@@ -0,0 +1,86 @@
1
+
2
+ # Gtk4LayerShell-1.0
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/gtk4layershell-1.0)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/gtk4layershell-1.0)
6
+
7
+
8
+ GJS TypeScript type definitions for Gtk4LayerShell-1.0, generated from library version 1.0.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.16.
9
+
10
+
11
+ ## Install
12
+
13
+ To use this type definitions, install them with NPM:
14
+ ```bash
15
+ npm install @girs/gtk4layershell-1.0
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ You can import this package into your project like this:
21
+ ```ts
22
+ import Gtk4LayerShell from '@girs/gtk4layershell-1.0';
23
+ ```
24
+
25
+ ### Ambient Modules
26
+
27
+ You can also use [ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) to import this module like you would do this in JavaScript.
28
+ For this you need to include `@girs/gtk4layershell-1.0` or `@girs/gtk4layershell-1.0/ambient` in your `tsconfig` or entry point Typescript file:
29
+
30
+ `index.ts`:
31
+ ```ts
32
+ import '@girs/gtk4layershell-1.0'
33
+ ```
34
+
35
+ `tsconfig.json`:
36
+ ```json
37
+ {
38
+ "compilerOptions": {
39
+ ...
40
+ },
41
+ "include": ["@girs/gtk4layershell-1.0"],
42
+ ...
43
+ }
44
+ ```
45
+
46
+ Now you can import the ambient module with TypeScript support:
47
+
48
+ ```ts
49
+ import Gtk4LayerShell from 'gi://Gtk4LayerShell?version=1.0';
50
+ ```
51
+
52
+ ### Global import
53
+
54
+ You can also import the module with Typescript support using the global `imports.gi` object of GJS.
55
+ For this you need to include `@girs/gtk4layershell-1.0` or `@girs/gtk4layershell-1.0/import` in your `tsconfig` or entry point Typescript file:
56
+
57
+ `index.ts`:
58
+ ```ts
59
+ import '@girs/gtk4layershell-1.0'
60
+ ```
61
+
62
+ `tsconfig.json`:
63
+ ```json
64
+ {
65
+ "compilerOptions": {
66
+ ...
67
+ },
68
+ "include": ["@girs/gtk4layershell-1.0"],
69
+ ...
70
+ }
71
+ ```
72
+
73
+ Now you have also type support for this, too:
74
+
75
+ ```ts
76
+ const Gtk4LayerShell = imports.gi.Gtk4LayerShell;
77
+ ```
78
+
79
+ ### Bundle
80
+
81
+ 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).
82
+
83
+ ## Other packages
84
+
85
+ All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
86
+
@@ -0,0 +1,9 @@
1
+ declare module 'gi://Gtk4LayerShell?version=1.0' {
2
+ import Gtk4LayerShell10 from '@girs/gtk4layershell-1.0';
3
+ export default Gtk4LayerShell10;
4
+ }
5
+
6
+ declare module 'gi://Gtk4LayerShell' {
7
+ import Gtk4LayerShell10 from 'gi://Gtk4LayerShell?version=1.0';
8
+ export default Gtk4LayerShell10;
9
+ }
@@ -0,0 +1,2 @@
1
+ export {}
2
+
@@ -0,0 +1,9 @@
1
+ import Gtk4LayerShell10 from '@girs/gtk4layershell-1.0';
2
+
3
+ declare global {
4
+ export interface GjsGiImports {
5
+ Gtk4LayerShell: typeof Gtk4LayerShell10;
6
+ }
7
+ }
8
+
9
+ export default GjsGiImports;
@@ -0,0 +1,3 @@
1
+ const gi = globalThis.imports?.gi || {};
2
+ export default gi;
3
+
@@ -0,0 +1,249 @@
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
+ * The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
8
+ */
9
+
10
+ // Module dependencies
11
+ import type Gtk from '@girs/gtk-4.0';
12
+ import type Gsk from '@girs/gsk-4.0';
13
+ import type Graphene from '@girs/graphene-1.0';
14
+ import type GObject from '@girs/gobject-2.0';
15
+ import type GLib from '@girs/glib-2.0';
16
+ import type Gdk from '@girs/gdk-4.0';
17
+ import type cairo from '@girs/cairo-1.0';
18
+ import type PangoCairo from '@girs/pangocairo-1.0';
19
+ import type Pango from '@girs/pango-1.0';
20
+ import type HarfBuzz from '@girs/harfbuzz-0.0';
21
+ import type freetype2 from '@girs/freetype2-2.0';
22
+ import type Gio from '@girs/gio-2.0';
23
+ import type GModule from '@girs/gmodule-2.0';
24
+ import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
25
+
26
+ export namespace Gtk4LayerShell {
27
+ /**
28
+ * Gtk4LayerShell-1.0
29
+ */
30
+
31
+ export namespace Edge {
32
+ export const $gtype: GObject.GType<Edge>;
33
+ }
34
+
35
+ enum Edge {
36
+ /**
37
+ * The left edge of the screen.
38
+ */
39
+ LEFT,
40
+ /**
41
+ * The right edge of the screen.
42
+ */
43
+ RIGHT,
44
+ /**
45
+ * The top edge of the screen.
46
+ */
47
+ TOP,
48
+ /**
49
+ * The bottom edge of the screen.
50
+ */
51
+ BOTTOM,
52
+ /**
53
+ * Should not be used except to get the number of entries. (NOTE: may change in
54
+ * future releases as more entries are added)
55
+ */
56
+ ENTRY_NUMBER,
57
+ }
58
+
59
+ export namespace KeyboardMode {
60
+ export const $gtype: GObject.GType<KeyboardMode>;
61
+ }
62
+
63
+ enum KeyboardMode {
64
+ /**
65
+ * This window should not receive keyboard events.
66
+ */
67
+ NONE,
68
+ /**
69
+ * This window should have exclusive focus if it is on the top or overlay layer.
70
+ */
71
+ EXCLUSIVE,
72
+ /**
73
+ * The user should be able to focus and unfocues this window in an implementation
74
+ * defined way. Not supported for protocol version < 4.
75
+ */
76
+ ON_DEMAND,
77
+ /**
78
+ * Should not be used except to get the number of entries. (NOTE: may change in
79
+ * future releases as more entries are added)
80
+ */
81
+ ENTRY_NUMBER,
82
+ }
83
+
84
+ export namespace Layer {
85
+ export const $gtype: GObject.GType<Layer>;
86
+ }
87
+
88
+ enum Layer {
89
+ /**
90
+ * The background layer.
91
+ */
92
+ BACKGROUND,
93
+ /**
94
+ * The bottom layer.
95
+ */
96
+ BOTTOM,
97
+ /**
98
+ * The top layer.
99
+ */
100
+ TOP,
101
+ /**
102
+ * The overlay layer.
103
+ */
104
+ OVERLAY,
105
+ /**
106
+ * Should not be used except to get the number of entries. (NOTE: may change in
107
+ * future releases as more entries are added)
108
+ */
109
+ ENTRY_NUMBER,
110
+ }
111
+ /**
112
+ * When auto exclusive zone is enabled, exclusive zone is automatically set to the
113
+ * size of the `window` + relevant margin. To disable auto exclusive zone, just set the
114
+ * exclusive zone to 0 or any other fixed value.
115
+ *
116
+ * NOTE: you can control the auto exclusive zone by changing the margin on the non-anchored
117
+ * edge. This behavior is specific to gtk4-layer-shell and not part of the underlying protocol
118
+ * @param window A layer surface.
119
+ */
120
+ function auto_exclusive_zone_enable(window: Gtk.Window): void;
121
+ function auto_exclusive_zone_is_enabled(window: Gtk.Window): boolean;
122
+ function get_anchor(window: Gtk.Window, edge: Edge): boolean;
123
+ function get_exclusive_zone(window: Gtk.Window): number;
124
+ function get_keyboard_mode(window: Gtk.Window): KeyboardMode;
125
+ function get_layer(window: Gtk.Window): Layer;
126
+ function get_major_version(): number;
127
+ function get_margin(window: Gtk.Window, edge: Edge): number;
128
+ function get_micro_version(): number;
129
+ function get_minor_version(): number;
130
+ /**
131
+ * NOTE: To get which monitor the surface is actually on, use
132
+ * gdk_display_get_monitor_at_window().
133
+ * @param window A layer surface.
134
+ * @returns the monitor this surface will/has requested to be on, can be %NULL.
135
+ */
136
+ function get_monitor(window: Gtk.Window): Gdk.Monitor;
137
+ /**
138
+ * NOTE: this function does not return ownership of the string. Do not free the returned string.
139
+ * Future calls into the library may invalidate the returned string.
140
+ * @param window A layer surface.
141
+ * @returns a reference to the namespace property. If namespace is unset, returns the default namespace ("gtk4-layer-shell"). Never returns %NULL.
142
+ */
143
+ function get_namespace(window: Gtk.Window): string;
144
+ /**
145
+ * May block for a Wayland roundtrip the first time it's called.
146
+ * @returns version of the zwlr_layer_shell_v1 protocol supported by the compositor or 0 if the protocol is not supported.
147
+ */
148
+ function get_protocol_version(): number;
149
+ function get_zwlr_layer_surface_v1(window: Gtk.Window): any | null;
150
+ /**
151
+ * Set the `window` up to be a layer surface once it is mapped. this must be called before
152
+ * the `window` is realized.
153
+ * @param window A #GtkWindow to be turned into a layer surface.
154
+ */
155
+ function init_for_window(window: Gtk.Window): void;
156
+ function is_layer_window(window: Gtk.Window): boolean;
157
+ /**
158
+ * May block for a Wayland roundtrip the first time it's called.
159
+ * @returns %TRUE if the platform is Wayland and Wayland compositor supports the zwlr_layer_shell_v1 protocol.
160
+ */
161
+ function is_supported(): boolean;
162
+ /**
163
+ * Set whether `window` should be anchored to `edge`.
164
+ * - If two perpendicular edges are anchored, the surface with be anchored to that corner
165
+ * - If two opposite edges are anchored, the window will be stretched across the screen in that direction
166
+ *
167
+ * Default is %FALSE for each #GtkLayerShellEdge
168
+ * @param window A layer surface.
169
+ * @param edge A #GtkLayerShellEdge this layer surface may be anchored to.
170
+ * @param anchor_to_edge Whether or not to anchor this layer surface to @edge.
171
+ */
172
+ function set_anchor(window: Gtk.Window, edge: Edge, anchor_to_edge: boolean): void;
173
+ /**
174
+ * Has no effect unless the surface is anchored to an edge. Requests that the compositor
175
+ * does not place other surfaces within the given exclusive zone of the anchored edge.
176
+ * For example, a panel can request to not be covered by maximized windows. See
177
+ * wlr-layer-shell-unstable-v1.xml for details.
178
+ *
179
+ * Default is 0
180
+ * @param window A layer surface.
181
+ * @param exclusive_zone The size of the exclusive zone.
182
+ */
183
+ function set_exclusive_zone(window: Gtk.Window, exclusive_zone: number): void;
184
+ /**
185
+ * Sets if/when `window` should receive keyboard events from the compositor, see
186
+ * GtkLayerShellKeyboardMode for details.
187
+ *
188
+ * Default is %GTK_LAYER_SHELL_KEYBOARD_MODE_NONE
189
+ * @param window A layer surface.
190
+ * @param mode The type of keyboard interactivity requested.
191
+ */
192
+ function set_keyboard_mode(window: Gtk.Window, mode: KeyboardMode): void;
193
+ /**
194
+ * Set the "layer" on which the surface appears (controls if it is over top of or below other surfaces). The layer may
195
+ * be changed on-the-fly in the current version of the layer shell protocol, but on compositors that only support an
196
+ * older version the `window` is remapped so the change can take effect.
197
+ *
198
+ * Default is %GTK_LAYER_SHELL_LAYER_TOP
199
+ * @param window A layer surface.
200
+ * @param layer The layer on which this surface appears.
201
+ */
202
+ function set_layer(window: Gtk.Window, layer: Layer): void;
203
+ /**
204
+ * Set the margin for a specific `edge` of a `window`. Effects both surface's distance from
205
+ * the edge and its exclusive zone size (if auto exclusive zone enabled).
206
+ *
207
+ * Default is 0 for each #GtkLayerShellEdge
208
+ * @param window A layer surface.
209
+ * @param edge The #GtkLayerShellEdge for which to set the margin.
210
+ * @param margin_size The margin for @edge to be set.
211
+ */
212
+ function set_margin(window: Gtk.Window, edge: Edge, margin_size: number): void;
213
+ /**
214
+ * Set the output for the window to be placed on, or %NULL to let the compositor choose.
215
+ * If the window is currently mapped, it will get remapped so the change can take effect.
216
+ *
217
+ * Default is %NULL
218
+ * @param window A layer surface.
219
+ * @param monitor The output this layer surface will be placed on (%NULL to let the compositor decide).
220
+ */
221
+ function set_monitor(window: Gtk.Window, monitor: Gdk.Monitor): void;
222
+ /**
223
+ * Set the "namespace" of the surface.
224
+ *
225
+ * No one is quite sure what this is for, but it probably should be something generic
226
+ * ("panel", "osk", etc). The `name_space` string is copied, and caller maintains
227
+ * ownership of original. If the window is currently mapped, it will get remapped so
228
+ * the change can take effect.
229
+ *
230
+ * Default is "gtk4-layer-shell" (which will be used if set to %NULL)
231
+ * @param window A layer surface.
232
+ * @param name_space The namespace of this layer surface.
233
+ */
234
+ function set_namespace(window: Gtk.Window, name_space: string): void;
235
+ /**
236
+ * Name of the imported GIR library
237
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
238
+ */
239
+ const __name__: string;
240
+ /**
241
+ * Version of the imported GIR library
242
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
243
+ */
244
+ const __version__: string;
245
+ }
246
+
247
+ export default Gtk4LayerShell;
248
+
249
+ // END
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import Gtk4LayerShell from 'gi://Gtk4LayerShell?version=1.0';
4
+ export default Gtk4LayerShell;
5
+
package/index.d.ts ADDED
@@ -0,0 +1,15 @@
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 './gtk4layershell-1.0-ambient.d.ts';
11
+
12
+ import './gtk4layershell-1.0-import.d.ts';
13
+
14
+ import Gtk4LayerShell from './gtk4layershell-1.0.js';
15
+ export default Gtk4LayerShell;
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import Gtk4LayerShell from './gtk4layershell-1.0.js';
4
+ export default Gtk4LayerShell;
5
+
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@girs/gtk4layershell-1.0",
3
+ "version": "1.0.0-4.0.0-beta.16",
4
+ "description": "GJS TypeScript type definitions for Gtk4LayerShell-1.0, generated from library version 1.0.0",
5
+ "type": "module",
6
+ "module": "gtk4layershell-1.0.js",
7
+ "main": "gtk4layershell-1.0.js",
8
+ "exports": {
9
+ "./ambient": {
10
+ "types": "./gtk4layershell-1.0-ambient.d.ts",
11
+ "import": "./gtk4layershell-1.0-ambient.js",
12
+ "default": "./gtk4layershell-1.0-ambient.js"
13
+ },
14
+ "./import": {
15
+ "types": "./gtk4layershell-1.0-import.d.ts",
16
+ "import": "./gtk4layershell-1.0-import.js",
17
+ "default": "./gtk4layershell-1.0-import.js"
18
+ },
19
+ "./gtk4layershell-1.0": {
20
+ "types": "./gtk4layershell-1.0.d.ts",
21
+ "import": "./gtk4layershell-1.0.js",
22
+ "default": "./gtk4layershell-1.0.js"
23
+ },
24
+ ".": {
25
+ "types": "./index.d.ts",
26
+ "import": "./index.js",
27
+ "default": "./index.js"
28
+ }
29
+ },
30
+ "scripts": {
31
+ "test": "tsc --project tsconfig.json"
32
+ },
33
+ "dependencies": {
34
+ "@girs/cairo-1.0": "^1.0.0-4.0.0-beta.16",
35
+ "@girs/freetype2-2.0": "^2.0.0-4.0.0-beta.16",
36
+ "@girs/gdk-4.0": "^4.0.0-4.0.0-beta.16",
37
+ "@girs/gdkpixbuf-2.0": "^2.0.0-4.0.0-beta.16",
38
+ "@girs/gio-2.0": "^2.82.0-4.0.0-beta.16",
39
+ "@girs/gjs": "^4.0.0-beta.16",
40
+ "@girs/glib-2.0": "^2.82.0-4.0.0-beta.16",
41
+ "@girs/gmodule-2.0": "^2.0.0-4.0.0-beta.16",
42
+ "@girs/gobject-2.0": "^2.82.0-4.0.0-beta.16",
43
+ "@girs/graphene-1.0": "^1.0.0-4.0.0-beta.16",
44
+ "@girs/gsk-4.0": "^4.0.0-4.0.0-beta.16",
45
+ "@girs/gtk-4.0": "^4.15.5-4.0.0-beta.16",
46
+ "@girs/harfbuzz-0.0": "^9.0.0-4.0.0-beta.16",
47
+ "@girs/pango-1.0": "^1.54.0-4.0.0-beta.16",
48
+ "@girs/pangocairo-1.0": "^1.0.0-4.0.0-beta.16"
49
+ },
50
+ "devDependencies": {
51
+ "typescript": "*"
52
+ },
53
+ "keywords": [
54
+ "Gir",
55
+ "TypeScript",
56
+ "types",
57
+ "GObject-Introspection",
58
+ "GJS",
59
+ "Gtk4LayerShell-1.0"
60
+ ],
61
+ "author": "ts-for-gir",
62
+ "license": "MIT",
63
+ "repository": {
64
+ "type": "git",
65
+ "url": "git+https://github.com/gjsify/ts-for-gir.git"
66
+ },
67
+ "bugs": {
68
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
69
+ },
70
+ "homepage": "https://github.com/gjsify/types/tree/main/gtk4layershell-1.0#readme"
71
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ // General settings for code interpretation
4
+ "target": "ESNext",
5
+ "module": "NodeNext",
6
+ "lib": ["ESNext"],
7
+ "types": [],
8
+ "experimentalDecorators": true,
9
+ "moduleResolution": "NodeNext",
10
+ "noEmit": true,
11
+ "noEmitOnError": false,
12
+ "baseUrl": "./",
13
+ "rootDir": ".",
14
+ // General settings for code generation
15
+ "removeComments": false,
16
+ "inlineSourceMap": false,
17
+ "inlineSources": false,
18
+ "newLine": "LF"
19
+ },
20
+ "include": ["./gtk4layershell-1.0.d.ts"]
21
+ }
22
+
23
+
package/typedoc.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "entryPoints": ["./gtk4layershell-1.0.d.ts"],
3
+ "readme": "./README.md",
4
+ "name": "Gtk4LayerShell-1.0",
5
+ "tsconfig": "./tsconfig.json"
6
+ }
7
+