@girs/gpaste-2 4.2.0 → 4.4.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.
Files changed (3) hide show
  1. package/README.md +8 -8
  2. package/gpaste-2.d.ts +241 -8
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -5,25 +5,25 @@
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gpaste-2)
6
6
 
7
7
 
8
- GJS TypeScript type definitions for GPaste-2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.2.0.
8
+ GJS TypeScript type definitions for GPaste-2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.0.
9
9
 
10
10
  ## Install
11
11
 
12
- To use this type definitions, install them with NPM:
12
+ Install the type definitions with npm:
13
13
  ```bash
14
14
  npm install @girs/gpaste-2
15
15
  ```
16
16
 
17
17
  ## Usage
18
18
 
19
- You can import this package into your project like this:
19
+ Import it like any other module:
20
20
  ```ts
21
21
  import GPaste from '@girs/gpaste-2';
22
22
  ```
23
23
 
24
24
  ### Ambient Modules
25
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.
26
+ [Ambient modules](https://github.com/gjsify/ts-for-gir/tree/main/packages/cli#ambient-modules) let you write the same import you would in plain JavaScript.
27
27
  For this you need to include `@girs/gpaste-2` or `@girs/gpaste-2/ambient` in your `tsconfig` or entry point Typescript file:
28
28
 
29
29
  `index.ts`:
@@ -42,7 +42,7 @@ import '@girs/gpaste-2'
42
42
  }
43
43
  ```
44
44
 
45
- Now you can import the ambient module with TypeScript support:
45
+ The ambient module now resolves with types:
46
46
 
47
47
  ```ts
48
48
  import GPaste from 'gi://GPaste?version=2';
@@ -50,7 +50,7 @@ import GPaste from 'gi://GPaste?version=2';
50
50
 
51
51
  ### Global import
52
52
 
53
- You can also import the module with Typescript support using the global `imports.gi` object of GJS.
53
+ GJS's global `imports.gi` works too, with types.
54
54
  For this you need to include `@girs/gpaste-2` or `@girs/gpaste-2/import` in your `tsconfig` or entry point Typescript file:
55
55
 
56
56
  `index.ts`:
@@ -69,7 +69,7 @@ import '@girs/gpaste-2'
69
69
  }
70
70
  ```
71
71
 
72
- Now you have also type support for this, too:
72
+ That form carries types as well:
73
73
 
74
74
  ```ts
75
75
  const GPaste = imports.gi.GPaste;
@@ -77,7 +77,7 @@ const GPaste = imports.gi.GPaste;
77
77
 
78
78
  ### Bundle
