@girs/gtksource-5 4.6.0 → 4.8.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,7 +4,7 @@
4
4
  ![version](https://img.shields.io/npm/v/@girs/gtksource-5)
5
5
  ![downloads/week](https://img.shields.io/npm/dw/@girs/gtksource-5)
6
6
 
7
- GJS TypeScript type definitions for GtkSource-5, generated from library version 5.21.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.6.0.
7
+ GJS TypeScript type definitions for GtkSource-5, generated from library version 5.21.0 using [ts-for-gir](https://github.com/gjsify/ts-for-gir) v4.8.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.
@@ -419,6 +419,61 @@ export const CHILD_HOLDERS: readonly string[];
419
419
  /** Enum GType -> the nicks this surface offers. */
420
420
  export const ENUM_NICKS: Readonly<Record<string, readonly string[]>>;
421
421
 
422
+ /**
423
+ * `<enum GType>.<nick>` -> the integer GObject registers for it, from GIR's `value`.
424
+ *
425
+ * Position in `ENUM_NICKS` is NOT this number. Counting is wrong on 6 of the 129 enums a
426
+ * GTK 4 vocabulary carries -- 104 in Gtk-4.0 and 25 in Adw-1: `GtkResponseType` runs -1 to -11, `GtkTextWindowType` starts
427
+ * at 1, `GtkOrdering` and `GtkConstraintRelation` are -1/0/1, `GtkAlign` has two names
428
+ * on one value, and `GtkConstraintStrength.required` is 1001001000 where counting says 0.
429
+ *
430
+ * Read from the same GIR as the nicks, deliberately. A consumer reading the numbers off an
431
+ * installed typelib instead has two provenances for one table, and then cannot tell a
432
+ * missing number from a host older than the vocabulary.
433
+ */
434
+ export const ENUM_VALUES: Readonly<Record<string, number>>;
435
+
436
+ /**
437
+ * The `<enum GType>.<nick>` entries GIR marks `deprecated="1"`.
438
+ *
439
+ * Two names on one value is how GObject spells an alias -- `GTK_ALIGN_BASELINE` and
440
+ * `GTK_ALIGN_BASELINE_FILL` are both 4, and both keep a `ENUM_VALUES` entry. The pairing
441
+ * is visible in the numbers; which name is the old one is not, and this is that fact --
442
+ * where GIR states it. It usually does not: 4 registered-enum members across the 718 GIRs
443
+ * carry the attribute, and 179 of the 182 value-sharing pairs carry it on neither half, so
444
+ * absence from this list means GIR is silent, not that the nick is the current one.
445
+ */
446
+ export const ENUM_DEPRECATED: readonly string[];
447
+
448
+ /**
449
+ * `<enum GType>.<nick>` -> the raw GIR `value` no number could be read from.
450
+ *
451
+ * The declared remainder, so that every nick in `ENUM_NICKS` is in `ENUM_VALUES` or in
452
+ * here and a drop cannot be silent. Two shapes reach it: a symbolic or absent value (Vala
453
+ * writes `(null)`, a char enum writes a letter) and an integer past
454
+ * `Number.MAX_SAFE_INTEGER`, where a literal would lose precision and stop being the
455
+ * GIR's number. Empty for Gtk, Adw, GLib and Gio.
456
+ */
457
+ export const ENUM_VALUES_UNREADABLE: Readonly<Record<string, string>>;
458
+
459
+ /**
460
+ * `<bitfield GType>.<nick>` -> the integer GObject registers for that one member.
461
+ *
462
+ * `ENUM_NICKS` carries no bitfield, because GObject cannot resolve a nick SET; that says
463
+ * nothing about a single member's number, and the number is what a host without GI needs.
464
+ * 21 writable widget properties in Gtk-4.0 and Adw-1 are bitfield-typed and are declared
465
+ * bare `number` -- `GtkEntry:input-hints`, `GtkPopoverMenu:flags`, `AdwTabView:shortcuts`
466
+ * among them. Counting is worst here: 95 of 121 Gtk-4.0 bitfield members disagree with their
467
+ * position, against 29 of 685 enumeration members.
468
+ *
469
+ * Combine with `|` as GObject does. There is no nick table to pair this with, so a name
470
+ * here is resolvable and a SET still is not.
471
+ */
472
+ export const FLAG_VALUES: Readonly<Record<string, number>>;
473
+
474
+ /** `<bitfield GType>.<nick>` -> the raw GIR `value` no number could be read from. */
475
+ export const FLAG_VALUES_UNREADABLE: Readonly<Record<string, string>>;
476
+
422
477
  /** Widget GType -> slot name -> the method that may adopt a child there. */
423
478
  export const SLOT_CANDIDATES: Readonly<Record<string, Readonly<Record<string, string>>>>;
424
479
 
@@ -67,6 +67,122 @@ export const ENUM_NICKS = {
67
67
  GtkSourceViewGutterPosition: ['lines', 'marks'],
68
68
  };
69
69
 
70
+ // The number behind each of those nicks, read from GIR's own `value` attribute.
71
+ //
72
+ // It ships because position in `ENUM_NICKS` is not the value and a consumer with no
73
+ // typelib has no other way to learn it: a surface without GI still has to hand GObject an
74
+ // integer. The alternative a consumer reaches for first is counting, and counting is wrong
75
+ // on 6 of the 129 enums a GTK 4 vocabulary carries (104 in Gtk-4.0, 25 in Adw-1) --
76
+ // `GtkResponseType` runs -1 down to
77
+ // -11, `GtkTextWindowType` starts at 1, and `GtkConstraintStrength.required` is
78
+ // 1001001000 where counting answers 0.
79
+ //
80
+ // Same provenance as the nicks above, which is the point: a consumer that reads the numbers
81
+ // from an INSTALLED library instead gets two provenances for one table, and a member the
82
+ // vocabulary describes but the host predates then looks like a missing number rather than a
83
+ // version gap.
84
+ export const ENUM_VALUES = {
85
+ 'GtkSourceAnnotationStyle.accent': 3,
86
+ 'GtkSourceAnnotationStyle.error': 2,
87
+ 'GtkSourceAnnotationStyle.none': 0,
88
+ 'GtkSourceAnnotationStyle.warning': 1,
89
+ 'GtkSourceBackgroundPatternType.grid': 1,
90
+ 'GtkSourceBackgroundPatternType.none': 0,
91
+ 'GtkSourceBracketMatchType.found': 3,
92
+ 'GtkSourceBracketMatchType.none': 0,
93
+ 'GtkSourceBracketMatchType.not-found': 2,
94
+ 'GtkSourceBracketMatchType.out-of-range': 1,
95
+ 'GtkSourceChangeCaseType.lower': 0,
96
+ 'GtkSourceChangeCaseType.title': 3,
97
+ 'GtkSourceChangeCaseType.toggle': 2,
98
+ 'GtkSourceChangeCaseType.upper': 1,
99
+ 'GtkSourceCompletionActivation.interactive': 1,
100
+ 'GtkSourceCompletionActivation.none': 0,
101
+ 'GtkSourceCompletionActivation.user-requested': 2,
102
+ 'GtkSourceCompletionColumn.after': 3,
103
+ 'GtkSourceCompletionColumn.before': 1,
104
+ 'GtkSourceCompletionColumn.comment': 4,
105
+ 'GtkSourceCompletionColumn.details': 5,
106
+ 'GtkSourceCompletionColumn.icon': 0,
107
+ 'GtkSourceCompletionColumn.typed-text': 2,
108
+ 'GtkSourceCompressionType.gzip': 1,
109
+ 'GtkSourceCompressionType.none': 0,
110
+ 'GtkSourceGutterRendererAlignmentMode.cell': 0,
111
+ 'GtkSourceGutterRendererAlignmentMode.first': 1,
112
+ 'GtkSourceGutterRendererAlignmentMode.last': 2,
113
+ 'GtkSourceNewlineType.cr': 1,
114
+ 'GtkSourceNewlineType.cr-lf': 2,
115
+ 'GtkSourceNewlineType.lf': 0,
116
+ 'GtkSourceSmartHomeEndType.after': 2,
117
+ 'GtkSourceSmartHomeEndType.always': 3,
118
+ 'GtkSourceSmartHomeEndType.before': 1,
119
+ 'GtkSourceSmartHomeEndType.disabled': 0,
120
+ 'GtkSourceViewGutterPosition.lines': -30,
121
+ 'GtkSourceViewGutterPosition.marks': -20,
122
+ };
123
+
124
+ // The nicks GIR marks `deprecated="1"`.
125
+ //
126
+ // Two members of one enum may share a value -- that is how GObject spells an alias, and
127
+ // `GTK_ALIGN_BASELINE` and `GTK_ALIGN_BASELINE_FILL` are both 4. `ENUM_VALUES` keeps
128
+ // both names, so nothing is lost, and this is what says which of the two a number should be
129
+ // spelled back as. Stated rather than derived: the pairing is visible in the values, the
130
+ // DIRECTION is not.
131
+ //
132
+ // Read it as evidence, not as a negative: 4 registered-enum members in the 718 GIRs carry
133
+ // the attribute at all, and 179 of the 182 value-sharing pairs carry it on neither half.
134
+ // A nick missing from here is a nick GIR says nothing about, not a nick GIR calls current.
135
+ export const ENUM_DEPRECATED = [];
136
+
137
+ // The declared remainder: nicks whose GIR `value` is not a number this can carry.
138
+ //
139
+ // Every nick in `ENUM_NICKS` is in `ENUM_VALUES` or here -- a nick in neither would be a
140
+ // silent drop. GIR carries two shapes no integer holds: a symbolic or absent value (Vala
141
+ // writes `(null)`, a char enum writes a letter) and an integer past
142
+ // `Number.MAX_SAFE_INTEGER`. The value kept here is the raw attribute, so the entry says
143
+ // WHAT was unreadable rather than only that something was. Measured over the 718 GIRs in
144
+ // ts-for-gir's `girs/`: 32 of 34096 registered-enum members, none in Gtk, Adw, GLib or Gio.
145
+ export const ENUM_VALUES_UNREADABLE = {};
146
+
147
+ // The number behind each member of a registered BITFIELD, keyed the same way.
148
+ //
149
+ // `ENUM_NICKS` refuses a bitfield because GObject cannot resolve a nick SET, and that
150
+ // reason says nothing about one member's number. 21 writable widget properties in Gtk-4.0
151
+ // and Adw-1 are bitfield-typed -- `GtkEntry:input-hints`, `GtkPopoverMenu:flags`,
152
+ // `AdwTabView:shortcuts`, ... -- and they are typed bare `number`, so a host without GI
153
+ // has nothing to compute one from. Counting is worst exactly here: 95 of 121 Gtk-4.0
154
+ // bitfield members disagree with their position, against 29 of 685 enumeration members.
155
+ //
156
+ // A table of its own rather than more rows in `ENUM_VALUES`, so that "every nick in
157
+ // `ENUM_NICKS` has a number or a declared reason" stays a claim about one set.
158
+ export const FLAG_VALUES = {
159
+ 'GtkSourceFileSaverFlags.create-backup': 4,
160
+ 'GtkSourceFileSaverFlags.ignore-invalid-chars': 1,
161
+ 'GtkSourceFileSaverFlags.ignore-modification-time': 2,
162
+ 'GtkSourceFileSaverFlags.none': 0,
163
+ 'GtkSourceSortFlags.case-sensitive': 1,
164
+ 'GtkSourceSortFlags.filename': 8,
165
+ 'GtkSourceSortFlags.none': 0,
166
+ 'GtkSourceSortFlags.remove-duplicates': 4,
167
+ 'GtkSourceSortFlags.reverse-order': 2,
168
+ 'GtkSourceSpaceLocationFlags.all': 7,
169
+ 'GtkSourceSpaceLocationFlags.inside-text': 2,
170
+ 'GtkSourceSpaceLocationFlags.leading': 1,
171
+ 'GtkSourceSpaceLocationFlags.none': 0,
172
+ 'GtkSourceSpaceLocationFlags.trailing': 4,
173
+ 'GtkSourceSpaceTypeFlags.all': 15,
174
+ 'GtkSourceSpaceTypeFlags.nbsp': 8,
175
+ 'GtkSourceSpaceTypeFlags.newline': 4,
176
+ 'GtkSourceSpaceTypeFlags.none': 0,
177
+ 'GtkSourceSpaceTypeFlags.space': 1,
178
+ 'GtkSourceSpaceTypeFlags.tab': 2,
179
+ };
180
+
181
+ // The same declared remainder for the bitfields. Every one of the 13 members in ts-for-gir's
182
+ // `girs/` whose value is past `Number.MAX_SAFE_INTEGER` is a bitfield member (Fwupd, Qmi),
183
+ // so this is the table that shape actually reaches.
184
+ export const FLAG_VALUES_UNREADABLE = {};
185
+
70
186
  export const SLOT_CANDIDATES = {
71
187
  GtkSourceCompletionCell: {
72
188
  'widget': 'set_widget',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@girs/gtksource-5",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "libraryVersion": "5.21.0",
5
5
  "description": "GJS TypeScript type definitions for GtkSource-5, generated from library version 5.21.0",
6
6
  "type": "module",
@@ -37,21 +37,21 @@
37
37
  "test": "tsc --project tsconfig.json"
38
38
  },
39
39
  "dependencies": {
40
- "@girs/gjs": "^4.6.0",
41
- "@girs/gtk-4.0": "^4.6.0",
42
- "@girs/gsk-4.0": "^4.6.0",
43
- "@girs/graphene-1.0": "^4.6.0",
44
- "@girs/gobject-2.0": "^4.6.0",
45
- "@girs/glib-2.0": "^4.6.0",
46
- "@girs/gdk-4.0": "^4.6.0",
47
- "@girs/cairo-1.0": "^4.6.0",
48
- "@girs/pangocairo-1.0": "^4.6.0",
49
- "@girs/pango-1.0": "^4.6.0",
50
- "@girs/harfbuzz-0.0": "^4.6.0",
51
- "@girs/freetype2-2.0": "^4.6.0",
52
- "@girs/gio-2.0": "^4.6.0",
53
- "@girs/gmodule-2.0": "^4.6.0",
54
- "@girs/gdkpixbuf-2.0": "^4.6.0" },
40
+ "@girs/gjs": "^4.8.0",
41
+ "@girs/gtk-4.0": "^4.8.0",
42
+ "@girs/gsk-4.0": "^4.8.0",
43
+ "@girs/graphene-1.0": "^4.8.0",
44
+ "@girs/gobject-2.0": "^4.8.0",
45
+ "@girs/glib-2.0": "^4.8.0",
46
+ "@girs/gdk-4.0": "^4.8.0",
47
+ "@girs/cairo-1.0": "^4.8.0",
48
+ "@girs/pangocairo-1.0": "^4.8.0",
49
+ "@girs/pango-1.0": "^4.8.0",
50
+ "@girs/harfbuzz-0.0": "^4.8.0",
51
+ "@girs/freetype2-2.0": "^4.8.0",
52
+ "@girs/gio-2.0": "^4.8.0",
53
+ "@girs/gmodule-2.0": "^4.8.0",
54
+ "@girs/gdkpixbuf-2.0": "^4.8.0" },
55
55
  "devDependencies": {
56
56
  "typescript": "*"
57
57
  },