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