@girs/lightdm-1 4.4.0 → 4.6.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.
- package/README.md +36 -41
- package/lightdm-1.d.ts +57 -9
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -4,82 +4,77 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
+
GJS TypeScript type definitions for LightDM-1 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.6.0.
|
|
7
8
|
|
|
8
|
-
|
|
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/lightdm-1
|
|
15
16
|
```
|
|
16
17
|
|
|
17
|
-
|
|
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/lightdm-1` | the namespace as a default export, plus the ambient and global declarations |
|
|
26
|
+
| `@girs/lightdm-1/ambient` | only the `gi://` module declarations |
|
|
27
|
+
| `@girs/lightdm-1/import` | only the `imports.gi` declarations |
|
|
28
|
+
| `@girs/lightdm-1/lightdm-1` | 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 LightDM from '@girs/lightdm-1';
|
|
22
38
|
```
|
|
23
39
|
|
|
24
|
-
###
|
|
40
|
+
### As `gi://`
|
|
25
41
|
|
|
26
|
-
|
|
27
|
-
|
|
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/lightdm-1'
|
|
46
|
+
import '@girs/lightdm-1';
|
|
32
47
|
```
|
|
33
48
|
|
|
34
|
-
`tsconfig.json`:
|
|
35
49
|
```json
|
|
36
|
-
{
|
|
37
|
-
"compilerOptions": {
|
|
38
|
-
...
|
|
39
|
-
},
|
|
40
|
-
"include": ["@girs/lightdm-1"],
|
|
41
|
-
...
|
|
42
|
-
}
|
|
50
|
+
{ "include": ["@girs/lightdm-1"] }
|
|
43
51
|
```
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
Then the runtime spelling type-checks:
|
|
46
54
|
|
|
47
55
|
```ts
|
|
48
56
|
import LightDM from 'gi://LightDM?version=1';
|
|
49
57
|
```
|
|
50
58
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
GJS's global `imports.gi` works too, with types.
|
|
54
|
-
For this you need to include `@girs/lightdm-1` or `@girs/lightdm-1/import` in your `tsconfig` or entry point Typescript file:
|
|
59
|
+
Referencing `@girs/lightdm-1/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
|
-
`
|
|
57
|
-
```ts
|
|
58
|
-
import '@girs/lightdm-1'
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
`tsconfig.json`:
|
|
62
|
-
```json
|
|
63
|
-
{
|
|
64
|
-
"compilerOptions": {
|
|
65
|
-
...
|
|
66
|
-
},
|
|
67
|
-
"include": ["@girs/lightdm-1"],
|
|
68
|
-
...
|
|
69
|
-
}
|
|
70
|
-
```
|
|
62
|
+
### As `imports.gi`
|
|
71
63
|
|
|
72
|
-
|
|
64
|
+
GJS's global object works the same way, via `@girs/lightdm-1/import`:
|
|
73
65
|
|
|
74
66
|
```ts
|
|
75
67
|
const LightDM = imports.gi.LightDM;
|
|
76
68
|
```
|
|
77
69
|
|
|
78
|
-
|
|
70
|
+
## Building
|
|
79
71
|
|
|
80
|
-
|
|
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
|
-
|
|
78
|
+
Every pre-generated package is at [gjsify/types](https://github.com/gjsify/types).
|
|
79
|
+
|
|
85
80
|
|
package/lightdm-1.d.ts
CHANGED
|
@@ -78,11 +78,11 @@ export namespace LightDM {
|
|
|
78
78
|
/**
|
|
79
79
|
* Informational message.
|
|
80
80
|
*/
|
|
81
|
-
INFO,
|
|
81
|
+
INFO = 0,
|
|
82
82
|
/**
|
|
83
83
|
* Error message.
|
|
84
84
|
*/
|
|
85
|
-
ERROR,
|
|
85
|
+
ERROR = 1,
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
|
|
@@ -101,32 +101,62 @@ export namespace LightDM {
|
|
|
101
101
|
/**
|
|
102
102
|
* prompt is a question. The information can be shown as it is entered.
|
|
103
103
|
*/
|
|
104
|
-
QUESTION,
|
|
104
|
+
QUESTION = 0,
|
|
105
105
|
/**
|
|
106
106
|
* prompt is for secret information. The entered information should be obscured so it can't be publicly visible.
|
|
107
107
|
*/
|
|
108
|
-
SECRET,
|
|
108
|
+
SECRET = 1,
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* @default authentication-complete
|
|
114
|
+
*/
|
|
112
115
|
const GREETER_SIGNAL_AUTHENTICATION_COMPLETE: string;
|
|
113
116
|
|
|
117
|
+
/**
|
|
118
|
+
* @default autologin-timer-expired
|
|
119
|
+
*/
|
|
114
120
|
const GREETER_SIGNAL_AUTOLOGIN_TIMER_EXPIRED: string;
|
|
115
121
|
|
|
122
|
+
/**
|
|
123
|
+
* @default idle
|
|
124
|
+
*/
|
|
116
125
|
const GREETER_SIGNAL_IDLE: string;
|
|
117
126
|
|
|
127
|
+
/**
|
|
128
|
+
* @default reset
|
|
129
|
+
*/
|
|
118
130
|
const GREETER_SIGNAL_RESET: string;
|
|
119
131
|
|
|
132
|
+
/**
|
|
133
|
+
* @default show-message
|
|
134
|
+
*/
|
|
120
135
|
const GREETER_SIGNAL_SHOW_MESSAGE: string;
|
|
121
136
|
|
|
137
|
+
/**
|
|
138
|
+
* @default show-prompt
|
|
139
|
+
*/
|
|
122
140
|
const GREETER_SIGNAL_SHOW_PROMPT: string;
|
|
123
141
|
|
|
142
|
+
/**
|
|
143
|
+
* @default changed
|
|
144
|
+
*/
|
|
124
145
|
const SIGNAL_USER_CHANGED: string;
|
|
125
146
|
|
|
147
|
+
/**
|
|
148
|
+
* @default user-added
|
|
149
|
+
*/
|
|
126
150
|
const USER_LIST_SIGNAL_USER_ADDED: string;
|
|
127
151
|
|
|
152
|
+
/**
|
|
153
|
+
* @default user-changed
|
|
154
|
+
*/
|
|
128
155
|
const USER_LIST_SIGNAL_USER_CHANGED: string;
|
|
129
156
|
|
|
157
|
+
/**
|
|
158
|
+
* @default user-removed
|
|
159
|
+
*/
|
|
130
160
|
const USER_LIST_SIGNAL_USER_REMOVED: string;
|
|
131
161
|
|
|
132
162
|
/**
|
|
@@ -241,12 +271,14 @@ export namespace LightDM {
|
|
|
241
271
|
/**
|
|
242
272
|
* Triggers a system hibernate.
|
|
243
273
|
* @returns `TRUE` if hibernate initiated.
|
|
274
|
+
* @throws GLib.Error
|
|
244
275
|
*/
|
|
245
276
|
function hibernate(): boolean;
|
|
246
277
|
|
|
247
278
|
/**
|
|
248
279
|
* Triggers a system restart.
|
|
249
280
|
* @returns `TRUE` if restart initiated.
|
|
281
|
+
* @throws GLib.Error
|
|
250
282
|
*/
|
|
251
283
|
function restart(): boolean;
|
|
252
284
|
|
|
@@ -259,12 +291,14 @@ export namespace LightDM {
|
|
|
259
291
|
/**
|
|
260
292
|
* Triggers a system shutdown.
|
|
261
293
|
* @returns `TRUE` if shutdown initiated.
|
|
294
|
+
* @throws GLib.Error
|
|
262
295
|
*/
|
|
263
296
|
function shutdown(): boolean;
|
|
264
297
|
|
|
265
298
|
/**
|
|
266
299
|
* Triggers a system suspend.
|
|
267
300
|
* @returns `TRUE` if suspend initiated.
|
|
301
|
+
* @throws GLib.Error
|
|
268
302
|
*/
|
|
269
303
|
function suspend(): boolean;
|
|
270
304
|
|
|
@@ -314,7 +348,7 @@ export namespace LightDM {
|
|
|
314
348
|
* @signal
|
|
315
349
|
* @run-last
|
|
316
350
|
*/
|
|
317
|
-
"show-message": (
|
|
351
|
+
"show-message": (text: string, type: MessageType) => void;
|
|
318
352
|
/**
|
|
319
353
|
* The ::show-prompt signal gets emitted when the greeter should show a
|
|
320
354
|
* prompt to the user. The given text should be displayed and an input
|
|
@@ -325,7 +359,7 @@ export namespace LightDM {
|
|
|
325
359
|
* @signal
|
|
326
360
|
* @run-last
|
|
327
361
|
*/
|
|
328
|
-
"show-prompt": (
|
|
362
|
+
"show-prompt": (text: string, type: PromptType) => void;
|
|
329
363
|
"notify::authentication-user": (pspec: GObject.ParamSpec) => void;
|
|
330
364
|
"notify::autologin-guest-hint": (pspec: GObject.ParamSpec) => void;
|
|
331
365
|
"notify::autologin-session-hint": (pspec: GObject.ParamSpec) => void;
|
|
@@ -636,18 +670,21 @@ export namespace LightDM {
|
|
|
636
670
|
* Starts the authentication procedure for a user.
|
|
637
671
|
* @param username A username or `NULL` to prompt for a username.
|
|
638
672
|
* @returns `TRUE` if authentication request sent.
|
|
673
|
+
* @throws GLib.Error
|
|
639
674
|
*/
|
|
640
675
|
authenticate(username: string | null): boolean;
|
|
641
676
|
|
|
642
677
|
/**
|
|
643
678
|
* Starts the authentication procedure for the guest user.
|
|
644
679
|
* @returns `TRUE` if authentication request sent.
|
|
680
|
+
* @throws GLib.Error
|
|
645
681
|
*/
|
|
646
682
|
authenticate_as_guest(): boolean;
|
|
647
683
|
|
|
648
684
|
/**
|
|
649
685
|
* Starts the authentication procedure for the automatic login user.
|
|
650
686
|
* @returns `TRUE` if authentication request sent.
|
|
687
|
+
* @throws GLib.Error
|
|
651
688
|
*/
|
|
652
689
|
authenticate_autologin(): boolean;
|
|
653
690
|
|
|
@@ -656,12 +693,14 @@ export namespace LightDM {
|
|
|
656
693
|
* @param session The name of a remote session
|
|
657
694
|
* @param username A username of `NULL` to prompt for a username.
|
|
658
695
|
* @returns `TRUE` if authentication request sent.
|
|
696
|
+
* @throws GLib.Error
|
|
659
697
|
*/
|
|
660
698
|
authenticate_remote(session: string, username: string | null): boolean;
|
|
661
699
|
|
|
662
700
|
/**
|
|
663
701
|
* Cancel the current user authentication.
|
|
664
702
|
* @returns `TRUE` if cancel request sent.
|
|
703
|
+
* @throws GLib.Error
|
|
665
704
|
*/
|
|
666
705
|
cancel_authentication(): boolean;
|
|
667
706
|
|
|
@@ -674,6 +713,7 @@ export namespace LightDM {
|
|
|
674
713
|
* Connects the greeter to the display manager. Will block until connected.
|
|
675
714
|
* @returns `TRUE` if successfully connected
|
|
676
715
|
* @deprecated since 1.11.1: Use `lightdm_greeter_connect_to_daemon_sync()` instead
|
|
716
|
+
* @throws GLib.Error
|
|
677
717
|
*/
|
|
678
718
|
connect_sync(): boolean;
|
|
679
719
|
|
|
@@ -713,12 +753,14 @@ export namespace LightDM {
|
|
|
713
753
|
* Finishes an operation started with `lightdm_greeter_connect_to_daemon()`.
|
|
714
754
|
* @param result A {@link Gio.AsyncResult}.
|
|
715
755
|
* @returns `TRUE` if successfully connected
|
|
756
|
+
* @throws GLib.Error
|
|
716
757
|
*/
|
|
717
758
|
connect_to_daemon_finish(result: Gio.AsyncResult): boolean;
|
|
718
759
|
|
|
719
760
|
/**
|
|
720
761
|
* Connects the greeter to the display manager. Will block until connected.
|
|
721
762
|
* @returns `TRUE` if successfully connected
|
|
763
|
+
* @throws GLib.Error
|
|
722
764
|
*/
|
|
723
765
|
connect_to_daemon_sync(): boolean;
|
|
724
766
|
|
|
@@ -776,6 +818,7 @@ export namespace LightDM {
|
|
|
776
818
|
* Function to call from lightdm_greeter_ensure_shared_data_dir callback.
|
|
777
819
|
* @param result A {@link Gio.AsyncResult}.
|
|
778
820
|
* @returns The path to the shared directory, free with g_free.
|
|
821
|
+
* @throws GLib.Error
|
|
779
822
|
*/
|
|
780
823
|
ensure_shared_data_dir_finish(result: Gio.AsyncResult): string;
|
|
781
824
|
|
|
@@ -792,6 +835,7 @@ export namespace LightDM {
|
|
|
792
835
|
* the directory themselves.
|
|
793
836
|
* @param username A username
|
|
794
837
|
* @returns The path to the shared directory, free with g_free.
|
|
838
|
+
* @throws GLib.Error
|
|
795
839
|
*/
|
|
796
840
|
ensure_shared_data_dir_sync(username: string): string;
|
|
797
841
|
|
|
@@ -906,6 +950,7 @@ export namespace LightDM {
|
|
|
906
950
|
* Provide response to a prompt. May be one in a series.
|
|
907
951
|
* @param response Response to a prompt
|
|
908
952
|
* @returns `TRUE` if response sent.
|
|
953
|
+
* @throws GLib.Error
|
|
909
954
|
*/
|
|
910
955
|
respond(response: string): boolean;
|
|
911
956
|
|
|
@@ -913,6 +958,7 @@ export namespace LightDM {
|
|
|
913
958
|
* Set the language for the currently authenticated user.
|
|
914
959
|
* @param language The language to use for this user in the form of a locale specification (e.g. "de_DE.UTF-8").
|
|
915
960
|
* @returns `TRUE` if set language request sent.
|
|
961
|
+
* @throws GLib.Error
|
|
916
962
|
*/
|
|
917
963
|
set_language(language: string): boolean;
|
|
918
964
|
|
|
@@ -962,6 +1008,7 @@ export namespace LightDM {
|
|
|
962
1008
|
* Start a session for the authenticated user.
|
|
963
1009
|
* @param result A {@link Gio.AsyncResult}.
|
|
964
1010
|
* @returns TRUE if the session was started.
|
|
1011
|
+
* @throws GLib.Error
|
|
965
1012
|
*/
|
|
966
1013
|
start_session_finish(result: Gio.AsyncResult): boolean;
|
|
967
1014
|
|
|
@@ -969,6 +1016,7 @@ export namespace LightDM {
|
|
|
969
1016
|
* Start a session for the authenticated user.
|
|
970
1017
|
* @param session The session to log into or `NULL` to use the default.
|
|
971
1018
|
* @returns TRUE if the session was started.
|
|
1019
|
+
* @throws GLib.Error
|
|
972
1020
|
*/
|
|
973
1021
|
start_session_sync(session: string | null): boolean;
|
|
974
1022
|
}
|
|
@@ -1573,19 +1621,19 @@ export namespace LightDM {
|
|
|
1573
1621
|
* @signal
|
|
1574
1622
|
* @run-last
|
|
1575
1623
|
*/
|
|
1576
|
-
"user-added": (
|
|
1624
|
+
"user-added": (user: User) => void;
|
|
1577
1625
|
/**
|
|
1578
1626
|
* The ::user-changed signal gets emitted when a user account is modified.
|
|
1579
1627
|
* @signal
|
|
1580
1628
|
* @run-last
|
|
1581
1629
|
*/
|
|
1582
|
-
"user-changed": (
|
|
1630
|
+
"user-changed": (user: User) => void;
|
|
1583
1631
|
/**
|
|
1584
1632
|
* The ::user-removed signal gets emitted when a user account is removed.
|
|
1585
1633
|
* @signal
|
|
1586
1634
|
* @run-last
|
|
1587
1635
|
*/
|
|
1588
|
-
"user-removed": (
|
|
1636
|
+
"user-removed": (user: User) => void;
|
|
1589
1637
|
"notify::length": (pspec: GObject.ParamSpec) => void;
|
|
1590
1638
|
"notify::num-users": (pspec: GObject.ParamSpec) => void;
|
|
1591
1639
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/lightdm-1",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.6.0",
|
|
4
4
|
"description": "GJS TypeScript type definitions for LightDM-1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lightdm-1.js",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"test": "tsc --project tsconfig.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@girs/gjs": "^4.
|
|
35
|
-
"@girs/gio-2.0": "^4.
|
|
36
|
-
"@girs/gobject-2.0": "^4.
|
|
37
|
-
"@girs/glib-2.0": "^4.
|
|
38
|
-
"@girs/gmodule-2.0": "^4.
|
|
34
|
+
"@girs/gjs": "^4.6.0",
|
|
35
|
+
"@girs/gio-2.0": "^4.6.0",
|
|
36
|
+
"@girs/gobject-2.0": "^4.6.0",
|
|
37
|
+
"@girs/glib-2.0": "^4.6.0",
|
|
38
|
+
"@girs/gmodule-2.0": "^4.6.0" },
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"typescript": "*"
|
|
41
41
|
},
|