79
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).
80
+ Most projects want a bundler. [esbuild](https://esbuild.github.io/) is the smallest thing that works; the [examples directory](https://github.com/gjsify/ts-for-gir/tree/main/examples) has setups for several others.
81
81
 
82
82
  ## Other packages
83
83
 
package/gpaste-2.d.ts CHANGED
@@ -171,6 +171,10 @@ export namespace GPaste {
171
171
 
172
172
  const HISTORY_NAME_SETTING: string;
173
173
 
174
+ const IMAGES_PREVIEW_SETTING: string;
175
+
176
+ const IMAGES_PREVIEW_SIZE_SETTING: string;
177
+
174
178
  const IMAGES_SUPPORT_SETTING: string;
175
179
 
176
180
  const LAUNCH_UI_SETTING: string;
@@ -1652,6 +1656,7 @@ export namespace GPaste {
1652
1656
  * any interface methods.
1653
1657
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
1654
1658
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
1659
+ * @since 2.22
1655
1660
  */
1656
1661
  init_async(io_priority: number, cancellable: Gio.Cancellable | null): globalThis.Promise<boolean>;
1657
1662
 
@@ -1695,6 +1700,7 @@ export namespace GPaste {
1695
1700
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
1696
1701
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
1697
1702
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
1703
+ * @since 2.22
1698
1704
  */
1699
1705
  init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
1700
1706
 
@@ -1738,6 +1744,7 @@ export namespace GPaste {
1738
1744
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
1739
1745
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
1740
1746
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
1747
+ * @since 2.22
1741
1748
  */
1742
1749
  init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): globalThis.Promise<boolean> | void;
1743
1750
 
@@ -1746,6 +1753,7 @@ export namespace GPaste {
1746
1753
  * See `g_async_initable_init_async()`.
1747
1754
  * @param res a {@link Gio.AsyncResult}.
1748
1755
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
1756
+ * @since 2.22
1749
1757
  */
1750
1758
  init_finish(res: Gio.AsyncResult): boolean;
1751
1759
 
@@ -1754,6 +1762,7 @@ export namespace GPaste {
1754
1762
  * calls, returning the created object or `null` on error.
1755
1763
  * @param res the {@link Gio.AsyncResult} from the callback
1756
1764
  * @returns a newly created {@link GObject.Object}, or `null` on error. Free with `g_object_unref()`.
1765
+ * @since 2.22
1757
1766
  */
1758
1767
  new_finish(res: Gio.AsyncResult): Client;
1759
1768
 
@@ -1803,6 +1812,7 @@ export namespace GPaste {
1803
1812
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
1804
1813
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
1805
1814
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
1815
+ * @since 2.22
1806
1816
  * @virtual
1807
1817
  */
1808
1818
  vfunc_init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
@@ -1811,6 +1821,7 @@ export namespace GPaste {
1811
1821
  * Finishes asynchronous initialization and returns the result.
1812
1822
  * See `g_async_initable_init_async()`.
1813
1823
  * @param res a {@link Gio.AsyncResult}.
1824
+ * @since 2.22
1814
1825
  * @virtual
1815
1826
  */
1816
1827
  vfunc_init_finish(res: Gio.AsyncResult): boolean;
@@ -1818,26 +1829,35 @@ export namespace GPaste {
1818
1829
  /**
1819
1830
  * Gets the {@link Gio.DBusObject} that `interface_` belongs to, if any.
1820
1831
  * @returns A {@link Gio.DBusObject} or `null`. The returned reference should be freed with `g_object_unref()`.
1832
+ * @since 2.32
1821
1833
  */
1822
1834
  get_object(): Gio.DBusObject | null;
1823
1835
 
1824
1836
  /**
1825
1837
  * Gets D-Bus introspection information for the D-Bus interface
1826
1838
  * implemented by `interface_`.
1839
+ *
1840
+ * This can return `null` if no {@link Gio.DBusInterfaceInfo} was provided during
1841
+ * construction of `interface_` and is also not made available otherwise.
1842
+ * For example, {@link Gio.DBusProxy} implements {@link Gio.DBusInterface} but allows for a `null`
1843
+ * {@link Gio.DBusInterfaceInfo}.
1827
1844
  * @returns A {@link Gio.DBusInterfaceInfo}. Do not free.
1845
+ * @since 2.30
1828
1846
  */
1829
- get_info(): Gio.DBusInterfaceInfo;
1847
+ get_info(): Gio.DBusInterfaceInfo | null;
1830
1848
 
1831
1849
  /**
1832
1850
  * Sets the {@link Gio.DBusObject} for `interface_` to `object`.
1833
1851
  *
1834
1852
  * Note that `interface_` will hold a weak reference to `object`.
1835
1853
  * @param object A {@link Gio.DBusObject} or `null`.
1854
+ * @since 2.30
1836
1855
  */
1837
1856
  set_object(object: Gio.DBusObject | null): void;
1838
1857
 
1839
1858
  /**
1840
1859
  * Gets the {@link Gio.DBusObject} that `interface_` belongs to, if any.
1860
+ * @since 2.32
1841
1861
  * @virtual
1842
1862
  */
1843
1863
  vfunc_dup_object(): Gio.DBusObject | null;
@@ -1845,15 +1865,22 @@ export namespace GPaste {
1845
1865
  /**
1846
1866
  * Gets D-Bus introspection information for the D-Bus interface
1847
1867
  * implemented by `interface_`.
1868
+ *
1869
+ * This can return `null` if no {@link Gio.DBusInterfaceInfo} was provided during
1870
+ * construction of `interface_` and is also not made available otherwise.
1871
+ * For example, {@link Gio.DBusProxy} implements {@link Gio.DBusInterface} but allows for a `null`
1872
+ * {@link Gio.DBusInterfaceInfo}.
1873
+ * @since 2.30
1848
1874
  * @virtual
1849
1875
  */
1850
- vfunc_get_info(): Gio.DBusInterfaceInfo;
1876
+ vfunc_get_info(): Gio.DBusInterfaceInfo | null;
1851
1877
 
1852
1878
  /**
1853
1879
  * Sets the {@link Gio.DBusObject} for `interface_` to `object`.
1854
1880
  *
1855
1881
  * Note that `interface_` will hold a weak reference to `object`.
1856
1882
  * @param object A {@link Gio.DBusObject} or `null`.
1883
+ * @since 2.30
1857
1884
  * @virtual
1858
1885
  */
1859
1886
  vfunc_set_object(object: Gio.DBusObject | null): void;
@@ -1899,6 +1926,7 @@ export namespace GPaste {
1899
1926
  * instance.
1900
1927
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
1901
1928
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
1929
+ * @since 2.22
1902
1930
  */
1903
1931
  init(cancellable: Gio.Cancellable | null): boolean;
1904
1932
 
@@ -1942,6 +1970,7 @@ export namespace GPaste {
1942
1970
  * on the result of `g_object_new()`, regardless of whether it is in fact a new
1943
1971
  * instance.
1944
1972
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
1973
+ * @since 2.22
1945
1974
  * @virtual
1946
1975
  */
1947
1976
  vfunc_init(cancellable: Gio.Cancellable | null): boolean;
@@ -2026,13 +2055,13 @@ export namespace GPaste {
2026
2055
  }
2027
2056
 
2028
2057
  // Constructor properties interface
2029
- interface ConstructorProps extends Gio.DBusProxy.ConstructorProps, Gio.AsyncInitable.ConstructorProps, Gio.DBusInterface.ConstructorProps, Gio.Initable.ConstructorProps {}
2058
+ interface ConstructorProps extends Gio.DBusProxy.ConstructorProps, KeybindingProvider.ConstructorProps, Gio.AsyncInitable.ConstructorProps, Gio.DBusInterface.ConstructorProps, Gio.Initable.ConstructorProps {}
2030
2059
  }
2031
2060
 
2032
2061
  /**
2033
2062
  * @gir-type Class
2034
2063
  */
2035
- class GnomeShellClient extends Gio.DBusProxy implements Gio.AsyncInitable<GnomeShellClient>, Gio.DBusInterface, Gio.Initable {
2064
+ class GnomeShellClient extends Gio.DBusProxy implements KeybindingProvider, Gio.AsyncInitable<GnomeShellClient>, Gio.DBusInterface, Gio.Initable {
2036
2065
  static $gtype: GObject.GType<GnomeShellClient>;
2037
2066
 
2038
2067
  /**
@@ -2185,6 +2214,36 @@ export namespace GPaste {
2185
2214
  */
2186
2215
  ungrab_accelerator_sync(action: number): boolean;
2187
2216
 
2217
+ /**
2218
+ * Emit the "keybinding-activated" signal on `self`.
2219
+ * @param id the id of the activated shortcut (its dconf key)
2220
+ */
2221
+ emit_keybinding_activated(id: string): void;
2222
+
2223
+ /**
2224
+ * Replace all currently registered shortcuts with `accels`.
2225
+ * @param accels a `null`-terminated (by id) array of {@link GPaste.KeybindingAccelerator}
2226
+ */
2227
+ grab_all(accels: KeybindingAccelerator[]): void;
2228
+
2229
+ /**
2230
+ * Release all currently registered shortcuts.
2231
+ */
2232
+ ungrab_all(): void;
2233
+
2234
+ /**
2235
+ * Replace all currently registered shortcuts with `accels`.
2236
+ * @param accels a `null`-terminated (by id) array of {@link GPaste.KeybindingAccelerator}
2237
+ * @virtual
2238
+ */
2239
+ vfunc_grab_all(accels: KeybindingAccelerator[]): void;
2240
+
2241
+ /**
2242
+ * Release all currently registered shortcuts.
2243
+ * @virtual
2244
+ */
2245
+ vfunc_ungrab_all(): void;
2246
+
2188
2247
  /**
2189
2248
  * Starts asynchronous initialization of the object implementing the
2190
2249
  * interface. This must be done before any real use of the object after
@@ -2224,6 +2283,7 @@ export namespace GPaste {
2224
2283
  * any interface methods.
2225
2284
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2226
2285
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2286
+ * @since 2.22
2227
2287
  */
2228
2288
  init_async(io_priority: number, cancellable: Gio.Cancellable | null): globalThis.Promise<boolean>;
2229
2289
 
@@ -2267,6 +2327,7 @@ export namespace GPaste {
2267
2327
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2268
2328
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2269
2329
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
2330
+ * @since 2.22
2270
2331
  */
2271
2332
  init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
2272
2333
 
@@ -2310,6 +2371,7 @@ export namespace GPaste {
2310
2371
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2311
2372
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2312
2373
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
2374
+ * @since 2.22
2313
2375
  */
2314
2376
  init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): globalThis.Promise<boolean> | void;
2315
2377
 
@@ -2318,6 +2380,7 @@ export namespace GPaste {
2318
2380
  * See `g_async_initable_init_async()`.
2319
2381
  * @param res a {@link Gio.AsyncResult}.
2320
2382
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
2383
+ * @since 2.22
2321
2384
  */
2322
2385
  init_finish(res: Gio.AsyncResult): boolean;
2323
2386
 
@@ -2326,6 +2389,7 @@ export namespace GPaste {
2326
2389
  * calls, returning the created object or `null` on error.
2327
2390
  * @param res the {@link Gio.AsyncResult} from the callback
2328
2391
  * @returns a newly created {@link GObject.Object}, or `null` on error. Free with `g_object_unref()`.
2392
+ * @since 2.22
2329
2393
  */
2330
2394
  new_finish(res: Gio.AsyncResult): GnomeShellClient;
2331
2395
 
@@ -2375,6 +2439,7 @@ export namespace GPaste {
2375
2439
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2376
2440
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2377
2441
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
2442
+ * @since 2.22
2378
2443
  * @virtual
2379
2444
  */
2380
2445
  vfunc_init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
@@ -2383,6 +2448,7 @@ export namespace GPaste {
2383
2448
  * Finishes asynchronous initialization and returns the result.
2384
2449
  * See `g_async_initable_init_async()`.
2385
2450
  * @param res a {@link Gio.AsyncResult}.
2451
+ * @since 2.22
2386
2452
  * @virtual
2387
2453
  */
2388
2454
  vfunc_init_finish(res: Gio.AsyncResult): boolean;
@@ -2390,26 +2456,35 @@ export namespace GPaste {
2390
2456
  /**
2391
2457
  * Gets the {@link Gio.DBusObject} that `interface_` belongs to, if any.
2392
2458
  * @returns A {@link Gio.DBusObject} or `null`. The returned reference should be freed with `g_object_unref()`.
2459
+ * @since 2.32
2393
2460
  */
2394
2461
  get_object(): Gio.DBusObject | null;
2395
2462
 
2396
2463
  /**
2397
2464
  * Gets D-Bus introspection information for the D-Bus interface
2398
2465
  * implemented by `interface_`.
2466
+ *
2467
+ * This can return `null` if no {@link Gio.DBusInterfaceInfo} was provided during
2468
+ * construction of `interface_` and is also not made available otherwise.
2469
+ * For example, {@link Gio.DBusProxy} implements {@link Gio.DBusInterface} but allows for a `null`
2470
+ * {@link Gio.DBusInterfaceInfo}.
2399
2471
  * @returns A {@link Gio.DBusInterfaceInfo}. Do not free.
2472
+ * @since 2.30
2400
2473
  */
2401
- get_info(): Gio.DBusInterfaceInfo;
2474
+ get_info(): Gio.DBusInterfaceInfo | null;
2402
2475
 
2403
2476
  /**
2404
2477
  * Sets the {@link Gio.DBusObject} for `interface_` to `object`.
2405
2478
  *
2406
2479
  * Note that `interface_` will hold a weak reference to `object`.
2407
2480
  * @param object A {@link Gio.DBusObject} or `null`.
2481
+ * @since 2.30
2408
2482
  */
2409
2483
  set_object(object: Gio.DBusObject | null): void;
2410
2484
 
2411
2485
  /**
2412
2486
  * Gets the {@link Gio.DBusObject} that `interface_` belongs to, if any.
2487
+ * @since 2.32
2413
2488
  * @virtual
2414
2489
  */
2415
2490
  vfunc_dup_object(): Gio.DBusObject | null;
@@ -2417,15 +2492,22 @@ export namespace GPaste {
2417
2492
  /**
2418
2493
  * Gets D-Bus introspection information for the D-Bus interface
2419
2494
  * implemented by `interface_`.
2495
+ *
2496
+ * This can return `null` if no {@link Gio.DBusInterfaceInfo} was provided during
2497
+ * construction of `interface_` and is also not made available otherwise.
2498
+ * For example, {@link Gio.DBusProxy} implements {@link Gio.DBusInterface} but allows for a `null`
2499
+ * {@link Gio.DBusInterfaceInfo}.
2500
+ * @since 2.30
2420
2501
  * @virtual
2421
2502
  */
2422
- vfunc_get_info(): Gio.DBusInterfaceInfo;
2503
+ vfunc_get_info(): Gio.DBusInterfaceInfo | null;
2423
2504
 
2424
2505
  /**
2425
2506
  * Sets the {@link Gio.DBusObject} for `interface_` to `object`.
2426
2507
  *
2427
2508
  * Note that `interface_` will hold a weak reference to `object`.
2428
2509
  * @param object A {@link Gio.DBusObject} or `null`.
2510
+ * @since 2.30
2429
2511
  * @virtual
2430
2512
  */
2431
2513
  vfunc_set_object(object: Gio.DBusObject | null): void;
@@ -2471,6 +2553,7 @@ export namespace GPaste {
2471
2553
  * instance.
2472
2554
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2473
2555
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
2556
+ * @since 2.22
2474
2557
  */
2475
2558
  init(cancellable: Gio.Cancellable | null): boolean;
2476
2559
 
@@ -2514,6 +2597,7 @@ export namespace GPaste {
2514
2597
  * on the result of `g_object_new()`, regardless of whether it is in fact a new
2515
2598
  * instance.
2516
2599
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2600
+ * @since 2.22
2517
2601
  * @virtual
2518
2602
  */
2519
2603
  vfunc_init(cancellable: Gio.Cancellable | null): boolean;
@@ -2636,6 +2720,7 @@ export namespace GPaste {
2636
2720
  * any interface methods.
2637
2721
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2638
2722
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2723
+ * @since 2.22
2639
2724
  */
2640
2725
  init_async(io_priority: number, cancellable: Gio.Cancellable | null): globalThis.Promise<boolean>;
2641
2726
 
@@ -2679,6 +2764,7 @@ export namespace GPaste {
2679
2764
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2680
2765
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2681
2766
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
2767
+ * @since 2.22
2682
2768
  */
2683
2769
  init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
2684
2770
 
@@ -2722,6 +2808,7 @@ export namespace GPaste {
2722
2808
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2723
2809
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2724
2810
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
2811
+ * @since 2.22
2725
2812
  */
2726
2813
  init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback?: Gio.AsyncReadyCallback<this> | null): globalThis.Promise<boolean> | void;
2727
2814
 
@@ -2730,6 +2817,7 @@ export namespace GPaste {
2730
2817
  * See `g_async_initable_init_async()`.
2731
2818
  * @param res a {@link Gio.AsyncResult}.
2732
2819
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
2820
+ * @since 2.22
2733
2821
  */
2734
2822
  init_finish(res: Gio.AsyncResult): boolean;
2735
2823
 
@@ -2738,6 +2826,7 @@ export namespace GPaste {
2738
2826
  * calls, returning the created object or `null` on error.
2739
2827
  * @param res the {@link Gio.AsyncResult} from the callback
2740
2828
  * @returns a newly created {@link GObject.Object}, or `null` on error. Free with `g_object_unref()`.
2829
+ * @since 2.22
2741
2830
  */
2742
2831
  new_finish(res: Gio.AsyncResult): ScreensaverClient;
2743
2832
 
@@ -2787,6 +2876,7 @@ export namespace GPaste {
2787
2876
  * @param io_priority the [I/O priority](iface.AsyncResult.html#io-priority) of the operation
2788
2877
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2789
2878
  * @param callback a {@link Gio.AsyncReadyCallback} to call when the request is satisfied
2879
+ * @since 2.22
2790
2880
  * @virtual
2791
2881
  */
2792
2882
  vfunc_init_async(io_priority: number, cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback<this> | null): void;
@@ -2795,6 +2885,7 @@ export namespace GPaste {
2795
2885
  * Finishes asynchronous initialization and returns the result.
2796
2886
  * See `g_async_initable_init_async()`.
2797
2887
  * @param res a {@link Gio.AsyncResult}.
2888
+ * @since 2.22
2798
2889
  * @virtual
2799
2890
  */
2800
2891
  vfunc_init_finish(res: Gio.AsyncResult): boolean;
@@ -2802,26 +2893,35 @@ export namespace GPaste {
2802
2893
  /**
2803
2894
  * Gets the {@link Gio.DBusObject} that `interface_` belongs to, if any.
2804
2895
  * @returns A {@link Gio.DBusObject} or `null`. The returned reference should be freed with `g_object_unref()`.
2896
+ * @since 2.32
2805
2897
  */
2806
2898
  get_object(): Gio.DBusObject | null;
2807
2899
 
2808
2900
  /**
2809
2901
  * Gets D-Bus introspection information for the D-Bus interface
2810
2902
  * implemented by `interface_`.
2903
+ *
2904
+ * This can return `null` if no {@link Gio.DBusInterfaceInfo} was provided during
2905
+ * construction of `interface_` and is also not made available otherwise.
2906
+ * For example, {@link Gio.DBusProxy} implements {@link Gio.DBusInterface} but allows for a `null`
2907
+ * {@link Gio.DBusInterfaceInfo}.
2811
2908
  * @returns A {@link Gio.DBusInterfaceInfo}. Do not free.
2909
+ * @since 2.30
2812
2910
  */
2813
- get_info(): Gio.DBusInterfaceInfo;
2911
+ get_info(): Gio.DBusInterfaceInfo | null;
2814
2912
 
2815
2913
  /**
2816
2914
  * Sets the {@link Gio.DBusObject} for `interface_` to `object`.
2817
2915
  *
2818
2916
  * Note that `interface_` will hold a weak reference to `object`.
2819
2917
  * @param object A {@link Gio.DBusObject} or `null`.
2918
+ * @since 2.30
2820
2919
  */
2821
2920
  set_object(object: Gio.DBusObject | null): void;
2822
2921
 
2823
2922
  /**
2824
2923
  * Gets the {@link Gio.DBusObject} that `interface_` belongs to, if any.
2924
+ * @since 2.32
2825
2925
  * @virtual
2826
2926
  */
2827
2927
  vfunc_dup_object(): Gio.DBusObject | null;
@@ -2829,15 +2929,22 @@ export namespace GPaste {
2829
2929
  /**
2830
2930
  * Gets D-Bus introspection information for the D-Bus interface
2831
2931
  * implemented by `interface_`.
2932
+ *
2933
+ * This can return `null` if no {@link Gio.DBusInterfaceInfo} was provided during
2934
+ * construction of `interface_` and is also not made available otherwise.
2935
+ * For example, {@link Gio.DBusProxy} implements {@link Gio.DBusInterface} but allows for a `null`
2936
+ * {@link Gio.DBusInterfaceInfo}.
2937
+ * @since 2.30
2832
2938
  * @virtual
2833
2939
  */
2834
- vfunc_get_info(): Gio.DBusInterfaceInfo;
2940
+ vfunc_get_info(): Gio.DBusInterfaceInfo | null;
2835
2941
 
2836
2942
  /**
2837
2943
  * Sets the {@link Gio.DBusObject} for `interface_` to `object`.
2838
2944
  *
2839
2945
  * Note that `interface_` will hold a weak reference to `object`.
2840
2946
  * @param object A {@link Gio.DBusObject} or `null`.
2947
+ * @since 2.30
2841
2948
  * @virtual
2842
2949
  */
2843
2950
  vfunc_set_object(object: Gio.DBusObject | null): void;
@@ -2883,6 +2990,7 @@ export namespace GPaste {
2883
2990
  * instance.
2884
2991
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
2885
2992
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
2993
+ * @since 2.22
2886
2994
  */
2887
2995
  init(cancellable: Gio.Cancellable | null): boolean;
2888
2996
 
@@ -2926,6 +3034,7 @@ export namespace GPaste {
2926
3034
  * on the result of `g_object_new()`, regardless of whether it is in fact a new
2927
3035
  * instance.
2928
3036
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
3037
+ * @since 2.22
2929
3038
  * @virtual
2930
3039
  */
2931
3040
  vfunc_init(cancellable: Gio.Cancellable | null): boolean;
@@ -3048,6 +3157,18 @@ export namespace GPaste {
3048
3157
  */
3049
3158
  get_history_name(): string;
3050
3159
 
3160
+ /**
3161
+ * Get the "images-preview" setting
3162
+ * @returns the value of the "images-preview" setting
3163
+ */
3164
+ get_images_preview(): boolean;
3165
+
3166
+ /**
3167
+ * Get the "images-preview-size" setting
3168
+ * @returns the value of the "images-preview-size" setting
3169
+ */
3170
+ get_images_preview_size(): number;
3171
+
3051
3172
  /**
3052
3173
  * Get the "images-support" setting
3053
3174
  * @returns the value of the "images-support" setting
@@ -3199,6 +3320,16 @@ export namespace GPaste {
3199
3320
  */
3200
3321
  reset_history_name(): void;
3201
3322
 
3323
+ /**
3324
+ * Reset the "images-preview" setting
3325
+ */
3326
+ reset_images_preview(): void;
3327
+
3328
+ /**
3329
+ * Reset the "images-preview-size" setting
3330
+ */
3331
+ reset_images_preview_size(): void;
3332
+
3202
3333
  /**
3203
3334
  * Reset the "images-support" setting
3204
3335
  */
@@ -3340,6 +3471,18 @@ export namespace GPaste {
3340
3471
  */
3341
3472
  set_history_name(value: string): void;
3342
3473
 
3474
+ /**
3475
+ * Change the "images-preview" setting
3476
+ * @param value whether to enable or not image previews
3477
+ */
3478
+ set_images_preview(value: boolean): void;
3479
+
3480
+ /**
3481
+ * Change the "images-preview-size" setting
3482
+ * @param value the size of image previews in pixels
3483
+ */
3484
+ set_images_preview_size(value: bigint | number): void;
3485
+
3343
3486
  /**
3344
3487
  * Change the "images-support" setting
3345
3488
  * @param value the new history name
@@ -3498,6 +3641,36 @@ export namespace GPaste {
3498
3641
  */
3499
3642
  type GnomeShellClientClass = typeof GnomeShellClient;
3500
3643
 
3644
+ /**
3645
+ * Represents a global shortcut to be registered with a {@link GPaste.KeybindingProvider}.
3646
+ * Terminate an array of these with an entry whose `id` is `null`.
3647
+ * @gir-type Struct
3648
+ */
3649
+ class KeybindingAccelerator {
3650
+ static $gtype: GObject.GType<KeybindingAccelerator>;
3651
+
3652
+ // Fields
3653
+ id: string;
3654
+
3655
+ accelerator: string;
3656
+
3657
+ description: string;
3658
+
3659
+ // Constructors
3660
+
3661
+ constructor(properties?: Partial<{
3662
+ id: string;
3663
+ accelerator: string;
3664
+ description: string;
3665
+ }>);
3666
+ }
3667
+
3668
+
3669
+ /**
3670
+ * @gir-type Alias
3671
+ */
3672
+ type KeybindingProviderInterface = typeof KeybindingProvider;
3673
+
3501
3674
  /**
3502
3675
  * @gir-type Alias
3503
3676
  */
@@ -3508,6 +3681,66 @@ export namespace GPaste {
3508
3681
  */
3509
3682
  type SettingsClass = typeof Settings;
3510
3683
 
3684
+ namespace KeybindingProvider {
3685
+ /**
3686
+ * Interface for implementing KeybindingProvider.
3687
+ * Contains only the virtual methods that need to be implemented.
3688
+ */
3689
+ interface Interface {
3690
+
3691
+ // Virtual methods
3692
+ /**
3693
+ * Replace all currently registered shortcuts with `accels`.
3694
+ * @param accels a `null`-terminated (by id) array of {@link GPaste.KeybindingAccelerator}
3695
+ * @virtual
3696
+ */
3697
+ vfunc_grab_all(accels: KeybindingAccelerator[]): void;
3698
+
3699
+ /**
3700
+ * Release all currently registered shortcuts.
3701
+ * @virtual
3702
+ */
3703
+ vfunc_ungrab_all(): void;
3704
+ }
3705
+
3706
+
3707
+ // Constructor properties interface
3708
+ interface ConstructorProps extends GObject.Object.ConstructorProps {}
3709
+ }
3710
+
3711
+ export interface KeybindingProviderNamespace {
3712
+ $gtype: GObject.GType<KeybindingProvider>;
3713
+ prototype: KeybindingProvider;
3714
+ }
3715
+ /**
3716
+ * @gir-type Interface
3717
+ */
3718
+ interface KeybindingProvider extends GObject.Object, KeybindingProvider.Interface {
3719
+
3720
+ // Methods
3721
+ /**
3722
+ * Emit the "keybinding-activated" signal on `self`.
3723
+ * @param id the id of the activated shortcut (its dconf key)
3724
+ */
3725
+ emit_keybinding_activated(id: string): void;
3726
+
3727
+ /**
3728
+ * Replace all currently registered shortcuts with `accels`.
3729
+ * @param accels a `null`-terminated (by id) array of {@link GPaste.KeybindingAccelerator}
3730
+ */
3731
+ grab_all(accels: KeybindingAccelerator[]): void;
3732
+
3733
+ /**
3734
+ * Release all currently registered shortcuts.
3735
+ */
3736
+ ungrab_all(): void;
3737
+ }
3738
+
3739
+
3740
+ export const KeybindingProvider: KeybindingProviderNamespace & {
3741
+ new (): KeybindingProvider; // This allows `obj instanceof KeybindingProvider`
3742
+ };
3743
+
3511
3744
  /**
3512
3745
  * Name of the imported GIR library
3513
3746
  * `see` https://gitlab.gnome.org/GNOME/gjs/-/blob/master/gi/ns.cpp#L188
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gpaste-2",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "GJS TypeScript type definitions for GPaste-2",
5
5
  "type": "module",
6
6
  "module": "gpaste-2.js",
@@ -31,11 +31,11 @@
31
31
  "test": "tsc --project tsconfig.json"
32
32
  },
33
33
  "dependencies": {
34
- "@girs/gjs": "^4.2.0",
35
- "@girs/gio-2.0": "^4.2.0",
36
- "@girs/gobject-2.0": "^4.2.0",
37
- "@girs/glib-2.0": "^4.2.0",
38
- "@girs/gmodule-2.0": "^4.2.0" },
34
+ "@girs/gjs": "^4.4.0",
35
+ "@girs/gio-2.0": "^4.4.0",
36
+ "@girs/gobject-2.0": "^4.4.0",
37
+ "@girs/glib-2.0": "^4.4.0",
38
+ "@girs/gmodule-2.0": "^4.4.0" },
39
39
  "devDependencies": {
40
40
  "typescript": "*"
41
41
  },