@girs/budgie-3.0 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.
- package/README.md +8 -8
- package/budgie-3.0-surface.d.ts +20 -0
- package/budgie-3.0-surface.js +6 -0
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -5,25 +5,25 @@
|
|
|
5
5
|

|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
GJS TypeScript type definitions for Budgie-3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.
|
|
8
|
+
GJS TypeScript type definitions for Budgie-3.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.4.0.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Install the type definitions with npm:
|
|
13
13
|
```bash
|
|
14
14
|
npm install @girs/budgie-3.0
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Import it like any other module:
|
|
20
20
|
```ts
|
|
21
21
|
import Budgie from '@girs/budgie-3.0';
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
### Ambient Modules
|
|
25
25
|
|
|
26
|
-
|
|
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/budgie-3.0` or `@girs/budgie-3.0/ambient` in your `tsconfig` or entry point Typescript file:
|
|
28
28
|
|
|
29
29
|
`index.ts`:
|
|
@@ -42,7 +42,7 @@ import '@girs/budgie-3.0'
|
|
|
42
42
|
}
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
The ambient module now resolves with types:
|
|
46
46
|
|
|
47
47
|
```ts
|
|
48
48
|
import Budgie from 'gi://Budgie?version=3.0';
|
|
@@ -50,7 +50,7 @@ import Budgie from 'gi://Budgie?version=3.0';
|
|
|
50
50
|
|
|
51
51
|
### Global import
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
GJS's global `imports.gi` works too, with types.
|
|
54
54
|
For this you need to include `@girs/budgie-3.0` or `@girs/budgie-3.0/import` in your `tsconfig` or entry point Typescript file:
|
|
55
55
|
|
|
56
56
|
`index.ts`:
|
|
@@ -69,7 +69,7 @@ import '@girs/budgie-3.0'
|
|
|
69
69
|
}
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
That form carries types as well:
|
|
73
73
|
|
|
74
74
|
```ts
|
|
75
75
|
const Budgie = imports.gi.Budgie;
|
|
@@ -77,7 +77,7 @@ const Budgie = imports.gi.Budgie;
|
|
|
77
77
|
|
|
78
78
|
### Bundle
|
|
79
79
|
|
|
80
|
-
|
|
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/budgie-3.0-surface.d.ts
CHANGED
|
@@ -100,6 +100,23 @@ export interface Widgets {
|
|
|
100
100
|
/** Every GType this namespace can create. A consumer derives its own tag map. */
|
|
101
101
|
export type WidgetGType = keyof Widgets;
|
|
102
102
|
|
|
103
|
+
// ---------------------------------------------------------------------------
|
|
104
|
+
// Child holders — the same shape, for objects that CARRY a widget without being one.
|
|
105
|
+
//
|
|
106
|
+
// `GtkListItem`, `GtkListHeader`, `GtkColumnViewCell` and `AdwToggle` descend from
|
|
107
|
+
// `GObject.Object` and hold a widget through `set_child`/`get_child`. A renderer places
|
|
108
|
+
// them exactly like a container, so they belong in the vocabulary; a check asking "is
|
|
109
|
+
// this a widget" must still be able to say no. Hence a sibling table rather than four
|
|
110
|
+
// more rows in `Widgets`: concatenate them when you mean both.
|
|
111
|
+
// ---------------------------------------------------------------------------
|
|
112
|
+
|
|
113
|
+
export interface ChildHolders {
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** Every GType this namespace holds a child in without it being a widget. */
|
|
118
|
+
export type ChildHolderGType = keyof ChildHolders;
|
|
119
|
+
|
|
103
120
|
/** The writable, optional, GObject-keyed property surface of one GType. */
|
|
104
121
|
export type PropsOf<G extends WidgetGType> = Widgets[G]['props'];
|
|
105
122
|
|
|
@@ -135,6 +152,9 @@ export const OWN_SIGNALS: Readonly<Record<string, readonly string[]>>;
|
|
|
135
152
|
/** Widget GType -> every declaration its members come from, self first. */
|
|
136
153
|
export const DECLS: Readonly<Record<string, readonly string[]>>;
|
|
137
154
|
|
|
155
|
+
/** The GTypes in `DECLS` that hold a widget without being one — see `ChildHolders`. */
|
|
156
|
+
export const CHILD_HOLDERS: readonly string[];
|
|
157
|
+
|
|
138
158
|
/** Enum GType -> the nicks this surface offers. */
|
|
139
159
|
export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
|
|
140
160
|
|
package/budgie-3.0-surface.js
CHANGED
|
@@ -21,6 +21,12 @@ export const DECLS = {
|
|
|
21
21
|
BudgiePopover: ['BudgiePopover', 'GtkPopover', 'GtkBin', 'GtkContainer', 'GtkWidget', 'GtkBuildable'],
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
+
// The GTypes above that are NOT widgets: they hold one through `set_child`/`get_child`
|
|
25
|
+
// and descend from `GObject.Object`. A renderer places them like a container; a check
|
|
26
|
+
// asking "is this a widget" must not count them. Derived from the accessor pair, never
|
|
27
|
+
// from a list — the count is in the provenance line above.
|
|
28
|
+
export const CHILD_HOLDERS = [];
|
|
29
|
+
|
|
24
30
|
export const ENUM_NICKS = {};
|
|
25
31
|
|
|
26
32
|
export const SLOT_CANDIDATES = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/budgie-3.0",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Budgie-3.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "budgie-3.0.js",
|
|
@@ -36,21 +36,21 @@
|
|
|
36
36
|
"test": "tsc --project tsconfig.json"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@girs/gjs": "^4.
|
|
40
|
-
"@girs/peas-2": "^4.
|
|
41
|
-
"@girs/gio-2.0": "^4.
|
|
42
|
-
"@girs/gobject-2.0": "^4.
|
|
43
|
-
"@girs/glib-2.0": "^4.
|
|
44
|
-
"@girs/gmodule-2.0": "^4.
|
|
45
|
-
"@girs/gtk-3.0": "^4.
|
|
46
|
-
"@girs/xlib-2.0": "^4.
|
|
47
|
-
"@girs/gdk-3.0": "^4.
|
|
48
|
-
"@girs/cairo-1.0": "^4.
|
|
49
|
-
"@girs/pango-1.0": "^4.
|
|
50
|
-
"@girs/harfbuzz-0.0": "^4.
|
|
51
|
-
"@girs/freetype2-2.0": "^4.
|
|
52
|
-
"@girs/gdkpixbuf-2.0": "^4.
|
|
53
|
-
"@girs/atk-1.0": "^4.
|
|
39
|
+
"@girs/gjs": "^4.4.0",
|
|
40
|
+
"@girs/peas-2": "^4.4.0",
|
|
41
|
+
"@girs/gio-2.0": "^4.4.0",
|
|
42
|
+
"@girs/gobject-2.0": "^4.4.0",
|
|
43
|
+
"@girs/glib-2.0": "^4.4.0",
|
|
44
|
+
"@girs/gmodule-2.0": "^4.4.0",
|
|
45
|
+
"@girs/gtk-3.0": "^4.4.0",
|
|
46
|
+
"@girs/xlib-2.0": "^4.4.0",
|
|
47
|
+
"@girs/gdk-3.0": "^4.4.0",
|
|
48
|
+
"@girs/cairo-1.0": "^4.4.0",
|
|
49
|
+
"@girs/pango-1.0": "^4.4.0",
|
|
50
|
+
"@girs/harfbuzz-0.0": "^4.4.0",
|
|
51
|
+
"@girs/freetype2-2.0": "^4.4.0",
|
|
52
|
+
"@girs/gdkpixbuf-2.0": "^4.4.0",
|
|
53
|
+
"@girs/atk-1.0": "^4.4.0" },
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"typescript": "*"
|
|
56
56
|
},
|