@girs/gtksessionlock-0.1 0.1.0-4.0.0-beta.41

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,85 @@
1
+
2
+ # GtkSessionLock-0.1
3
+
4
+ ![version](https://img.shields.io/npm/v/@girs/gtksessionlock-0.1)
5
+ ![downloads/week](https://img.shields.io/npm/dw/@girs/gtksessionlock-0.1)
6
+
7
+
8
+ GJS TypeScript type definitions for GtkSessionLock-0.1, generated from library version 0.1.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.0.0-beta.41.
9
+
10
+ ## Install
11
+
12
+ To use this type definitions, install them with NPM:
13
+ ```bash
14
+ npm install @girs/gtksessionlock-0.1
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ You can import this package into your project like this:
20
+ ```ts
21
+ import GtkSessionLock from '@girs/gtksessionlock-0.1';
22
+ ```
23
+
24
+ ### Ambient Modules
25
+
26
+ 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.
27
+ For this you need to include `@girs/gtksessionlock-0.1` or `@girs/gtksessionlock-0.1/ambient` in your `tsconfig` or entry point Typescript file:
28
+
29
+ `index.ts`:
30
+ ```ts
31
+ import '@girs/gtksessionlock-0.1'
32
+ ```
33
+
34
+ `tsconfig.json`:
35
+ ```json
36
+ {
37
+ "compilerOptions": {
38
+ ...
39
+ },
40
+ "include": ["@girs/gtksessionlock-0.1"],
41
+ ...
42
+ }
43
+ ```
44
+
45
+ Now you can import the ambient module with TypeScript support:
46
+
47
+ ```ts
48
+ import GtkSessionLock from 'gi://GtkSessionLock?version=0.1';
49
+ ```
50
+
51
+ ### Global import
52
+
53
+ You can also import the module with Typescript support using the global `imports.gi` object of GJS.
54
+ For this you need to include `@girs/gtksessionlock-0.1` or `@girs/gtksessionlock-0.1/import` in your `tsconfig` or entry point Typescript file:
55
+
56
+ `index.ts`:
57
+ ```ts
58
+ import '@girs/gtksessionlock-0.1'
59
+ ```
60
+
61
+ `tsconfig.json`:
62
+ ```json
63
+ {
64
+ "compilerOptions": {
65
+ ...
66
+ },
67
+ "include": ["@girs/gtksessionlock-0.1"],
68
+ ...
69
+ }
70
+ ```
71
+
72
+ Now you have also type support for this, too:
73
+
74
+ ```ts
75
+ const GtkSessionLock = imports.gi.GtkSessionLock;
76
+ ```
77
+
78
+ ### Bundle
79
+
80
+ 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).
81
+
82
+ ## Other packages
83
+
84
+ All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
85
+
@@ -0,0 +1,9 @@
1
+ declare module 'gi://GtkSessionLock?version=0.1' {
2
+ import GtkSessionLock01 from '@girs/gtksessionlock-0.1';
3
+ export default GtkSessionLock01;
4
+ }
5
+
6
+ declare module 'gi://GtkSessionLock' {
7
+ import GtkSessionLock01 from 'gi://GtkSessionLock?version=0.1';
8
+ export default GtkSessionLock01;
9
+ }
@@ -0,0 +1,2 @@
1
+ export {}
2
+
@@ -0,0 +1,9 @@
1
+ import type GtkSessionLock01 from '@girs/gtksessionlock-0.1';
2
+
3
+ declare global {
4
+ export interface GjsGiImports {
5
+ GtkSessionLock: typeof GtkSessionLock01;
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,212 @@
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
+ import '@girs/gjs';
11
+
12
+ // Module dependencies
13
+ import type Gtk from '@girs/gtk-3.0';
14
+ import type xlib from '@girs/xlib-2.0';
15
+ import type Gdk from '@girs/gdk-3.0';
16
+ import type cairo from 'cairo';
17
+ import type GObject from '@girs/gobject-2.0';
18
+ import type GLib from '@girs/glib-2.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
+ import type Atk from '@girs/atk-1.0';
26
+
27
+ export namespace GtkSessionLock {
28
+ /**
29
+ * GtkSessionLock-0.1
30
+ */
31
+
32
+ /**
33
+ * @param window A lock surface.
34
+ * @returns The underlying lock surface Wayland object
35
+ */
36
+ function get_ext_session_lock_surface_v1(window: Gtk.Window): any | null;
37
+ /**
38
+ * @returns the major version number of the GTK Session Lock library
39
+ */
40
+ function get_major_version(): number;
41
+ /**
42
+ * @returns the micro/patch version number of the GTK Session Lock library
43
+ */
44
+ function get_micro_version(): number;
45
+ /**
46
+ * @returns the minor version number of the GTK Session Lock library
47
+ */
48
+ function get_minor_version(): number;
49
+ /**
50
+ * May block for a Wayland roundtrip the first time it's called.
51
+ * @returns version of the ext_session_lock_v1 protocol supported by the compositor or 0 if the protocol is not supported.
52
+ */
53
+ function get_protocol_version(): number;
54
+ /**
55
+ * @param window A {@link Gtk.Window} that may or may not have a lock surface.
56
+ * @returns if `window` has been initialized as a lock surface.
57
+ */
58
+ function is_lock_window(window: Gtk.Window): boolean;
59
+ /**
60
+ * May block for a Wayland roundtrip the first time it's called.
61
+ * @returns `true` if the platform is Wayland and Wayland compositor supports the ext_session_lock_v1 protocol.
62
+ */
63
+ function is_supported(): boolean;
64
+ /**
65
+ * Prepare a new `SessionLockLock`. You should connect signals to it before
66
+ * calling its lock method.
67
+ * @returns A new `SessionLockLock`.
68
+ */
69
+ function prepare_lock(): Lock;
70
+ /**
71
+ * If the given window is a lock window, unmap the surface. This must be called
72
+ * before the window is unmapped (e.g. hidden).
73
+ * @param window
74
+ * @since 0.2
75
+ */
76
+ function unmap_lock_window(window: Gtk.Window): void;
77
+ namespace Lock {
78
+ // Signal signatures
79
+ interface SignalSignatures extends GObject.Object.SignalSignatures {
80
+ /**
81
+ * @signal
82
+ * @run-first
83
+ */
84
+ finished: () => void;
85
+ /**
86
+ * @signal
87
+ * @run-first
88
+ */
89
+ locked: () => void;
90
+ 'notify::lock-manager': (pspec: GObject.ParamSpec) => void;
91
+ 'notify::lock-obj': (pspec: GObject.ParamSpec) => void;
92
+ }
93
+
94
+ // Constructor properties interface
95
+
96
+ interface ConstructorProps extends GObject.Object.ConstructorProps {
97
+ lock_manager: any;
98
+ lockManager: any;
99
+ lock_obj: any;
100
+ lockObj: any;
101
+ }
102
+ }
103
+
104
+ /**
105
+ * @gir-type Class
106
+ */
107
+ class Lock extends GObject.Object {
108
+ static $gtype: GObject.GType<Lock>;
109
+
110
+ // Properties
111
+
112
+ /**
113
+ * @construct-only
114
+ */
115
+ get lock_manager(): any;
116
+ /**
117
+ * @construct-only
118
+ */
119
+ get lockManager(): any;
120
+ get lock_obj(): any;
121
+ set lock_obj(val: any);
122
+ get lockObj(): any;
123
+ set lockObj(val: any);
124
+
125
+ /**
126
+ * Compile-time signal type information.
127
+ *
128
+ * This instance property is generated only for TypeScript type checking.
129
+ * It is not defined at runtime and should not be accessed in JS code.
130
+ * @internal
131
+ */
132
+ $signals: Lock.SignalSignatures;
133
+
134
+ // Constructors
135
+
136
+ constructor(properties?: Partial<Lock.ConstructorProps>, ...args: any[]);
137
+
138
+ _init(...args: any[]): void;
139
+
140
+ // Signals
141
+
142
+ /** @signal */
143
+ connect<K extends keyof Lock.SignalSignatures>(
144
+ signal: K,
145
+ callback: GObject.SignalCallback<this, Lock.SignalSignatures[K]>,
146
+ ): number;
147
+ connect(signal: string, callback: (...args: any[]) => any): number;
148
+ /** @signal */
149
+ connect_after<K extends keyof Lock.SignalSignatures>(
150
+ signal: K,
151
+ callback: GObject.SignalCallback<this, Lock.SignalSignatures[K]>,
152
+ ): number;
153
+ connect_after(signal: string, callback: (...args: any[]) => any): number;
154
+ /** @signal */
155
+ emit<K extends keyof Lock.SignalSignatures>(
156
+ signal: K,
157
+ ...args: GObject.GjsParameters<Lock.SignalSignatures[K]> extends [any, ...infer Q] ? Q : never
158
+ ): void;
159
+ emit(signal: string, ...args: any[]): void;
160
+
161
+ // Methods
162
+
163
+ /**
164
+ * Destory an inactive lock object. You should call this method only after
165
+ * receiving the finished signal.
166
+ */
167
+ destroy(): void;
168
+ /**
169
+ * Actually perform the locking operation. This should be run after connecting
170
+ * to this object's signals.
171
+ *
172
+ * The compositor will hide all surfaces except those created via the
173
+ * `gtk_session_lock_lock_new_surface` method.
174
+ */
175
+ lock_lock(): void;
176
+ /**
177
+ * This method must be called after gtk_session_lock_lock_lock. If the session
178
+ * is locked successfully, the specified window will be shown on the given
179
+ * monitor. You must only ever call this method once for a given lock and
180
+ * monitor. The window will automatically be stretched to cover the entire
181
+ * screen.
182
+ * @param gtk_window
183
+ * @param monitor
184
+ */
185
+ new_surface(gtk_window: Gtk.Window, monitor: Gdk.Monitor): void;
186
+ /**
187
+ * Unlock an active session lock and dispose of it. It cannot be reused.
188
+ * You should generally call this method only after verifying a user's
189
+ * identity.
190
+ */
191
+ unlock_and_destroy(): void;
192
+ }
193
+
194
+ /**
195
+ * @gir-type Alias
196
+ */
197
+ type LockClass = typeof Lock;
198
+ /**
199
+ * Name of the imported GIR library
200
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
201
+ */
202
+ const __name__: string;
203
+ /**
204
+ * Version of the imported GIR library
205
+ * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
206
+ */
207
+ const __version__: string;
208
+ }
209
+
210
+ export default GtkSessionLock;
211
+
212
+ // END
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import GtkSessionLock from 'gi://GtkSessionLock?version=0.1';
4
+ export default GtkSessionLock;
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 './gtksessionlock-0.1-ambient.d.ts';
11
+
12
+ import './gtksessionlock-0.1-import.d.ts';
13
+
14
+ import GtkSessionLock from './gtksessionlock-0.1.js';
15
+ export default GtkSessionLock;
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+
2
+ // @ts-expect-error
3
+ import GtkSessionLock from './gtksessionlock-0.1.js';
4
+ export default GtkSessionLock;
5
+
package/package.json ADDED
@@ -0,0 +1,64 @@
1
+ {
2
+ "name": "@girs/gtksessionlock-0.1",
3
+ "version": "0.1.0-4.0.0-beta.41",
4
+ "description": "GJS TypeScript type definitions for GtkSessionLock-0.1, generated from library version 0.1.0",
5
+ "type": "module",
6
+ "module": "gtksessionlock-0.1.js",
7
+ "main": "gtksessionlock-0.1.js",
8
+ "exports": {
9
+ "./ambient": {
10
+ "types": "./gtksessionlock-0.1-ambient.d.ts",
11
+ "import": "./gtksessionlock-0.1-ambient.js",
12
+ "default": "./gtksessionlock-0.1-ambient.js"
13
+ },
14
+ "./import": {
15
+ "types": "./gtksessionlock-0.1-import.d.ts",
16
+ "import": "./gtksessionlock-0.1-import.js",
17
+ "default": "./gtksessionlock-0.1-import.js"
18
+ },
19
+ "./gtksessionlock-0.1": {
20
+ "types": "./gtksessionlock-0.1.d.ts",
21
+ "import": "./gtksessionlock-0.1.js",
22
+ "default": "./gtksessionlock-0.1.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/gjs": "4.0.0-beta.41",
35
+ "@girs/gtk-3.0": "3.24.51-4.0.0-beta.41",
36
+ "@girs/xlib-2.0": "2.0.0-4.0.0-beta.41",
37
+ "@girs/gdk-3.0": "3.24.51-4.0.0-beta.41",
38
+ "@girs/cairo-1.0": "1.0.0-4.0.0-beta.41",
39
+ "@girs/gobject-2.0": "2.88.0-4.0.0-beta.41",
40
+ "@girs/glib-2.0": "2.88.0-4.0.0-beta.41",
41
+ "@girs/pango-1.0": "1.57.0-4.0.0-beta.41",
42
+ "@girs/harfbuzz-0.0": "12.3.2-4.0.0-beta.41",
43
+ "@girs/freetype2-2.0": "2.0.0-4.0.0-beta.41",
44
+ "@girs/gio-2.0": "2.88.0-4.0.0-beta.41",
45
+ "@girs/gmodule-2.0": "2.0.0-4.0.0-beta.41",
46
+ "@girs/gdkpixbuf-2.0": "2.0.0-4.0.0-beta.41",
47
+ "@girs/atk-1.0": "2.60.0-4.0.0-beta.41" },
48
+ "devDependencies": {
49
+ "typescript": "*"
50
+ },
51
+ "keywords": ["Gir", "TypeScript", "types", "GObject-Introspection", "GJS", "GtkSessionLock-0.1"],
52
+ "author": "ts-for-gir",
53
+ "license": "MIT",
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "git+https://github.com/gjsify/types.git"
57
+ },
58
+ "bugs": {
59
+ "url": "https://github.com/gjsify/ts-for-gir/issues"
60
+ },
61
+ "homepage": "https://github.com/gjsify/types/tree/main/gtksessionlock-0.1#readme"
62
+ }
63
+
64
+
package/tsconfig.json ADDED
@@ -0,0 +1,69 @@
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
+ // Show diagnostics
20
+ "diagnostics": true,
21
+ "paths": {
22
+ "@girs/gtk-3.0": [
23
+ "../gtk-3.0/index.d.ts"
24
+ ],
25
+ "@girs/xlib-2.0": [
26
+ "../xlib-2.0/index.d.ts"
27
+ ],
28
+ "@girs/gdk-3.0": [
29
+ "../gdk-3.0/index.d.ts"
30
+ ],
31
+ "@girs/cairo-1.0": [
32
+ "../cairo-1.0/index.d.ts"
33
+ ],
34
+ "@girs/gobject-2.0": [
35
+ "../gobject-2.0/index.d.ts"
36
+ ],
37
+ "@girs/glib-2.0": [
38
+ "../glib-2.0/index.d.ts"
39
+ ],
40
+ "@girs/pango-1.0": [
41
+ "../pango-1.0/index.d.ts"
42
+ ],
43
+ "@girs/harfbuzz-0.0": [
44
+ "../harfbuzz-0.0/index.d.ts"
45
+ ],
46
+ "@girs/freetype2-2.0": [
47
+ "../freetype2-2.0/index.d.ts"
48
+ ],
49
+ "@girs/gio-2.0": [
50
+ "../gio-2.0/index.d.ts"
51
+ ],
52
+ "@girs/gmodule-2.0": [
53
+ "../gmodule-2.0/index.d.ts"
54
+ ],
55
+ "@girs/gdkpixbuf-2.0": [
56
+ "../gdkpixbuf-2.0/index.d.ts"
57
+ ],
58
+ "@girs/atk-1.0": [
59
+ "../atk-1.0/index.d.ts"
60
+ ],
61
+ "@girs/gjs": [
62
+ "../gjs/index.d.ts"
63
+ ]
64
+ }
65
+ },
66
+ "include": ["./gtksessionlock-0.1.d.ts"]
67
+ }
68
+
69
+
package/typedoc.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "entryPoints": ["./gtksessionlock-0.1.d.ts"],
3
+ "readme": "./README.md",
4
+ "name": "GtkSessionLock-0.1",
5
+ "tsconfig": "./tsconfig.json",
6
+ "skipErrorChecking": true,
7
+ "highlightLanguages": ["typescript", "javascript", "c", "cpp", "xml", "bash", "json", "css"]
8
+ }
9
+