@girs/cinnamondesktop-3.0 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 CHANGED
@@ -4,82 +4,77 @@
4
4
  ![version](https://img.shields.io/npm/v/@girs/cinnamondesktop-3.0)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/cinnamondesktop-3.0)
6
6
 
7
+ GJS TypeScript type definitions for CinnamonDesktop-3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.6.0.
7
8
 
8
- GJS TypeScript type definitions for CinnamonDesktop-3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.0.
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/cinnamondesktop-3.0
15
16
  ```
16
17
 
17
- ## Usage
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/cinnamondesktop-3.0` | the namespace as a default export, plus the ambient and global declarations |
26
+ | `@girs/cinnamondesktop-3.0/ambient` | only the `gi://` module declarations |
27
+ | `@girs/cinnamondesktop-3.0/import` | only the `imports.gi` declarations |
28
+ | `@girs/cinnamondesktop-3.0/cinnamondesktop-3.0` | 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 CinnamonDesktop from '@girs/cinnamondesktop-3.0';
22
38
  ```
23
39
 
24
- ### Ambient Modules
40
+ ### As `gi://`
25
41
 
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
- For this you need to include `@girs/cinnamondesktop-3.0` or `@girs/cinnamondesktop-3.0/ambient` in your `tsconfig` or entry point Typescript file:
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/cinnamondesktop-3.0'
46
+ import '@girs/cinnamondesktop-3.0';
32
47
  ```
33
48
 
34
- `tsconfig.json`:
35
49
  ```json
36
- {
37
- "compilerOptions": {
38
- ...
39
- },
40
- "include": ["@girs/cinnamondesktop-3.0"],
41
- ...
42
- }
50
+ { "include": ["@girs/cinnamondesktop-3.0"] }
43
51
  ```
44
52
 
45
- The ambient module now resolves with types:
53
+ Then the runtime spelling type-checks:
46
54
 
47
55
  ```ts
48
56
  import CinnamonDesktop from 'gi://CinnamonDesktop?version=3.0';
49
57
  ```
50
58
 
51
- ### Global import
52
-
53
- GJS's global `imports.gi` works too, with types.
54
- For this you need to include `@girs/cinnamondesktop-3.0` or `@girs/cinnamondesktop-3.0/import` in your `tsconfig` or entry point Typescript file:
59
+ Referencing `@girs/cinnamondesktop-3.0/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
- `index.ts`:
57
- ```ts
58
- import '@girs/cinnamondesktop-3.0'
59
- ```
60
-
61
- `tsconfig.json`:
62
- ```json
63
- {
64
- "compilerOptions": {
65
- ...
66
- },
67
- "include": ["@girs/cinnamondesktop-3.0"],
68
- ...
69
- }
70
- ```
62
+ ### As `imports.gi`
71
63
 
72
- That form carries types as well:
64
+ GJS's global object works the same way, via `@girs/cinnamondesktop-3.0/import`:
73
65
 
74
66
  ```ts
75
67
  const CinnamonDesktop = imports.gi.CinnamonDesktop;
76
68
  ```
77
69
 
78
- ### Bundle
70
+ ## Building
79
71
 
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.
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
- All existing pre-generated packages can be found on [gjsify/types](https://github.com/gjsify/types).
78
+ Every pre-generated package is at [gjsify/types](https://github.com/gjsify/types).
79
+
85
80
 
@@ -37,8 +37,8 @@ export namespace CinnamonDesktop {
37
37
  * @gir-type Enum
38
38
  */
39
39
  enum DesktopThumbnailSize {
40
- NORMAL,
41
- LARGE,
40
+ NORMAL = 0,
41
+ LARGE = 1,
42
42
  }
43
43
 
44
44
 
@@ -46,11 +46,11 @@ export namespace CinnamonDesktop {
46
46
  * @gir-type Enum
47
47
  */
48
48
  enum RRDpmsMode {
49
- ON,
50
- STANDBY,
51
- SUSPEND,
52
- OFF,
53
- UNKNOWN,
49
+ ON = 0,
50
+ STANDBY = 1,
51
+ SUSPEND = 2,
52
+ OFF = 3,
53
+ UNKNOWN = 4,
54
54
  }
55
55
 
56
56
 
@@ -65,11 +65,11 @@ export namespace CinnamonDesktop {
65
65
  * @gir-type Enum
66
66
  */
67
67
  enum RRDpmsModeType {
68
- ON,
69
- STANDBY,
70
- SUSPEND,
71
- OFF,
72
- UNKNOWN,
68
+ ON = 0,
69
+ STANDBY = 1,
70
+ SUSPEND = 2,
71
+ OFF = 3,
72
+ UNKNOWN = 4,
73
73
  }
74
74
 
75
75
 
@@ -99,6 +99,9 @@ export namespace CinnamonDesktop {
99
99
  }
100
100
 
101
101
 
102
+ /**
103
+ * @default Panel
104
+ */
102
105
  const RR_CONNECTOR_TYPE_PANEL: string;
103
106
 
104
107
  /**
@@ -372,6 +375,7 @@ export namespace CinnamonDesktop {
372
375
  * created. It solely means that no error condition was hit sending the request.
373
376
  * @param res A {@link Gio.AsyncResult}
374
377
  * @returns `false` on error, `true` otherwise
378
+ * @throws GLib.Error
375
379
  */
376
380
  function start_systemd_scope_finish(res: Gio.AsyncResult): boolean;
377
381
 
@@ -386,13 +390,13 @@ export namespace CinnamonDesktop {
386
390
  * @gir-type Flags
387
391
  */
388
392
  enum RRRotation {
389
- ROTATION_NEXT,
390
- ROTATION_0,
391
- ROTATION_90,
392
- ROTATION_180,
393
- ROTATION_270,
394
- REFLECT_X,
395
- REFLECT_Y,
393
+ ROTATION_NEXT = 0,
394
+ ROTATION_0 = 1,
395
+ ROTATION_90 = 2,
396
+ ROTATION_180 = 4,
397
+ ROTATION_270 = 8,
398
+ REFLECT_X = 16,
399
+ REFLECT_Y = 32,
396
400
  }
397
401
 
398
402
 
@@ -613,7 +617,7 @@ export namespace CinnamonDesktop {
613
617
  * @signal
614
618
  * @run-last
615
619
  */
616
- finished: (arg0: GObject.Object) => void;
620
+ finished: (window: GObject.Object) => void;
617
621
  "notify::height": (pspec: GObject.ParamSpec) => void;
618
622
  "notify::width": (pspec: GObject.ParamSpec) => void;
619
623
  }
@@ -963,6 +967,7 @@ export namespace CinnamonDesktop {
963
967
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
964
968
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
965
969
  * @since 2.22
970
+ * @throws GLib.Error
966
971
  */
967
972
  init(cancellable: Gio.Cancellable | null): boolean;
968
973
 
@@ -1122,16 +1127,19 @@ export namespace CinnamonDesktop {
1122
1127
  // Methods
1123
1128
  /**
1124
1129
  * @param screen
1130
+ * @throws GLib.Error
1125
1131
  */
1126
1132
  applicable(screen: RRScreen): boolean;
1127
1133
 
1128
1134
  /**
1129
1135
  * @param screen
1136
+ * @throws GLib.Error
1130
1137
  */
1131
1138
  apply(screen: RRScreen): boolean;
1132
1139
 
1133
1140
  /**
1134
1141
  * @param screen
1142
+ * @throws GLib.Error
1135
1143
  */
1136
1144
  apply_persistent(screen: RRScreen): boolean;
1137
1145
 
@@ -1152,6 +1160,9 @@ export namespace CinnamonDesktop {
1152
1160
  */
1153
1161
  get_outputs(): RROutputInfo[];
1154
1162
 
1163
+ /**
1164
+ * @throws GLib.Error
1165
+ */
1155
1166
  load_current(): boolean;
1156
1167
 
1157
1168
  /**
@@ -1400,7 +1411,7 @@ export namespace CinnamonDesktop {
1400
1411
  * @signal
1401
1412
  * @run-first
1402
1413
  */
1403
- "output-connected": (arg0: null) => void;
1414
+ "output-connected": (output: null) => void;
1404
1415
  /**
1405
1416
  * This signal is emitted when a display device is disconnected from
1406
1417
  * a port, or a port output is hot-unplugged. The latter can happen
@@ -1417,7 +1428,7 @@ export namespace CinnamonDesktop {
1417
1428
  * @signal
1418
1429
  * @run-first
1419
1430
  */
1420
- "output-disconnected": (arg0: null) => void;
1431
+ "output-disconnected": (output: null) => void;
1421
1432
  "notify::dpms-mode": (pspec: GObject.ParamSpec) => void;
1422
1433
  "notify::gdk-screen": (pspec: GObject.ParamSpec) => void;
1423
1434
  }
@@ -1526,6 +1537,9 @@ export namespace CinnamonDesktop {
1526
1537
  */
1527
1538
  get_crtc_by_id(id: number): RRCrtc;
1528
1539
 
1540
+ /**
1541
+ * @throws GLib.Error
1542
+ */
1529
1543
  get_dpms_mode(): [boolean, RRDpmsMode];
1530
1544
 
1531
1545
  /**
@@ -1569,12 +1583,14 @@ export namespace CinnamonDesktop {
1569
1583
  * Refreshes the screen configuration, and calls the screen's callback if it
1570
1584
  * exists and if the screen's configuration changed.
1571
1585
  * @returns TRUE if the screen's configuration changed; otherwise, the function returns FALSE and a NULL error if the configuration didn't change, or FALSE and a non-NULL error if there was an error while refreshing the configuration.
1586
+ * @throws GLib.Error
1572
1587
  */
1573
1588
  refresh(): boolean;
1574
1589
 
1575
1590
  /**
1576
1591
  * This method also disables the DPMS timeouts.
1577
1592
  * @param mode
1593
+ * @throws GLib.Error
1578
1594
  */
1579
1595
  set_dpms_mode(mode: RRDpmsMode): boolean;
1580
1596
 
@@ -1715,6 +1731,7 @@ export namespace CinnamonDesktop {
1715
1731
  * @param res a {@link Gio.AsyncResult}.
1716
1732
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
1717
1733
  * @since 2.22
1734
+ * @throws GLib.Error
1718
1735
  */
1719
1736
  init_finish(res: Gio.AsyncResult): boolean;
1720
1737
 
@@ -1724,6 +1741,7 @@ export namespace CinnamonDesktop {
1724
1741
  * @param res the {@link Gio.AsyncResult} from the callback
1725
1742
  * @returns a newly created {@link GObject.Object}, or `null` on error. Free with `g_object_unref()`.
1726
1743
  * @since 2.22
1744
+ * @throws GLib.Error
1727
1745
  */
1728
1746
  new_finish(res: Gio.AsyncResult): RRScreen;
1729
1747
 
@@ -1823,6 +1841,7 @@ export namespace CinnamonDesktop {
1823
1841
  * @param cancellable optional {@link Gio.Cancellable} object, `null` to ignore.
1824
1842
  * @returns `true` if successful. If an error has occurred, this function will return `false` and set `error` appropriately if present.
1825
1843
  * @since 2.22
1844
+ * @throws GLib.Error
1826
1845
  */
1827
1846
  init(cancellable: Gio.Cancellable | null): boolean;
1828
1847
 
@@ -2369,6 +2388,7 @@ export namespace CinnamonDesktop {
2369
2388
  /**
2370
2389
  * @param value the absolute value which is 0 >= this <= 100
2371
2390
  * @returns `true` for success
2391
+ * @throws GLib.Error
2372
2392
  */
2373
2393
  set_backlight(value: number): boolean;
2374
2394
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/cinnamondesktop-3.0",
3
- "version": "4.4.0",
3
+ "version": "4.6.0",
4
4
  "description": "GJS TypeScript type definitions for CinnamonDesktop-3.0",
5
5
  "type": "module",
6
6
  "module": "cinnamondesktop-3.0.js",
@@ -31,21 +31,21 @@
31
31
  "test": "tsc --project tsconfig.json"
32
32
  },
33
33
  "dependencies": {
34
- "@girs/gjs": "^4.4.0",
35
- "@girs/gtk-3.0": "^4.4.0",
36
- "@girs/xlib-2.0": "^4.4.0",
37
- "@girs/gdk-3.0": "^4.4.0",
38
- "@girs/cairo-1.0": "^4.4.0",
39
- "@girs/gobject-2.0": "^4.4.0",
40
- "@girs/glib-2.0": "^4.4.0",
41
- "@girs/pango-1.0": "^4.4.0",
42
- "@girs/harfbuzz-0.0": "^4.4.0",
43
- "@girs/freetype2-2.0": "^4.4.0",
44
- "@girs/gio-2.0": "^4.4.0",
45
- "@girs/gmodule-2.0": "^4.4.0",
46
- "@girs/gdkpixbuf-2.0": "^4.4.0",
47
- "@girs/atk-1.0": "^4.4.0",
48
- "@girs/cdesktopenums-3.0": "^4.4.0" },
34
+ "@girs/gjs": "^4.6.0",
35
+ "@girs/gtk-3.0": "^4.6.0",
36
+ "@girs/xlib-2.0": "^4.6.0",
37
+ "@girs/gdk-3.0": "^4.6.0",
38
+ "@girs/cairo-1.0": "^4.6.0",
39
+ "@girs/gobject-2.0": "^4.6.0",
40
+ "@girs/glib-2.0": "^4.6.0",
41
+ "@girs/pango-1.0": "^4.6.0",
42
+ "@girs/harfbuzz-0.0": "^4.6.0",
43
+ "@girs/freetype2-2.0": "^4.6.0",
44
+ "@girs/gio-2.0": "^4.6.0",
45
+ "@girs/gmodule-2.0": "^4.6.0",
46
+ "@girs/gdkpixbuf-2.0": "^4.6.0",
47
+ "@girs/atk-1.0": "^4.6.0",
48
+ "@girs/cdesktopenums-3.0": "^4.6.0" },
49
49
  "devDependencies": {
50
50
  "typescript": "*"
51
51
  },