@girs/unique-3.0 3.0.0-3.2.9 → 3.0.0-4.0.0-beta.1

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/unique-3.0.js CHANGED
@@ -1,10 +1,6 @@
1
1
 
2
-
3
2
  // @ts-expect-error
4
3
  import Unique from 'gi://Unique?version=3.0';
5
4
  export { Unique };
6
5
  export default Unique;
7
6
 
8
-
9
-
10
-
package/unique-3.0.cjs DELETED
@@ -1,11 +0,0 @@
1
-
2
-
3
- imports.gi.versions.Unique = '3.0'
4
- const Unique = imports.gi.Unique;
5
-
6
- module.exports = Unique;
7
-
8
-
9
-
10
-
11
-
package/unique-3.0.d.cts DELETED
@@ -1,562 +0,0 @@
1
-
2
- /*
3
- * Type Definitions for Gjs (https://gjs.guide/)
4
- *
5
- * These type definitions are automatically generated, do not edit them by hand.
6
- * If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
7
- */
8
-
9
- import './unique-3.0-ambient.d.ts';
10
- import './unique-3.0-import.d.ts';
11
- /**
12
- * Unique-3.0
13
- */
14
-
15
- import type xlib from '@girs/xlib-2.0';
16
- import type cairo from '@girs/cairo-1.0';
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 Gtk from '@girs/gtk-3.0';
24
- import type Gdk from '@girs/gdk-3.0';
25
- import type GdkPixbuf from '@girs/gdkpixbuf-2.0';
26
- import type GModule from '@girs/gmodule-2.0';
27
- import type Atk from '@girs/atk-1.0';
28
-
29
- /**
30
- * Command to send to a currently active instance. User defined commands
31
- * should be positive integers, and should be added using the
32
- * unique_app_add_command() function after creating a #UniqueApp instance
33
- */
34
- export enum Command {
35
- INVALID,
36
- ACTIVATE,
37
- NEW,
38
- OPEN,
39
- CLOSE,
40
- }
41
- /**
42
- * Response that a currently active instance of the application should
43
- * return to the caller which sent a command.
44
- */
45
- export enum Response {
46
- INVALID,
47
- OK,
48
- CANCEL,
49
- FAIL,
50
- PASSTHROUGH,
51
- }
52
- export module App {
53
-
54
- // Signal callback interfaces
55
-
56
- /**
57
- * Signal callback interface for `message-received`
58
- */
59
- export interface MessageReceivedSignalCallback {
60
- ($obj: App, command: number, message_data: MessageData, time_: number): Response
61
- }
62
-
63
-
64
- // Constructor properties interface
65
-
66
- export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
67
-
68
- // Own constructor properties of Unique-3.0.Unique.App
69
-
70
- /**
71
- * The unique name of the application. It must be in form of
72
- * a domain-like string, like <literal>org.gnome.MyApplication</literal>.
73
- */
74
- name?: string | null
75
- /**
76
- * The #GdkScreen of the application.
77
- */
78
- screen?: Gdk.Screen | null
79
- /**
80
- * The startup notification id, needed to complete the startup
81
- * notification sequence. If not set, a default id will be
82
- * automatically given.
83
- */
84
- startupId?: string | null
85
- }
86
-
87
- }
88
-
89
- export interface App {
90
-
91
- // Own properties of Unique-3.0.Unique.App
92
-
93
- /**
94
- * Whether another instance of the application is running.
95
- */
96
- readonly isRunning: boolean
97
- /**
98
- * The unique name of the application. It must be in form of
99
- * a domain-like string, like <literal>org.gnome.MyApplication</literal>.
100
- */
101
- readonly name: string
102
- /**
103
- * The #GdkScreen of the application.
104
- */
105
- screen: Gdk.Screen
106
- /**
107
- * The startup notification id, needed to complete the startup
108
- * notification sequence. If not set, a default id will be
109
- * automatically given.
110
- */
111
- readonly startupId: string
112
-
113
- // Owm methods of Unique-3.0.Unique.App
114
-
115
- /**
116
- * Adds `command_name` as a custom command that can be used by `app`. You
117
- * must call unique_app_add_command() before unique_app_send_message() in
118
- * order to use the newly added command.
119
- *
120
- * The command name is used internally: you need to use the command's logical
121
- * id in unique_app_send_message() and inside the UniqueApp::message-received
122
- * signal.
123
- * @param command_name command name
124
- * @param command_id command logical id
125
- */
126
- add_command(command_name: string | null, command_id: number): void
127
- /**
128
- * Checks whether another instance of `app` is running.
129
- * @returns %TRUE if there already is an instance running
130
- */
131
- is_running(): boolean
132
- /**
133
- * Sends `command` to a running instance of `app`. If you need to pass data
134
- * to the instance, you should create a #UniqueMessageData object using
135
- * unique_message_data_new() and then fill it with the data you intend to
136
- * pass.
137
- *
138
- * The running application will receive a UniqueApp::message-received signal
139
- * and will call the various signal handlers attach to it. If any handler
140
- * returns a #UniqueResponse different than %UNIQUE_RESPONSE_OK, the emission
141
- * will stop.
142
- * @param command_id command to send
143
- * @param message_data #UniqueMessageData, or %NULL
144
- * @returns The #UniqueResponse returned by the running instance
145
- */
146
- send_message(command_id: number, message_data?: MessageData | null): Response
147
- /**
148
- * Makes `app` "watch" a window. Every watched window will receive
149
- * startup notification changes automatically.
150
- * @param window the #GtkWindow to watch
151
- */
152
- watch_window(window: Gtk.Window): void
153
-
154
- // Own virtual methods of Unique-3.0.Unique.App
155
-
156
- vfunc_message_received(command: number, message_data: MessageData, time_: number): Response
157
-
158
- // Own signals of Unique-3.0.Unique.App
159
-
160
- connect(sigName: "message-received", callback: App.MessageReceivedSignalCallback): number
161
- connect_after(sigName: "message-received", callback: App.MessageReceivedSignalCallback): number
162
- emit(sigName: "message-received", command: number, message_data: MessageData, time_: number, ...args: any[]): void
163
-
164
- // Class property signals of Unique-3.0.Unique.App
165
-
166
- connect(sigName: "notify::is-running", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
167
- connect_after(sigName: "notify::is-running", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
168
- emit(sigName: "notify::is-running", ...args: any[]): void
169
- connect(sigName: "notify::name", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
170
- connect_after(sigName: "notify::name", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
171
- emit(sigName: "notify::name", ...args: any[]): void
172
- connect(sigName: "notify::screen", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
173
- connect_after(sigName: "notify::screen", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
174
- emit(sigName: "notify::screen", ...args: any[]): void
175
- connect(sigName: "notify::startup-id", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
176
- connect_after(sigName: "notify::startup-id", callback: (($obj: App, pspec: GObject.ParamSpec) => void)): number
177
- emit(sigName: "notify::startup-id", ...args: any[]): void
178
- connect(sigName: string, callback: (...args: any[]) => void): number
179
- connect_after(sigName: string, callback: (...args: any[]) => void): number
180
- emit(sigName: string, ...args: any[]): void
181
- disconnect(id: number): void
182
- }
183
-
184
- /**
185
- * The base class for every single instance application. The #UniqueApp
186
- * structure contains only private data and should be manipulated only
187
- * with the provided functions.
188
- * @class
189
- */
190
- export class App extends GObject.Object {
191
-
192
- // Own properties of Unique-3.0.Unique.App
193
-
194
- static name: string
195
- static $gtype: GObject.GType<App>
196
-
197
- // Constructors of Unique-3.0.Unique.App
198
-
199
- constructor(config?: App.ConstructorProperties)
200
- /**
201
- * Creates a new #UniqueApp instance for `name` passing a start-up notification
202
- * id `startup_id`. The name must be a unique identifier for the application,
203
- * and it must be in form of a domain name, like
204
- * <literal>org.gnome.YourApplication</literal>.
205
- *
206
- * If `startup_id` is %NULL the <literal>DESKTOP_STARTUP_ID</literal>
207
- * environment variable will be check, and if that fails a "fake" startup
208
- * notification id will be created.
209
- *
210
- * Once you have created a #UniqueApp instance, you should check if
211
- * any other instance is running, using unique_app_is_running().
212
- * If another instance is running you can send a command to it, using
213
- * the unique_app_send_message() function; after that, the second instance
214
- * should quit. If no other instance is running, the usual logic for
215
- * creating the application can follow.
216
- * @constructor
217
- * @param name the name of the application's instance
218
- * @param startup_id the startup notification id, or %NULL
219
- * @returns the newly created #UniqueApp instance.
220
- */
221
- constructor(name: string | null, startup_id?: string | null)
222
- /**
223
- * Creates a new #UniqueApp instance for `name` passing a start-up notification
224
- * id `startup_id`. The name must be a unique identifier for the application,
225
- * and it must be in form of a domain name, like
226
- * <literal>org.gnome.YourApplication</literal>.
227
- *
228
- * If `startup_id` is %NULL the <literal>DESKTOP_STARTUP_ID</literal>
229
- * environment variable will be check, and if that fails a "fake" startup
230
- * notification id will be created.
231
- *
232
- * Once you have created a #UniqueApp instance, you should check if
233
- * any other instance is running, using unique_app_is_running().
234
- * If another instance is running you can send a command to it, using
235
- * the unique_app_send_message() function; after that, the second instance
236
- * should quit. If no other instance is running, the usual logic for
237
- * creating the application can follow.
238
- * @constructor
239
- * @param name the name of the application's instance
240
- * @param startup_id the startup notification id, or %NULL
241
- * @returns the newly created #UniqueApp instance.
242
- */
243
- static new(name: string | null, startup_id?: string | null): App
244
- _init(config?: App.ConstructorProperties): void
245
- }
246
-
247
- export module Backend {
248
-
249
- // Constructor properties interface
250
-
251
- export interface ConstructorProperties extends GObject.Object.ConstructorProperties {
252
- }
253
-
254
- }
255
-
256
- export interface Backend {
257
-
258
- // Own fields of Unique-3.0.Unique.Backend
259
-
260
- parent_instance: GObject.Object
261
-
262
- // Owm methods of Unique-3.0.Unique.Backend
263
-
264
- /**
265
- * FIXME
266
- * @returns FIXME
267
- */
268
- get_name(): string | null
269
- /**
270
- * FIXME
271
- * @returns FIXME
272
- */
273
- get_screen(): Gdk.Screen
274
- /**
275
- * FIXME
276
- * @returns FIXME
277
- */
278
- get_startup_id(): string | null
279
- /**
280
- * Retrieves the current workspace.
281
- * @returns a workspace number
282
- */
283
- get_workspace(): number
284
- /**
285
- * Requests the name set using unique_backend_set_name() using `backend`.
286
- *
287
- * already is a registered name
288
- * @returns %TRUE if the name was assigned to us, %FALSE if there
289
- */
290
- request_name(): boolean
291
- /**
292
- * Sends `command_id,` and optionally `message_data,` to a running instance
293
- * using `backend`.
294
- * @param command_id command to send
295
- * @param message_data message to send, or %NULL
296
- * @param time_ time of the command emission, or 0 for the current time
297
- * @returns a #UniqueResponse value sent by the running instance
298
- */
299
- send_message(command_id: number, message_data: MessageData, time_: number): Response
300
- /**
301
- * FIXME
302
- * @param name FIXME
303
- */
304
- set_name(name: string | null): void
305
- /**
306
- * FIXME
307
- * @param screen FIXME
308
- */
309
- set_screen(screen: Gdk.Screen): void
310
- /**
311
- * FIXME
312
- * @param startup_id FIXME
313
- */
314
- set_startup_id(startup_id: string | null): void
315
-
316
- // Own virtual methods of Unique-3.0.Unique.Backend
317
-
318
- /**
319
- * Requests the name set using unique_backend_set_name() using `backend`.
320
- *
321
- * already is a registered name
322
- * @virtual
323
- * @returns %TRUE if the name was assigned to us, %FALSE if there
324
- */
325
- vfunc_request_name(): boolean
326
- /**
327
- * Sends `command_id,` and optionally `message_data,` to a running instance
328
- * using `backend`.
329
- * @virtual
330
- * @param command_id command to send
331
- * @param message_data message to send, or %NULL
332
- * @param time_ time of the command emission, or 0 for the current time
333
- * @returns a #UniqueResponse value sent by the running instance
334
- */
335
- vfunc_send_message(command_id: number, message_data: MessageData, time_: number): Response
336
-
337
- // Class property signals of Unique-3.0.Unique.Backend
338
-
339
- connect(sigName: string, callback: (...args: any[]) => void): number
340
- connect_after(sigName: string, callback: (...args: any[]) => void): number
341
- emit(sigName: string, ...args: any[]): void
342
- disconnect(id: number): void
343
- }
344
-
345
- /**
346
- * The #UniqueBackend structure contains only private data and should only
347
- * be accessed using the provided functions.
348
- * @class
349
- */
350
- export class Backend extends GObject.Object {
351
-
352
- // Own properties of Unique-3.0.Unique.Backend
353
-
354
- static name: string
355
- static $gtype: GObject.GType<Backend>
356
-
357
- // Constructors of Unique-3.0.Unique.Backend
358
-
359
- constructor(config?: Backend.ConstructorProperties)
360
- _init(config?: Backend.ConstructorProperties): void
361
- /**
362
- * Creates a #UniqueBackend using the default backend defined at
363
- * compile time. You can override the default backend by setting the
364
- * <literal>UNIQUE_BACKEND</literal> environment variable with the
365
- * name of the desired backend.
366
- * @returns the newly created #UniqueBackend instance
367
- */
368
- static create(): Backend
369
- }
370
-
371
- export interface AppClass {
372
-
373
- // Own fields of Unique-3.0.Unique.AppClass
374
-
375
- message_received: (app: App, command: number, message_data: MessageData, time_: number) => Response
376
- }
377
-
378
- /**
379
- * Base class for every single instance application.
380
- * @record
381
- */
382
- export abstract class AppClass {
383
-
384
- // Own properties of Unique-3.0.Unique.AppClass
385
-
386
- static name: string
387
- }
388
-
389
- export interface AppPrivate {
390
- }
391
-
392
- export class AppPrivate {
393
-
394
- // Own properties of Unique-3.0.Unique.AppPrivate
395
-
396
- static name: string
397
- }
398
-
399
- export interface BackendClass {
400
-
401
- // Own fields of Unique-3.0.Unique.BackendClass
402
-
403
- request_name: (backend: Backend) => boolean
404
- send_message: (backend: Backend, command_id: number, message_data: MessageData, time_: number) => Response
405
- }
406
-
407
- /**
408
- * The class that should be implemented by every backend for #UniqueApp.
409
- * @record
410
- */
411
- export abstract class BackendClass {
412
-
413
- // Own properties of Unique-3.0.Unique.BackendClass
414
-
415
- static name: string
416
- }
417
-
418
- export interface MessageData {
419
-
420
- // Owm methods of Unique-3.0.Unique.MessageData
421
-
422
- /**
423
- * Copies `message_data`.
424
- * @returns a copy of the passed #UniqueMessageData
425
- */
426
- copy(): MessageData
427
- /**
428
- * Frees all the resources allocated by `message_data`.
429
- */
430
- free(): void
431
- /**
432
- * Retrieves the raw contents of `message_data` set using
433
- * unique_messaget_data_set().
434
- *
435
- * returned string is owned by the #UniqueMessageData and should
436
- * never be modified or freed
437
- * @returns the contents of the message data or %NULL. The
438
- */
439
- get(): [ /* returnType */ number, /* length */ number ]
440
- /**
441
- * Retrieves the filename set with unique_message_data_set_filename().
442
- *
443
- * filename. Use g_free() to free the resources used by the returned
444
- * value.
445
- * @returns a newly allocated string containing the
446
- */
447
- get_filename(): string | null
448
- /**
449
- * Returns a pointer to the screen from where the message came. You
450
- * can use gtk_window_set_screen() to move windows or dialogs to the
451
- * right screen. This field is always set by the Unique library.
452
- * @returns a #GdkScreen
453
- */
454
- get_screen(): Gdk.Screen
455
- /**
456
- * Retrieves the startup notification id set inside `message_data`. This
457
- * field is always set by the Unique library.
458
- *
459
- * owned by the #UniqueMessageData structure and should not be
460
- * modified or freed
461
- * @returns the startup notification id. The returned string is
462
- */
463
- get_startup_id(): string | null
464
- /**
465
- * Retrieves the text set using unique_message_data_set_text().
466
- * @returns a newly-allocated string.
467
- */
468
- get_text(): string | null
469
- /**
470
- * Retrieves a %NULL-terminated string vector containing the URIs set with
471
- * unique_message_data_set_uris().
472
- *
473
- * %NULL-terminated list of URIs. Use g_strfreev() to free it.
474
- * @returns a newly-allocated,
475
- */
476
- get_uris(): string[]
477
- /**
478
- * Retrieves the workspace number from where the message came. This
479
- * field is always set by the Unique library.
480
- * @returns the workspace number
481
- */
482
- get_workspace(): number
483
- /**
484
- * Sets `data` as the payload of `message_data`. Any other data is removed
485
- * from the message data. If `data` is %NULL, a `length` of -1 will unset
486
- * the payload, while a `length` of 0 will set the payload to an empty
487
- * string.
488
- *
489
- * You can use unique_message_data_get() to retrieve the data.
490
- * @param data binary blob to set, or %NULL
491
- * @param length length of `data`
492
- */
493
- set(data: number | null, length: number): void
494
- /**
495
- * Sets `filename` as the contents of `message_data`.
496
- * @param filename a filename
497
- */
498
- set_filename(filename: string | null): void
499
- /**
500
- * Sets `str` as the plain text payload of `message_data,` converting it
501
- * to UTF-8 if needed. If `length` is -1, the length of the string will
502
- * be used. Use unique_message_data_get_text() to retrieve the text.
503
- * @param str plain text to be set as payload
504
- * @param length length of the text, or -1
505
- * @returns %TRUE if the text was successfully converted to UTF-8
506
- */
507
- set_text(str: string | null, length: number): boolean
508
- /**
509
- * Converts `uris` to a valid URI list and sets it as payload of
510
- * `message_data`. You can use unique_message_data_get_uris() to
511
- * retrieve the list from a #UniqueMessageData.
512
- * @param uris a list of URIs in a %NULL-terminated string vector
513
- * @returns %TRUE if the URIs were successfully converted
514
- */
515
- set_uris(uris: string[]): boolean
516
- }
517
-
518
- /**
519
- * #UniqueMessageData contains the data passed between instances of
520
- * a #UniqueApp. The #UniqueMessageData structure received inside
521
- * the signal handlers for UniqueApp::message-received is guaranteed
522
- * to contain the #GdkScreen, the workspace and the startup notification
523
- * id of the instance sending the message.
524
- * @record
525
- */
526
- export class MessageData {
527
-
528
- // Own properties of Unique-3.0.Unique.MessageData
529
-
530
- static name: string
531
-
532
- // Constructors of Unique-3.0.Unique.MessageData
533
-
534
- /**
535
- * Creates a new #UniqueMessageData structure. This structure holds the
536
- * message data passed between running instances with
537
- * unique_app_send_message().
538
- * @constructor
539
- * @returns the newly created #UniqueMessageData
540
- */
541
- constructor()
542
- /**
543
- * Creates a new #UniqueMessageData structure. This structure holds the
544
- * message data passed between running instances with
545
- * unique_app_send_message().
546
- * @constructor
547
- * @returns the newly created #UniqueMessageData
548
- */
549
- static new(): MessageData
550
- }
551
-
552
- /**
553
- * Name of the imported GIR library
554
- * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
555
- */
556
- export const __name__: string
557
- /**
558
- * Version of the imported GIR library
559
- * @see https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L189
560
- */
561
- export const __version__: string
562
- // END