@girs/amtk-5 4.7.0 → 4.9.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/amtk-5-vocabulary.d.ts +76 -0
- package/amtk-5-vocabulary.js +82 -0
- package/package.json +15 -15
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
GJS TypeScript type definitions for Amtk-5 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.
|
|
7
|
+
GJS TypeScript type definitions for Amtk-5 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.9.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/amtk-5-vocabulary.d.ts
CHANGED
|
@@ -160,6 +160,82 @@ export const CHILD_HOLDERS: readonly string[];
|
|
|
160
160
|
/** Enum GType -> the nicks this surface offers. */
|
|
161
161
|
export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
|
|
162
162
|
|
|
163
|
+
/**
|
|
164
|
+
* `<enum GType>.<nick>` -> the integer GObject registers for it, from GIR's `value`.
|
|
165
|
+
*
|
|
166
|
+
* Position in `ENUM_NICKS` is NOT this number. Counting is wrong on 6 of the 129 enums a
|
|
167
|
+
* GTK 4 vocabulary carries -- 104 in Gtk-4.0 and 25 in Adw-1: `GtkResponseType` runs -1 to -11, `GtkTextWindowType` starts
|
|
168
|
+
* at 1, `GtkOrdering` and `GtkConstraintRelation` are -1/0/1, `GtkAlign` has two names
|
|
169
|
+
* on one value, and `GtkConstraintStrength.required` is 1001001000 where counting says 0.
|
|
170
|
+
*
|
|
171
|
+
* Read from the same GIR as the nicks, deliberately. A consumer reading the numbers off an
|
|
172
|
+
* installed typelib instead has two provenances for one table, and then cannot tell a
|
|
173
|
+
* missing number from a host older than the vocabulary.
|
|
174
|
+
*/
|
|
175
|
+
export const ENUM_VALUES: Readonly<Record<string, number>>;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The `<enum GType>.<nick>` entries GIR marks `deprecated="1"`.
|
|
179
|
+
*
|
|
180
|
+
* Two names on one value is how GObject spells an alias -- `GTK_ALIGN_BASELINE` and
|
|
181
|
+
* `GTK_ALIGN_BASELINE_FILL` are both 4, and both keep a `ENUM_VALUES` entry. The pairing
|
|
182
|
+
* is visible in the numbers; which name is the old one is not, and this is that fact --
|
|
183
|
+
* where GIR states it. It usually does not: 4 registered-enum members across the 718 GIRs
|
|
184
|
+
* carry the attribute, and 179 of the 182 value-sharing pairs carry it on neither half, so
|
|
185
|
+
* absence from this list means GIR is silent, not that the nick is the current one.
|
|
186
|
+
*/
|
|
187
|
+
export const ENUM_DEPRECATED: readonly string[];
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* `<enum GType>.<nick>` -> the raw GIR `value` no number could be read from.
|
|
191
|
+
*
|
|
192
|
+
* The declared remainder, so that every nick in `ENUM_NICKS` is in `ENUM_VALUES` or in
|
|
193
|
+
* here and a drop cannot be silent. Two shapes reach it: a symbolic or absent value (Vala
|
|
194
|
+
* writes `(null)`, a char enum writes a letter) and an integer past
|
|
195
|
+
* `Number.MAX_SAFE_INTEGER`, where a literal would lose precision and stop being the
|
|
196
|
+
* GIR's number. Empty for Gtk, Adw, GLib and Gio.
|
|
197
|
+
*/
|
|
198
|
+
export const ENUM_VALUES_UNREADABLE: Readonly<Record<string, string>>;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* `<bitfield GType>.<nick>` -> the integer GObject registers for that one member.
|
|
202
|
+
*
|
|
203
|
+
* `ENUM_NICKS` carries no bitfield, because GObject cannot resolve a nick SET; that says
|
|
204
|
+
* nothing about a single member's number, and the number is what a host without GI needs.
|
|
205
|
+
* 21 writable widget properties in Gtk-4.0 and Adw-1 are bitfield-typed and are declared
|
|
206
|
+
* bare `number` -- `GtkEntry:input-hints`, `GtkPopoverMenu:flags`, `AdwTabView:shortcuts`
|
|
207
|
+
* among them. Counting is worst here: 95 of 121 Gtk-4.0 bitfield members disagree with their
|
|
208
|
+
* position, against 29 of 685 enumeration members.
|
|
209
|
+
*
|
|
210
|
+
* Combine with `|` as GObject does. There is no nick table to pair this with, so a name
|
|
211
|
+
* here is resolvable and a SET still is not.
|
|
212
|
+
*/
|
|
213
|
+
export const FLAG_VALUES: Readonly<Record<string, number>>;
|
|
214
|
+
|
|
215
|
+
/** `<bitfield GType>.<nick>` -> the raw GIR `value` no number could be read from. */
|
|
216
|
+
export const FLAG_VALUES_UNREADABLE: Readonly<Record<string, string>>;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* `<declaration GType>.<property>` -> the GType of that property's enum or bitfield.
|
|
220
|
+
*
|
|
221
|
+
* The join the value tables need and nothing else here carries. A host with no GI has a
|
|
222
|
+
* property name and a nick and needs a number; `ENUM_VALUES` is keyed by ENUM GType, and
|
|
223
|
+
* only this says which enum a property is. Keyed by DECLARATION like `OWN_PROPS`, so it is
|
|
224
|
+
* read at every link of a `DECLS` chain — `orientation` belongs to `GtkOrientable`, not
|
|
225
|
+
* to the `GtkBox` a caller starts from.
|
|
226
|
+
*
|
|
227
|
+
* Present only where the property's OWN type is the enum: an array of them, or a union that
|
|
228
|
+
* merely mentions one, would be an entry a consumer resolves wrongly.
|
|
229
|
+
*
|
|
230
|
+
* The GType named here is not always one THIS module gives numbers for. A nick vocabulary is
|
|
231
|
+
* emitted once, by the namespace that owns the enum, so `AdwComboRow.search-match-mode` names
|
|
232
|
+
* `GtkStringFilterMatchMode` and its rows are in `@girs/gtk-4.0/vocabulary` — 57 of the 438
|
|
233
|
+
* entries in a full run resolve only with the owner's vocabulary loaded beside this one. An
|
|
234
|
+
* owner with no vocabulary of its own (Gdk, Pango) is inlined here instead, so every entry
|
|
235
|
+
* resolves against SOME module.
|
|
236
|
+
*/
|
|
237
|
+
export const PROP_ENUMS: Readonly<Record<string, string>>;
|
|
238
|
+
|
|
163
239
|
/** Widget GType -> slot name -> the method that may adopt a child there. */
|
|
164
240
|
export const SLOT_CANDIDATES: Readonly<Record<string, Readonly<Record<string, string>>>>;
|
|
165
241
|
|
package/amtk-5-vocabulary.js
CHANGED
|
@@ -34,6 +34,88 @@ export const CHILD_HOLDERS = [];
|
|
|
34
34
|
|
|
35
35
|
export const ENUM_NICKS = {};
|
|
36
36
|
|
|
37
|
+
// The number behind each of those nicks, read from GIR's own `value` attribute.
|
|
38
|
+
//
|
|
39
|
+
// It ships because position in `ENUM_NICKS` is not the value and a consumer with no
|
|
40
|
+
// typelib has no other way to learn it: a surface without GI still has to hand GObject an
|
|
41
|
+
// integer. The alternative a consumer reaches for first is counting, and counting is wrong
|
|
42
|
+
// on 6 of the 129 enums a GTK 4 vocabulary carries (104 in Gtk-4.0, 25 in Adw-1) --
|
|
43
|
+
// `GtkResponseType` runs -1 down to
|
|
44
|
+
// -11, `GtkTextWindowType` starts at 1, and `GtkConstraintStrength.required` is
|
|
45
|
+
// 1001001000 where counting answers 0.
|
|
46
|
+
//
|
|
47
|
+
// Same provenance as the nicks above, which is the point: a consumer that reads the numbers
|
|
48
|
+
// from an INSTALLED library instead gets two provenances for one table, and a member the
|
|
49
|
+
// vocabulary describes but the host predates then looks like a missing number rather than a
|
|
50
|
+
// version gap.
|
|
51
|
+
export const ENUM_VALUES = {};
|
|
52
|
+
|
|
53
|
+
// The nicks GIR marks `deprecated="1"`.
|
|
54
|
+
//
|
|
55
|
+
// Two members of one enum may share a value -- that is how GObject spells an alias, and
|
|
56
|
+
// `GTK_ALIGN_BASELINE` and `GTK_ALIGN_BASELINE_FILL` are both 4. `ENUM_VALUES` keeps
|
|
57
|
+
// both names, so nothing is lost, and this is what says which of the two a number should be
|
|
58
|
+
// spelled back as. Stated rather than derived: the pairing is visible in the values, the
|
|
59
|
+
// DIRECTION is not.
|
|
60
|
+
//
|
|
61
|
+
// Read it as evidence, not as a negative: 4 registered-enum members in the 718 GIRs carry
|
|
62
|
+
// the attribute at all, and 179 of the 182 value-sharing pairs carry it on neither half.
|
|
63
|
+
// A nick missing from here is a nick GIR says nothing about, not a nick GIR calls current.
|
|
64
|
+
export const ENUM_DEPRECATED = [];
|
|
65
|
+
|
|
66
|
+
// The declared remainder: nicks whose GIR `value` is not a number this can carry.
|
|
67
|
+
//
|
|
68
|
+
// Every nick in `ENUM_NICKS` is in `ENUM_VALUES` or here -- a nick in neither would be a
|
|
69
|
+
// silent drop. GIR carries two shapes no integer holds: a symbolic or absent value (Vala
|
|
70
|
+
// writes `(null)`, a char enum writes a letter) and an integer past
|
|
71
|
+
// `Number.MAX_SAFE_INTEGER`. The value kept here is the raw attribute, so the entry says
|
|
72
|
+
// WHAT was unreadable rather than only that something was. Measured over the 718 GIRs in
|
|
73
|
+
// ts-for-gir's `girs/`: 32 of 34096 registered-enum members, none in Gtk, Adw, GLib or Gio.
|
|
74
|
+
export const ENUM_VALUES_UNREADABLE = {};
|
|
75
|
+
|
|
76
|
+
// The number behind each member of a registered BITFIELD, keyed the same way.
|
|
77
|
+
//
|
|
78
|
+
// `ENUM_NICKS` refuses a bitfield because GObject cannot resolve a nick SET, and that
|
|
79
|
+
// reason says nothing about one member's number. 21 writable widget properties in Gtk-4.0
|
|
80
|
+
// and Adw-1 are bitfield-typed -- `GtkEntry:input-hints`, `GtkPopoverMenu:flags`,
|
|
81
|
+
// `AdwTabView:shortcuts`, ... -- and they are typed bare `number`, so a host without GI
|
|
82
|
+
// has nothing to compute one from. Counting is worst exactly here: 95 of 121 Gtk-4.0
|
|
83
|
+
// bitfield members disagree with their position, against 29 of 685 enumeration members.
|
|
84
|
+
//
|
|
85
|
+
// A table of its own rather than more rows in `ENUM_VALUES`, so that "every nick in
|
|
86
|
+
// `ENUM_NICKS` has a number or a declared reason" stays a claim about one set.
|
|
87
|
+
export const FLAG_VALUES = {
|
|
88
|
+
'AmtkFactoryFlags.flags-none': 0,
|
|
89
|
+
'AmtkFactoryFlags.ignore-accels': 16,
|
|
90
|
+
'AmtkFactoryFlags.ignore-accels-for-app': 64,
|
|
91
|
+
'AmtkFactoryFlags.ignore-accels-for-doc': 32,
|
|
92
|
+
'AmtkFactoryFlags.ignore-gaction': 1,
|
|
93
|
+
'AmtkFactoryFlags.ignore-icon': 2,
|
|
94
|
+
'AmtkFactoryFlags.ignore-label': 4,
|
|
95
|
+
'AmtkFactoryFlags.ignore-tooltip': 8,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// The same declared remainder for the bitfields. Every one of the 13 members in ts-for-gir's
|
|
99
|
+
// `girs/` whose value is past `Number.MAX_SAFE_INTEGER` is a bitfield member (Fwupd, Qmi),
|
|
100
|
+
// so this is the table that shape actually reaches.
|
|
101
|
+
export const FLAG_VALUES_UNREADABLE = {};
|
|
102
|
+
|
|
103
|
+
// Declaration GType + property name -> the GType of that property's enum or bitfield.
|
|
104
|
+
//
|
|
105
|
+
// Without it the value tables above are half an answer. A host with no GI knows it must set
|
|
106
|
+
// `orientation` to the number behind the nick `vertical`; `ENUM_VALUES` is keyed
|
|
107
|
+
// `GtkOrientation.vertical`, and nothing else says that `orientation` is a
|
|
108
|
+
// `GtkOrientation`. Deriving it is not available: `never` is a member of several Gtk enums,
|
|
109
|
+
// and choosing between them produces a wrong number rather than a missing one.
|
|
110
|
+
//
|
|
111
|
+
// Only where the property's OWN type is the enum. An array of them and a union that mentions
|
|
112
|
+
// one are both entries a consumer would resolve wrongly, so neither is written.
|
|
113
|
+
//
|
|
114
|
+
// A GType named here has numbers in SOME vocabulary, not necessarily this one: the namespace
|
|
115
|
+
// that OWNS an enum publishes it, so 57 of the 438 entries a full run emits want the owner's
|
|
116
|
+
// vocabulary loaded too. Owners that emit none (Gdk, Pango) are inlined into the tables above.
|
|
117
|
+
export const PROP_ENUMS = {};
|
|
118
|
+
|
|
37
119
|
export const SLOT_CANDIDATES = {};
|
|
38
120
|
|
|
39
121
|
export const SINCE = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@girs/amtk-5",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.0",
|
|
4
4
|
"description": "GJS TypeScript type definitions for Amtk-5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "amtk-5.js",
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
"test": "tsc --project tsconfig.json"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@girs/gjs": "^4.
|
|
40
|
-
"@girs/gtk-3.0": "^4.
|
|
41
|
-
"@girs/xlib-2.0": "^4.
|
|
42
|
-
"@girs/gdk-3.0": "^4.
|
|
43
|
-
"@girs/cairo-1.0": "^4.
|
|
44
|
-
"@girs/gobject-2.0": "^4.
|
|
45
|
-
"@girs/glib-2.0": "^4.
|
|
46
|
-
"@girs/pango-1.0": "^4.
|
|
47
|
-
"@girs/harfbuzz-0.0": "^4.
|
|
48
|
-
"@girs/freetype2-2.0": "^4.
|
|
49
|
-
"@girs/gio-2.0": "^4.
|
|
50
|
-
"@girs/gmodule-2.0": "^4.
|
|
51
|
-
"@girs/gdkpixbuf-2.0": "^4.
|
|
52
|
-
"@girs/atk-1.0": "^4.
|
|
39
|
+
"@girs/gjs": "^4.9.0",
|
|
40
|
+
"@girs/gtk-3.0": "^4.9.0",
|
|
41
|
+
"@girs/xlib-2.0": "^4.9.0",
|
|
42
|
+
"@girs/gdk-3.0": "^4.9.0",
|
|
43
|
+
"@girs/cairo-1.0": "^4.9.0",
|
|
44
|
+
"@girs/gobject-2.0": "^4.9.0",
|
|
45
|
+
"@girs/glib-2.0": "^4.9.0",
|
|
46
|
+
"@girs/pango-1.0": "^4.9.0",
|
|
47
|
+
"@girs/harfbuzz-0.0": "^4.9.0",
|
|
48
|
+
"@girs/freetype2-2.0": "^4.9.0",
|
|
49
|
+
"@girs/gio-2.0": "^4.9.0",
|
|
50
|
+
"@girs/gmodule-2.0": "^4.9.0",
|
|
51
|
+
"@girs/gdkpixbuf-2.0": "^4.9.0",
|
|
52
|
+
"@girs/atk-1.0": "^4.9.0" },
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"typescript": "*"
|
|
55
55
|
},
|