@girs/gtef-2 5.0.0 → 5.1.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 +1 -1
- package/gtef-2-vocabulary.d.ts +39 -0
- package/gtef-2-vocabulary.js +25 -0
- package/package.json +16 -16
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
GJS TypeScript type definitions for Gtef-2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v5.
|
|
7
|
+
GJS TypeScript type definitions for Gtef-2 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v5.1.0.
|
|
8
8
|
|
|
9
9
|
This package contains type declarations only. It ships no runtime code, so it adds
|
|
10
10
|
nothing to your program and works with any bundler or none at all.
|
package/gtef-2-vocabulary.d.ts
CHANGED
|
@@ -261,6 +261,45 @@ export const FLAG_VALUES_UNREADABLE: Readonly<Record<string, string>>;
|
|
|
261
261
|
*/
|
|
262
262
|
export const PROP_ENUMS: Readonly<Record<string, string>>;
|
|
263
263
|
|
|
264
|
+
/**
|
|
265
|
+
* The kinds of value a GTK accessible property, relation or state takes.
|
|
266
|
+
*
|
|
267
|
+
* `enum` is the one that needs a second lookup: `ARIA_VALUE_ENUMS` names the enum GType,
|
|
268
|
+
* and `ENUM_NICKS` and `ENUM_VALUES` answer from there.
|
|
269
|
+
*/
|
|
270
|
+
export type AriaValueType = 'string' | 'integer' | 'double' | 'boolean' | 'reference' | 'enum';
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* `<enum GType>.<nick>` -> the kind of value that ARIA slot takes.
|
|
274
|
+
*
|
|
275
|
+
* The one table in this file that is not a fact about a ParamSpec. A GtkBuilder or
|
|
276
|
+
* Blueprint `accessibility { … }` block is typed by GTK's ARIA table, not by the widget,
|
|
277
|
+
* and the two disagree where it costs most: `orientation` is settable on a `GtkLabel`
|
|
278
|
+
* that implements no `GtkOrientable`, and `checked` is a `GtkAccessibleTristate`, so
|
|
279
|
+
* `checked: true` is the number 1 rather than a boolean. Typing those slots from the
|
|
280
|
+
* widget's properties gets both wrong and raises nothing.
|
|
281
|
+
*
|
|
282
|
+
* Keyed like `ENUM_VALUES` because the ARIA names ARE enum members — of
|
|
283
|
+
* `GtkAccessibleProperty`, `GtkAccessibleRelation` and `GtkAccessibleState` — so
|
|
284
|
+
* `ENUM_NICKS` already lists them and one key parser reads both.
|
|
285
|
+
*
|
|
286
|
+
* Read from each member's own GIR documentation. `gtk_accessible_property_init_value()`
|
|
287
|
+
* is the C half of this table and is not introspectable; the doc sentence is, and states
|
|
288
|
+
* the type for 52 of the 53 members in gtk4 4.23.3. Complete or absent, never partial: a
|
|
289
|
+
* member the generator cannot answer for fails the build and names itself.
|
|
290
|
+
*/
|
|
291
|
+
export const ARIA_VALUE_TYPES: Readonly<Record<string, AriaValueType>>;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* The same keys, for the `'enum'` rows only -> the GType of that enum.
|
|
295
|
+
*
|
|
296
|
+
* A table of its own for the reason `PROP_ENUMS` is one: folded in, the values of
|
|
297
|
+
* `ARIA_VALUE_TYPES` would be six reserved words mixed with arbitrary GTypes and telling
|
|
298
|
+
* them apart would be the consumer's problem. Apart, `ARIA_VALUE_TYPES[k] === 'enum'` is
|
|
299
|
+
* the whole test and `ENUM_NICKS[ARIA_VALUE_ENUMS[k]]` is the nick list.
|
|
300
|
+
*/
|
|
301
|
+
export const ARIA_VALUE_ENUMS: Readonly<Record<string, string>>;
|
|
302
|
+
|
|
264
303
|
/** Widget GType -> slot name -> the method that may adopt a child there. */
|
|
265
304
|
export const SLOT_CANDIDATES: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
266
305
|
|
package/gtef-2-vocabulary.js
CHANGED
|
@@ -130,6 +130,31 @@ export const FLAG_VALUES_UNREADABLE = {};
|
|
|
130
130
|
// vocabulary loaded too. Owners that emit none (Gdk, Pango) are inlined into the tables above.
|
|
131
131
|
export const PROP_ENUMS = {};
|
|
132
132
|
|
|
133
|
+
// `<enum GType>.<nick>` -> the kind of value that ARIA slot takes.
|
|
134
|
+
//
|
|
135
|
+
// The one table here that is not about a ParamSpec. A GtkBuilder or Blueprint
|
|
136
|
+
// `accessibility { … }` block is typed by GTK's ARIA table instead, and the two disagree
|
|
137
|
+
// where it matters: `orientation` is settable on a `GtkLabel` that implements no
|
|
138
|
+
// `GtkOrientable` and has no such property, and `checked` is a `GtkAccessibleTristate`, so
|
|
139
|
+
// `checked: true` means the number 1 and not the boolean. A consumer typing those slots
|
|
140
|
+
// from the widget gets both wrong, silently.
|
|
141
|
+
//
|
|
142
|
+
// Read from each member's own documentation, which is where GTK keeps the table --
|
|
143
|
+
// `gtk_accessible_property_init_value()` is the C half and is not introspectable, the
|
|
144
|
+
// sentence is. Complete or absent, never partial: a member whose documentation states no
|
|
145
|
+
// value type fails generation and names itself, because a missing row is indistinguishable
|
|
146
|
+
// from "GTK has no such name" and the plausible fallback emits `true` where GTK means 1.
|
|
147
|
+
export const ARIA_VALUE_TYPES = {};
|
|
148
|
+
|
|
149
|
+
// The same keys, for the `'enum'` rows only -> the GType of the enum.
|
|
150
|
+
//
|
|
151
|
+
// The join on from a kind to a number, and a table of its own for the reason `PROP_ENUMS`
|
|
152
|
+
// is one: folding the GType into `ARIA_VALUE_TYPES` would make its values a mix of six
|
|
153
|
+
// reserved words and arbitrary GTypes, and telling them apart would be the consumer's
|
|
154
|
+
// problem. With this, `ARIA_VALUE_TYPES[k] === 'enum'` is the whole test, and
|
|
155
|
+
// `ENUM_NICKS[ARIA_VALUE_ENUMS[k]]` is the nick list.
|
|
156
|
+
export const ARIA_VALUE_ENUMS = {};
|
|
157
|
+
|
|
133
158
|
export const SLOT_CANDIDATES = {
|
|
134
159
|
GtefInfoBar: {
|
|
135
160
|
'content-widget': 'add_content_widget',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/gtef-2",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Gtef-2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "gtef-2.js",
|
|
@@ -36,21 +36,21 @@
|
|
|
36
36
|
"test": "tsc --project tsconfig.json"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@girs/gjs": "^5.
|
|
40
|
-
"@girs/gtksource-3.0": "^5.
|
|
41
|
-
"@girs/gtk-3.0": "^5.
|
|
42
|
-
"@girs/xlib-2.0": "^5.
|
|
43
|
-
"@girs/gdk-3.0": "^5.
|
|
44
|
-
"@girs/cairo-1.0": "^5.
|
|
45
|
-
"@girs/gobject-2.0": "^5.
|
|
46
|
-
"@girs/glib-2.0": "^5.
|
|
47
|
-
"@girs/pango-1.0": "^5.
|
|
48
|
-
"@girs/harfbuzz-0.0": "^5.
|
|
49
|
-
"@girs/freetype2-2.0": "^5.
|
|
50
|
-
"@girs/gio-2.0": "^5.
|
|
51
|
-
"@girs/gmodule-2.0": "^5.
|
|
52
|
-
"@girs/gdkpixbuf-2.0": "^5.
|
|
53
|
-
"@girs/atk-1.0": "^5.
|
|
39
|
+
"@girs/gjs": "^5.1.0",
|
|
40
|
+
"@girs/gtksource-3.0": "^5.1.0",
|
|
41
|
+
"@girs/gtk-3.0": "^5.1.0",
|
|
42
|
+
"@girs/xlib-2.0": "^5.1.0",
|
|
43
|
+
"@girs/gdk-3.0": "^5.1.0",
|
|
44
|
+
"@girs/cairo-1.0": "^5.1.0",
|
|
45
|
+
"@girs/gobject-2.0": "^5.1.0",
|
|
46
|
+
"@girs/glib-2.0": "^5.1.0",
|
|
47
|
+
"@girs/pango-1.0": "^5.1.0",
|
|
48
|
+
"@girs/harfbuzz-0.0": "^5.1.0",
|
|
49
|
+
"@girs/freetype2-2.0": "^5.1.0",
|
|
50
|
+
"@girs/gio-2.0": "^5.1.0",
|
|
51
|
+
"@girs/gmodule-2.0": "^5.1.0",
|
|
52
|
+
"@girs/gdkpixbuf-2.0": "^5.1.0",
|
|
53
|
+
"@girs/atk-1.0": "^5.1.0" },
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"typescript": "*"
|
|
56
56
|
},
|