@gjsify/adwaita-core 0.31.0 → 0.33.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.
Files changed (124) hide show
  1. package/lib/esm/about-dialog.js +3 -0
  2. package/lib/esm/action-row.js +1 -0
  3. package/lib/esm/avatar.js +1 -0
  4. package/lib/esm/banner.js +1 -0
  5. package/lib/esm/button-content.js +1 -0
  6. package/lib/esm/carousel.js +1 -0
  7. package/lib/esm/checks.js +1 -0
  8. package/lib/esm/chrome.js +1 -0
  9. package/lib/esm/conformance/about-dialog.js +6 -0
  10. package/lib/esm/conformance/action-row.js +1 -0
  11. package/lib/esm/conformance/avatar.js +1 -0
  12. package/lib/esm/conformance/banner.js +1 -0
  13. package/lib/esm/conformance/button-content.js +1 -0
  14. package/lib/esm/conformance/carousel.js +1 -0
  15. package/lib/esm/conformance/checks.js +1 -0
  16. package/lib/esm/conformance/chrome.js +1 -0
  17. package/lib/esm/conformance/data-grid.js +1 -0
  18. package/lib/esm/conformance/dialog.js +1 -0
  19. package/lib/esm/conformance/entry-row.js +1 -0
  20. package/lib/esm/conformance/index.js +1 -0
  21. package/lib/esm/conformance/navigation-view.js +1 -0
  22. package/lib/esm/conformance/popover.js +1 -0
  23. package/lib/esm/conformance/preferences.js +1 -0
  24. package/lib/esm/conformance/rows.js +1 -0
  25. package/lib/esm/conformance/sidebar.js +1 -0
  26. package/lib/esm/conformance/spinner.js +1 -0
  27. package/lib/esm/conformance/split-button.js +1 -0
  28. package/lib/esm/conformance/split-view.js +1 -0
  29. package/lib/esm/conformance/tab-view.js +1 -0
  30. package/lib/esm/conformance/view-stack.js +1 -0
  31. package/lib/esm/conformance/view-switcher.js +1 -0
  32. package/lib/esm/conformance/wrap-box.js +1 -0
  33. package/lib/esm/data-grid.js +1 -0
  34. package/lib/esm/dialog.js +1 -1
  35. package/lib/esm/easing.js +1 -0
  36. package/lib/esm/entry-row.js +1 -0
  37. package/lib/esm/glib.js +1 -0
  38. package/lib/esm/index.js +1 -1
  39. package/lib/esm/length-unit.js +1 -0
  40. package/lib/esm/navigation-view.js +1 -0
  41. package/lib/esm/popover.js +1 -0
  42. package/lib/esm/preferences.js +1 -0
  43. package/lib/esm/rows.js +1 -1
  44. package/lib/esm/sidebar.js +1 -0
  45. package/lib/esm/spinner.js +1 -0
  46. package/lib/esm/split-button.js +1 -0
  47. package/lib/esm/split-view.js +1 -0
  48. package/lib/esm/tab-view.js +1 -0
  49. package/lib/esm/view-stack.js +1 -0
  50. package/lib/esm/view-switcher.js +1 -0
  51. package/lib/esm/wrap-box.js +1 -0
  52. package/lib/types/about-dialog.d.ts +391 -0
  53. package/lib/types/about-dialog.spec.d.ts +2 -0
  54. package/lib/types/action-row.d.ts +270 -0
  55. package/lib/types/action-row.spec.d.ts +2 -0
  56. package/lib/types/avatar.d.ts +112 -0
  57. package/lib/types/avatar.spec.d.ts +2 -0
  58. package/lib/types/banner.d.ts +104 -0
  59. package/lib/types/banner.spec.d.ts +2 -0
  60. package/lib/types/button-content.d.ts +141 -0
  61. package/lib/types/button-content.spec.d.ts +2 -0
  62. package/lib/types/carousel.d.ts +535 -0
  63. package/lib/types/carousel.spec.d.ts +2 -0
  64. package/lib/types/checks.d.ts +63 -0
  65. package/lib/types/checks.spec.d.ts +2 -0
  66. package/lib/types/chrome.d.ts +355 -0
  67. package/lib/types/chrome.spec.d.ts +2 -0
  68. package/lib/types/conformance/about-dialog.d.ts +314 -0
  69. package/lib/types/conformance/action-row.d.ts +186 -0
  70. package/lib/types/conformance/avatar.d.ts +61 -0
  71. package/lib/types/conformance/banner.d.ts +91 -0
  72. package/lib/types/conformance/button-content.d.ts +110 -0
  73. package/lib/types/conformance/carousel.d.ts +298 -0
  74. package/lib/types/conformance/checks.d.ts +29 -0
  75. package/lib/types/conformance/chrome.d.ts +207 -0
  76. package/lib/types/conformance/data-grid.d.ts +136 -0
  77. package/lib/types/conformance/dialog.d.ts +97 -0
  78. package/lib/types/conformance/entry-row.d.ts +187 -0
  79. package/lib/types/conformance/index.d.ts +46 -0
  80. package/lib/types/conformance/navigation-view.d.ts +235 -0
  81. package/lib/types/conformance/popover.d.ts +58 -0
  82. package/lib/types/conformance/preferences.d.ts +184 -0
  83. package/lib/types/conformance/rows.d.ts +74 -0
  84. package/lib/types/conformance/sidebar.d.ts +182 -0
  85. package/lib/types/conformance/spinner.d.ts +66 -0
  86. package/lib/types/conformance/split-button.d.ts +193 -0
  87. package/lib/types/conformance/split-view.d.ts +301 -0
  88. package/lib/types/conformance/tab-view.d.ts +449 -0
  89. package/lib/types/conformance/view-stack.d.ts +121 -0
  90. package/lib/types/conformance/view-switcher.d.ts +443 -0
  91. package/lib/types/conformance/wrap-box.d.ts +185 -0
  92. package/lib/types/data-grid.d.ts +140 -0
  93. package/lib/types/data-grid.spec.d.ts +2 -0
  94. package/lib/types/dialog.d.ts +144 -0
  95. package/lib/types/easing.d.ts +21 -0
  96. package/lib/types/entry-row.d.ts +308 -0
  97. package/lib/types/entry-row.spec.d.ts +2 -0
  98. package/lib/types/glib.d.ts +49 -0
  99. package/lib/types/index.d.ts +50 -4
  100. package/lib/types/length-unit.d.ts +24 -0
  101. package/lib/types/navigation-view.d.ts +343 -0
  102. package/lib/types/navigation-view.spec.d.ts +2 -0
  103. package/lib/types/popover.d.ts +155 -0
  104. package/lib/types/popover.spec.d.ts +2 -0
  105. package/lib/types/preferences.d.ts +349 -0
  106. package/lib/types/preferences.spec.d.ts +2 -0
  107. package/lib/types/rows.d.ts +96 -8
  108. package/lib/types/sidebar.d.ts +308 -0
  109. package/lib/types/sidebar.spec.d.ts +2 -0
  110. package/lib/types/spinner.d.ts +117 -0
  111. package/lib/types/spinner.spec.d.ts +2 -0
  112. package/lib/types/split-button.d.ts +316 -0
  113. package/lib/types/split-button.spec.d.ts +2 -0
  114. package/lib/types/split-view.d.ts +703 -0
  115. package/lib/types/split-view.spec.d.ts +2 -0
  116. package/lib/types/tab-view.d.ts +616 -0
  117. package/lib/types/tab-view.spec.d.ts +2 -0
  118. package/lib/types/view-stack.d.ts +278 -0
  119. package/lib/types/view-stack.spec.d.ts +2 -0
  120. package/lib/types/view-switcher.d.ts +524 -0
  121. package/lib/types/view-switcher.spec.d.ts +2 -0
  122. package/lib/types/wrap-box.d.ts +200 -0
  123. package/lib/types/wrap-box.spec.d.ts +2 -0
  124. package/package.json +8 -4
@@ -0,0 +1,443 @@
1
+ import type { AdwInlineViewSwitcherDisplayMode, AdwViewSwitcherPolicy, ViewSwitcherScheduler } from '../view-switcher.js';
2
+ /**
3
+ * A page as a vector declares it — the input half of `AdwViewSwitcherPageInit`.
4
+ *
5
+ * `title`/`iconName` omitted OR `null` both mean "the page has none", which is
6
+ * also what `getAttribute` returns for a missing attribute, so a DOM driver maps
7
+ * both to "do not set the attribute".
8
+ */
9
+ export interface ViewSwitcherVectorPage {
10
+ /** The page name. */
11
+ name: string;
12
+ /** `AdwViewStackPage:title`; absent means NULL. */
13
+ title?: string | null;
14
+ /** `AdwViewStackPage:icon-name`; absent means NULL. */
15
+ iconName?: string | null;
16
+ /** `AdwViewStackPage:visible`; absent means `true`. */
17
+ visible?: boolean;
18
+ /** `AdwViewStackPage:use-underline`; absent means `false`. */
19
+ useUnderline?: boolean;
20
+ /** `AdwViewStackPage:badge-number`; absent means `0`. */
21
+ badgeNumber?: number;
22
+ /** `AdwViewStackPage:needs-attention`; absent means `false`. */
23
+ needsAttention?: boolean;
24
+ }
25
+ /** One `stripMnemonic` expectation. */
26
+ export interface MnemonicVector {
27
+ /** The raw title. */
28
+ label: string;
29
+ /** What `adw_strip_mnemonic` produces. */
30
+ stripped: string;
31
+ /** What this row pins down. */
32
+ rule: string;
33
+ }
34
+ /**
35
+ * `adw_strip_mnemonic` (adw-widget-utils.c:685-703) — `g_markup_escape_text`
36
+ * then `pango_parse_markup` with `'_'` as the accel marker.
37
+ *
38
+ * The escape/parse round trip is entity-NEUTRAL, which is what the `R&D` row
39
+ * pins: a port that only escaped, or only unescaped, would drift on every
40
+ * ampersand.
41
+ */
42
+ export declare const VIEW_SWITCHER_MNEMONIC_VECTORS: ReadonlyArray<MnemonicVector>;
43
+ /** One `viewSwitcherIconName` expectation. */
44
+ export interface ViewSwitcherIconVector {
45
+ /** `AdwViewStackPage:icon-name` as the page carries it. */
46
+ iconName: string | null | undefined;
47
+ /** The icon the switcher actually renders. */
48
+ resolved: string;
49
+ /** What this row pins down. */
50
+ rule: string;
51
+ }
52
+ /**
53
+ * The `image-missing` substitution (adw-view-switcher-button.c:399-405,
54
+ * adw-inline-view-switcher.c:137-142). Both ports rendered NO icon instead,
55
+ * which is why an icons-mode toggle for a page without an icon was a blank box.
56
+ *
57
+ * Note there is no `-symbolic` stripping here: C passes the name to `GtkImage`
58
+ * unchanged. Turning a name into a CSS class or an SVG document is the
59
+ * renderer's job.
60
+ */
61
+ export declare const VIEW_SWITCHER_ICON_VECTORS: ReadonlyArray<ViewSwitcherIconVector>;
62
+ /** One `isViewSwitcherButtonVisible` expectation. */
63
+ export interface ViewSwitcherButtonVisibilityVector {
64
+ /** `AdwViewStackPage:visible`. */
65
+ visible: boolean;
66
+ /** `AdwViewStackPage:title`. */
67
+ title: string | null;
68
+ /** `AdwViewStackPage:icon-name`. */
69
+ iconName: string | null;
70
+ /** Whether `AdwViewSwitcher` shows the button. */
71
+ buttonVisible: boolean;
72
+ /** What this row pins down. */
73
+ rule: string;
74
+ }
75
+ /**
76
+ * `update_button`'s `gtk_widget_set_visible (button, visible && (title != NULL ||
77
+ * icon_name != NULL))` (adw-view-switcher.c:178).
78
+ *
79
+ * Implemented in NEITHER port: the browser one hid the label and icon spans but
80
+ * always appended a visible `<button>`, the NativeScript one always added the
81
+ * button `StackLayout` with an empty `Label`. Both therefore rendered an empty,
82
+ * clickable, space-consuming tab for a page with no title and no icon.
83
+ */
84
+ export declare const VIEW_SWITCHER_BUTTON_VISIBILITY_VECTORS: ReadonlyArray<ViewSwitcherButtonVisibilityVector>;
85
+ /** One badge-label + indicator-description expectation. */
86
+ export interface ViewSwitcherBadgeVector {
87
+ /** `AdwViewStackPage:badge-number`. */
88
+ badgeNumber: number;
89
+ /** `AdwViewStackPage:needs-attention`. */
90
+ needsAttention: boolean;
91
+ /** `get_badge_label`'s text. */
92
+ badgeLabel: string;
93
+ /** `update_description`'s text. */
94
+ description: string;
95
+ /** What this row pins down. */
96
+ rule: string;
97
+ }
98
+ /**
99
+ * `get_badge_label` (adw-indicator-bin.c:58-68) and `update_description`
100
+ * (:70-113), which both ports omit entirely — neither renders a badge, a
101
+ * needs-attention dot, or an accessible description.
102
+ *
103
+ * The composition ORDER is the subtle part: when both clauses apply the format
104
+ * is `"%s %s", badge_description, needs_attention_description` (:96), so the
105
+ * BADGE comes first.
106
+ */
107
+ export declare const VIEW_SWITCHER_BADGE_VECTORS: ReadonlyArray<ViewSwitcherBadgeVector>;
108
+ /** One `shouldRevealViewSwitcherBar` expectation. */
109
+ export interface ViewSwitcherBarRevealVector {
110
+ /** `AdwViewSwitcherBar:reveal` — what the layout asked for. */
111
+ reveal: boolean;
112
+ /** The bound stack's pages, reduced to their `visible` flag. */
113
+ pages: readonly {
114
+ readonly visible: boolean;
115
+ }[];
116
+ /** Whether the action bar is actually revealed. */
117
+ revealed: boolean;
118
+ /** What this row pins down. */
119
+ rule: string;
120
+ }
121
+ /**
122
+ * `update_bar_revealed` (adw-view-switcher-bar.c:104-126) — absent from BOTH
123
+ * ports, which each reduced `revealed` to their own boolean flag and never
124
+ * consulted the page count. A bar bound to a one-page stack therefore showed an
125
+ * empty strip libadwaita keeps collapsed.
126
+ */
127
+ export declare const VIEW_SWITCHER_BAR_REVEAL_VECTORS: ReadonlyArray<ViewSwitcherBarRevealVector>;
128
+ /** One step of a {@link ViewSwitcherBarVector} script. */
129
+ export type ViewSwitcherBarStep = {
130
+ readonly kind: 'reveal';
131
+ readonly value: boolean;
132
+ } | {
133
+ readonly kind: 'pages';
134
+ readonly pages: readonly {
135
+ readonly visible: boolean;
136
+ }[];
137
+ };
138
+ /** The `{ reveal, revealed }` pair a bar exposes. */
139
+ export interface ViewSwitcherBarSnapshot {
140
+ /** The request. */
141
+ reveal: boolean;
142
+ /** The derived truth. */
143
+ revealed: boolean;
144
+ }
145
+ /** One end-to-end switcher-bar expectation. */
146
+ export interface ViewSwitcherBarVector {
147
+ /** What this row pins down. */
148
+ rule: string;
149
+ /** The C function + lines it is derived from. */
150
+ derivedFrom: string;
151
+ /** The script, applied in order to a fresh bar. */
152
+ steps: readonly ViewSwitcherBarStep[];
153
+ /**
154
+ * Return value of each step. A `reveal` step returns whether `reveal` ITSELF
155
+ * changed (C returns early before its notify otherwise); a `pages` step
156
+ * returns whether `revealed` flipped.
157
+ */
158
+ stepResults: readonly boolean[];
159
+ /** The state after each step, in order. */
160
+ states: readonly ViewSwitcherBarSnapshot[];
161
+ /** The changes emitted, in order — only a flip of `revealed` notifies. */
162
+ changes: readonly ViewSwitcherBarSnapshot[];
163
+ }
164
+ /**
165
+ * `AdwViewSwitcherBar`'s reveal machine end to end. `update_bar_revealed` is
166
+ * re-run from `set_reveal`, from `set_stack` and from the pages' `items-changed`
167
+ * (adw-view-switcher-bar.c:340-343, :383, :277), which is why the page set alone
168
+ * can flip the bar while `reveal` never moves.
169
+ */
170
+ export declare const VIEW_SWITCHER_BAR_VECTORS: ReadonlyArray<ViewSwitcherBarVector>;
171
+ /** One `inlineToggleTooltip` expectation. */
172
+ export interface InlineTooltipVector {
173
+ /** `AdwViewStackPage:title`. */
174
+ title: string | null;
175
+ /** `AdwViewStackPage:use-underline`. */
176
+ useUnderline: boolean;
177
+ /** The current display mode. */
178
+ displayMode: AdwInlineViewSwitcherDisplayMode;
179
+ /** The tooltip text, as PLAIN text. */
180
+ tooltip: string;
181
+ /** What this row pins down. */
182
+ rule: string;
183
+ }
184
+ /**
185
+ * `update_tooltip` (adw-inline-view-switcher.c:163-192). The browser port gated
186
+ * on the mode correctly but used the RAW attribute, so `title="_Files"` produced
187
+ * the tooltip `_Files`; the NativeScript port has no tooltip at all.
188
+ */
189
+ export declare const INLINE_TOOLTIP_VECTORS: ReadonlyArray<InlineTooltipVector>;
190
+ /** The derived per-button model a vector expects. */
191
+ export interface ExpectedViewSwitcherButton {
192
+ /** Position in the page list. */
193
+ pageIndex: number;
194
+ /** The page name. */
195
+ name: string;
196
+ /** The text painted on the button. */
197
+ label: string;
198
+ /** The icon name painted on the button, never empty. */
199
+ iconName: string;
200
+ /** Whether the button is shown at all. */
201
+ visible: boolean;
202
+ /** Whether it is the selected one. */
203
+ selected: boolean;
204
+ /** Icon/label arrangement, from the policy. */
205
+ orientation: 'horizontal' | 'vertical';
206
+ /** Badge text, `''` for none. */
207
+ badgeLabel: string;
208
+ /** Whether the needs-attention dot is painted. */
209
+ needsAttention: boolean;
210
+ /** Screen-reader description, `''` for none. */
211
+ description: string;
212
+ }
213
+ /** One `buildViewSwitcherButtons` expectation. */
214
+ export interface ViewSwitcherButtonVector {
215
+ /** What this row pins down. */
216
+ rule: string;
217
+ /** The C function + lines it is derived from. */
218
+ derivedFrom: string;
219
+ /** The pages, in order. */
220
+ pages: readonly ViewSwitcherVectorPage[];
221
+ /** The selected PAGE index, `-1` for none. */
222
+ selected: number;
223
+ /** `AdwViewSwitcher:policy`. */
224
+ policy: AdwViewSwitcherPolicy;
225
+ /** One model per page — the index space is preserved, hidden buttons included. */
226
+ buttons: readonly ExpectedViewSwitcherButton[];
227
+ }
228
+ /**
229
+ * `AdwViewSwitcher`'s per-button derivation: `populate_switcher` adds a button
230
+ * for EVERY page (adw-view-switcher.c:230-238) and `update_button` decides what
231
+ * it shows and whether it is visible (:149-182).
232
+ */
233
+ export declare const VIEW_SWITCHER_BUTTON_VECTORS: ReadonlyArray<ViewSwitcherButtonVector>;
234
+ /** The derived per-toggle model a vector expects. */
235
+ export interface ExpectedInlineToggle {
236
+ /** Position among the toggles — compacted. */
237
+ toggleIndex: number;
238
+ /** Position in the page list — libadwaita's `child-index`. */
239
+ pageIndex: number;
240
+ /** The page name. */
241
+ name: string;
242
+ /** The text painted on the toggle. */
243
+ label: string;
244
+ /** The icon name painted on the toggle, never empty. */
245
+ iconName: string;
246
+ /** Whether this display mode builds an icon. */
247
+ showIcon: boolean;
248
+ /** Whether this display mode builds a label. */
249
+ showLabel: boolean;
250
+ /** Tooltip text, `''` outside icons mode. */
251
+ tooltip: string;
252
+ /** Badge text, `''` for none. */
253
+ badgeLabel: string;
254
+ /** Whether the needs-attention dot is painted. */
255
+ needsAttention: boolean;
256
+ /** Screen-reader description, `''` for none. */
257
+ description: string;
258
+ }
259
+ /** One `buildInlineToggles` + index-mapping expectation. */
260
+ export interface InlineToggleVector {
261
+ /** What this row pins down. */
262
+ rule: string;
263
+ /** The C function + lines it is derived from. */
264
+ derivedFrom: string;
265
+ /** The pages, in order. */
266
+ pages: readonly ViewSwitcherVectorPage[];
267
+ /** `AdwInlineViewSwitcher:display-mode`. */
268
+ displayMode: AdwInlineViewSwitcherDisplayMode;
269
+ /** One model per VISIBLE page. */
270
+ toggles: readonly ExpectedInlineToggle[];
271
+ /** `toggleIndexForPage` for every page index, in order — `-1` for a hidden page. */
272
+ toggleIndexByPage: readonly number[];
273
+ /** `pageIndexForToggle` for every toggle index, in order. */
274
+ pageIndexByToggle: readonly number[];
275
+ }
276
+ /**
277
+ * The inline switcher's TWO index spaces, plus what each display mode builds.
278
+ *
279
+ * `populate_group` calls `add_toggle` only for visible pages and passes the PAGE
280
+ * index `i`, which `add_toggle` stashes as `child-index`
281
+ * (adw-inline-view-switcher.c:370-378, :346); `notify_active_cb` reads it back
282
+ * (:114-129) and `selection_changed_cb` walks the other way (:434-453). Neither
283
+ * port filtered hidden pages, so the mapping looked like the identity and the
284
+ * `-1` sentinel had no spelling.
285
+ */
286
+ export declare const INLINE_TOGGLE_VECTORS: ReadonlyArray<InlineToggleVector>;
287
+ /** One change notification, in the order it is emitted. */
288
+ export interface ViewSwitcherVectorChange {
289
+ /** Index of the newly-selected page, `-1` for none. */
290
+ selected: number;
291
+ /** Its name, `''` for none. */
292
+ name: string;
293
+ /** Its painted label, `''` for none. */
294
+ title: string;
295
+ /** `true` for a user activation or an explicit select; `false` for an auto-pick. */
296
+ interactive: boolean;
297
+ }
298
+ /** One operation a selection vector applies after its pages exist. */
299
+ export type ViewSwitcherVectorOp = {
300
+ readonly kind: 'selectIndex';
301
+ readonly index: number;
302
+ } | {
303
+ readonly kind: 'selectName';
304
+ readonly name: string | null | undefined;
305
+ } | {
306
+ readonly kind: 'setPageVisible';
307
+ readonly name: string;
308
+ readonly visible: boolean;
309
+ };
310
+ /** One end-to-end switcher-selection expectation. */
311
+ export interface ViewSwitcherSelectionVector {
312
+ /** What this row pins down. */
313
+ rule: string;
314
+ /** The C function + lines it is derived from. */
315
+ derivedFrom: string;
316
+ /** The pages, set in this order. */
317
+ pages: readonly ViewSwitcherVectorPage[];
318
+ /** Changes emitted WHILE the pages are set (the auto-pick), in order. */
319
+ setupChanges: readonly ViewSwitcherVectorChange[];
320
+ /** Operations applied after the pages exist. */
321
+ ops: readonly ViewSwitcherVectorOp[];
322
+ /**
323
+ * Return value of each op, in order. Asserted by the core and NativeScript
324
+ * suites; the browser suite drives property setters, which return nothing,
325
+ * and asserts `changes` plus the final state instead.
326
+ */
327
+ opResults: readonly boolean[];
328
+ /** Changes emitted BY the ops, in order. */
329
+ changes: readonly ViewSwitcherVectorChange[];
330
+ /** Final selected page index, `-1` for none. */
331
+ selected: number;
332
+ /** Final selected page name, `''` for none. */
333
+ selectedName: string;
334
+ /** Final selected page label, `''` for none. */
335
+ selectedTitle: string;
336
+ /** Expected diagnostics (C's `g_warning` texts), when the row exercises them. */
337
+ diagnostics?: readonly string[];
338
+ }
339
+ /**
340
+ * The selection machine a switcher drives, which is the bound stack's — the
341
+ * switcher owns no selection property of its own (adw-view-switcher.c:126-147
342
+ * goes straight to `gtk_selection_model_select_item`).
343
+ *
344
+ * The refusal rows are the ones both ports failed differently: the browser
345
+ * switcher CLAMPED an out-of-range or negative index into range (so `active="-1"`
346
+ * jumped to the first page and `active="99"` to the last), and both stacks
347
+ * accepted a fractional index and then matched no page at all.
348
+ */
349
+ export declare const VIEW_SWITCHER_SELECTION_VECTORS: ReadonlyArray<ViewSwitcherSelectionVector>;
350
+ /** One page-list rebuild expectation. */
351
+ export interface ViewSwitcherRebuildVector {
352
+ /** What this row pins down. */
353
+ rule: string;
354
+ /** The C function + lines it is derived from. */
355
+ derivedFrom: string;
356
+ /** The initial pages. */
357
+ pages: readonly ViewSwitcherVectorPage[];
358
+ /** A page name to select before the rebuild; omitted keeps the auto-pick. */
359
+ select?: string;
360
+ /** The replacement pages. */
361
+ nextPages: readonly ViewSwitcherVectorPage[];
362
+ /** Changes emitted BY the rebuild, in order. */
363
+ changes: readonly ViewSwitcherVectorChange[];
364
+ /** Selected page index after the rebuild. */
365
+ selected: number;
366
+ /** Selected page name after the rebuild. */
367
+ selectedName: string;
368
+ }
369
+ /**
370
+ * What happens to the selection when the page list is replaced wholesale — the
371
+ * shape both renderers actually use (`setViews` on NativeScript, a re-parse on
372
+ * the browser side).
373
+ *
374
+ * libadwaita's selection is a page POINTER compared by identity
375
+ * (`adw_view_stack_pages_is_selected`, adw-view-stack.c:660-672), so it follows
376
+ * the page across inserts instead of pinning an index; a rebuild that drops the
377
+ * selected page falls through to the first-visible auto-pick
378
+ * (adw-view-switcher.c:258-263).
379
+ */
380
+ export declare const VIEW_SWITCHER_REBUILD_VECTORS: ReadonlyArray<ViewSwitcherRebuildVector>;
381
+ /** One step of a {@link ViewSwitcherDragVector} script. */
382
+ export type ViewSwitcherDragStep = {
383
+ readonly kind: 'enter';
384
+ readonly index: number;
385
+ } | {
386
+ readonly kind: 'leave';
387
+ readonly index: number;
388
+ } | {
389
+ readonly kind: 'advance';
390
+ readonly ms: number;
391
+ };
392
+ /** One drag-hover auto-switch expectation. */
393
+ export interface ViewSwitcherDragVector {
394
+ /** What this row pins down. */
395
+ rule: string;
396
+ /** The C function + lines it is derived from. */
397
+ derivedFrom: string;
398
+ /** The pages. */
399
+ pages: readonly ViewSwitcherVectorPage[];
400
+ /** The page index selected before the drag starts. */
401
+ initial: number;
402
+ /** The drag script. */
403
+ steps: readonly ViewSwitcherDragStep[];
404
+ /** Changes emitted by the script, in order. */
405
+ changes: readonly ViewSwitcherVectorChange[];
406
+ /** Selected page index once the script has run. */
407
+ selected: number;
408
+ }
409
+ /**
410
+ * `TIMEOUT_EXPAND` — the 500 ms dwell that switches pages mid-drag. Defined
411
+ * identically in both C files (adw-view-switcher-button.c:14, :58-96;
412
+ * adw-inline-view-switcher.c:80, :194-236) and present in NEITHER port, which
413
+ * only ever listened for `click`/`tap`.
414
+ *
415
+ * `interactive: true` on the resulting change: the C timeout activates the
416
+ * toggle, which runs the very same `on_button_toggled` a click does.
417
+ */
418
+ export declare const VIEW_SWITCHER_DRAG_VECTORS: ReadonlyArray<ViewSwitcherDragVector>;
419
+ /** A deterministic stand-in for a platform timer, driven by {@link advance}. */
420
+ export interface ViewSwitcherClock extends ViewSwitcherScheduler {
421
+ /** Move the clock forward, firing every dwell whose deadline has passed. */
422
+ advance(ms: number): void;
423
+ /** How many dwells are still pending. */
424
+ readonly pending: number;
425
+ }
426
+ /**
427
+ * A fake clock for the drag vectors.
428
+ *
429
+ * Note WHAT it is: a clock, not a stand-in for any behaviour under test. It
430
+ * schedules and cancels callbacks and nothing else, so it cannot transcribe the
431
+ * logic it is used to exercise.
432
+ *
433
+ * WHO DRIVES THOSE VECTORS: the core suite, and only it. This said "the core,
434
+ * browser and NativeScript suites all" — a claim of coverage that was never
435
+ * true, which is worse than silence, because it reads as a reason to stop
436
+ * looking. The browser elements construct
437
+ * `new ViewSwitcherState({ scheduler: domViewSwitcherScheduler })` inline
438
+ * (`elements/adw-view-switcher.ts`, `elements/adw-inline-view-switcher.ts`), so
439
+ * there is no seam to hand this clock through, and the NativeScript port has no
440
+ * drag surface at all. Wiring the browser side means giving the elements a
441
+ * scheduler seam first.
442
+ */
443
+ export declare function createViewSwitcherClock(): ViewSwitcherClock;
@@ -0,0 +1,185 @@
1
+ import type { AdwWrapBoxJustify, AdwWrapPolicy, WrapBoxLineLayout } from '../wrap-box.js';
2
+ /** One row of the decision table. */
3
+ export interface WrapBoxLineVector {
4
+ /** The widget's `justify` property. */
5
+ justify: AdwWrapBoxJustify;
6
+ /** The widget's `justify-last-line` property. */
7
+ justifyLastLine: boolean;
8
+ /** The widget's `align` property, already validated into `[0, 1]`. */
9
+ align: number;
10
+ /**
11
+ * Whether this is the FINAL line — `i == *n_lines - 1`
12
+ * (adw-wrap-layout.c:463-464). Note it is the final line, NOT merely an
13
+ * incomplete one: a wrap box whose children all fit on one line has that
14
+ * line as its last, so by default `justify` does nothing to it at all.
15
+ */
16
+ lastLine: boolean;
17
+ /**
18
+ * How many children the line holds. Only `spread` reads it, and only to
19
+ * distinguish 1 from more (adw-wrap-layout.c:338).
20
+ */
21
+ childrenInLine: number;
22
+ /** What the renderer must do. */
23
+ layout: WrapBoxLineLayout;
24
+ /** The rule or edge case this row pins down. */
25
+ rule: string;
26
+ }
27
+ /**
28
+ * The line-layout decision, row by row (adw-wrap-layout.c:317-341, :397-400,
29
+ * :705-706, :717-725).
30
+ *
31
+ * Two rows are counter-intuitive and are the reason the table exists rather than
32
+ * a sentence in a comment. First, `lastLine` is the FINAL line whether or not it
33
+ * is full, so the single-line case — the common one — is governed by
34
+ * `justify-last-line`, not by `justify`. Second, `spread` with exactly ONE child
35
+ * in the line does not spread anything: `n_children > 1` guards the branch that
36
+ * keeps children at `minimum_size`, so a lone child is STRETCHED instead, which
37
+ * the property documentation states outright (adw-wrap-box.c:349-352).
38
+ */
39
+ export declare const WRAP_BOX_LINE_VECTORS: ReadonlyArray<WrapBoxLineVector>;
40
+ /** One `child-spacing` / `line-spacing` normalisation expectation. */
41
+ export interface WrapBoxSpacingVector {
42
+ /**
43
+ * The value handed to the setter. A string is what an HTML attribute or an
44
+ * XML layout carries; a number is what a JS property setter gets. C only
45
+ * ever sees an `int`, so the string rows are the PORTS' own edge — they
46
+ * exist because the browser port propagated `NaN` into the style where the
47
+ * NativeScript port coerced it to 0.
48
+ */
49
+ value: number | string | null;
50
+ /** The value the widget stores and lays out with. */
51
+ spacing: number;
52
+ /** The rule this row pins down. */
53
+ rule: string;
54
+ }
55
+ /**
56
+ * `adw_wrap_box_set_child_spacing` / `set_line_spacing`
57
+ * (adw-wrap-box.c:587-588, :927-928) — a negative spacing is clamped to 0
58
+ * BEFORE anything else happens, so it never reaches the layout.
59
+ *
60
+ * The property is declared with a minimum of 0 (adw-wrap-box.c:285-287,
61
+ * :393-395), which is why the clamp exists at all: without it GObject would
62
+ * reject the value and warn.
63
+ */
64
+ export declare const WRAP_BOX_SPACING_VECTORS: ReadonlyArray<WrapBoxSpacingVector>;
65
+ /** One "does the setter report a change" expectation. */
66
+ export interface WrapBoxSpacingNotifyVector {
67
+ /** The spacing the widget already holds. */
68
+ from: number;
69
+ /** The value handed to the setter. */
70
+ value: number | string;
71
+ /** Whether the setter reaches `g_object_notify_by_pspec` at all. */
72
+ notifies: boolean;
73
+ /** The rule this row pins down. */
74
+ rule: string;
75
+ }
76
+ /**
77
+ * The early return in `adw_wrap_box_set_child_spacing`
78
+ * (adw-wrap-box.c:592-593, :930-931): the comparison happens AFTER the clamp,
79
+ * so setting `-5` on a box that already holds 0 changes nothing and notifies
80
+ * nobody. The browser port compared raw attribute strings and fired
81
+ * `notify::child-spacing` for a value libadwaita had normalised away.
82
+ */
83
+ export declare const WRAP_BOX_SPACING_NOTIFY_VECTORS: ReadonlyArray<WrapBoxSpacingNotifyVector>;
84
+ /**
85
+ * Every `notify::` an `Adw.WrapBox` emits — the thirteen installed pspecs
86
+ * (adw-wrap-box.c:284-495) plus the overridden `orientation` (:497).
87
+ *
88
+ * The count is the assertion. C notifies on all fourteen; the browser port
89
+ * notified on TWO (`child-spacing`, `line-spacing`) and the NativeScript port on
90
+ * none, so a consumer binding to any other property was watching a signal that
91
+ * could not fire. A roster is the only shape that fails when a property is ADDED
92
+ * without its notification, which is how the first twelve went missing.
93
+ */
94
+ export declare const WRAP_BOX_NOTIFY_PROPERTIES: readonly string[];
95
+ /** One `wrap-policy` → child-shrink expectation. */
96
+ export interface WrapBoxPolicyVector {
97
+ /** The authored value. Anything not in the enum leaves the property at its default. */
98
+ value: unknown;
99
+ /** The stored policy. */
100
+ policy: AdwWrapPolicy;
101
+ /** The `flex-shrink` a child gets — `FlexboxLayout.setFlexShrink` on NativeScript. */
102
+ flexShrink: number;
103
+ /** The rule this row pins down. */
104
+ rule: string;
105
+ }
106
+ /**
107
+ * `Adw.WrapBox:wrap-policy` (adw-wrap-box.c:476-495).
108
+ *
109
+ * The default is `natural`, which is the RESTRICTIVE one: a line wraps as soon
110
+ * as the next child would not fit at its natural size. `minimum` packs harder by
111
+ * squeezing children down to their minimum first. Both renderers had neither, so
112
+ * they inherited whatever their flex container defaults to — and CSS defaults
113
+ * `flex-shrink` to 1, i.e. to `minimum`, the value libadwaita does NOT default to.
114
+ */
115
+ export declare const WRAP_BOX_POLICY_VECTORS: ReadonlyArray<WrapBoxPolicyVector>;
116
+ /** One length-unit conversion expectation. */
117
+ export interface WrapBoxLengthVector {
118
+ /** The property value, in `unit`. */
119
+ value: number;
120
+ /** The authored unit. Anything outside the enum falls back to the `px` default. */
121
+ unit: unknown;
122
+ /** The `gtk-xft-dpi` the renderer reports. */
123
+ dpi: number;
124
+ /** The resolved pixel length. */
125
+ px: number;
126
+ /** The rule this row pins down. */
127
+ rule: string;
128
+ }
129
+ /**
130
+ * `adw_length_unit_to_px` as the three wrap-box length properties reach it
131
+ * (adw-wrap-layout.c:554-565, :798-804).
132
+ *
133
+ * The wrap box defaults its units to `px` where the split views default to `sp`
134
+ * (adw-wrap-box.c:300-305) — the same helper, two different defaults, which is
135
+ * why the fallback is the caller's argument and not the helper's.
136
+ */
137
+ export declare const WRAP_BOX_LENGTH_VECTORS: ReadonlyArray<WrapBoxLengthVector>;
138
+ /** One `natural-line-length` normalisation expectation. */
139
+ export interface WrapBoxNaturalLengthVector {
140
+ /** The authored value. */
141
+ value: unknown;
142
+ /** The stored length, `-1` when unset. */
143
+ length: number;
144
+ /** The rule this row pins down. */
145
+ rule: string;
146
+ }
147
+ /**
148
+ * `Adw.WrapBox:natural-line-length` — `g_param_spec_int (…, -1, G_MAXINT, -1, …)`
149
+ * (adw-wrap-box.c:438-441).
150
+ *
151
+ * `-1` means UNSET, not "zero length", so it is the landing place for everything
152
+ * out of range: a GObject setter would have refused those and left the property
153
+ * where it was, and unset is where it was born.
154
+ */
155
+ export declare const WRAP_BOX_NATURAL_LENGTH_VECTORS: ReadonlyArray<WrapBoxNaturalLengthVector>;
156
+ /** One `insert_child_after` / `reorder_child_after` expectation. */
157
+ export interface WrapBoxChildOrderVector {
158
+ /** Which operation is being resolved. */
159
+ op: 'insert-after' | 'reorder-after';
160
+ /** The box's children before the call. */
161
+ children: readonly string[];
162
+ /** The child being placed. */
163
+ child: string;
164
+ /** The sibling to place it after, or `null` for the FIRST position. */
165
+ sibling: string | null;
166
+ /** The children afterwards, or `null` when the call is refused. */
167
+ result: readonly string[] | null;
168
+ /** The rule this row pins down. */
169
+ rule: string;
170
+ }
171
+ /**
172
+ * `adw_wrap_box_insert_child_after` (adw-wrap-box.c:1283-1300) and
173
+ * `adw_wrap_box_reorder_child_after` (:1315-1332), both of which delegate to
174
+ * `gtk_widget_insert_after (child, self, sibling)`.
175
+ *
176
+ * The counter-intuitive rule is the NULL sibling: it inserts at the FIRST
177
+ * position, not the last. Reading it as "append" is the obvious misreading and a
178
+ * silent one — the child lands somewhere plausible. Neither renderer had any of
179
+ * this API, so there was nothing to misread yet, which is the good time to pin it.
180
+ *
181
+ * The refusals are the C's `g_return_if_fail`s: an insert wants the child
182
+ * unparented, a reorder wants it already a child, the sibling must belong to this
183
+ * box, and `child == sibling` is an explicit early return in both (:1297, :1329).
184
+ */
185
+ export declare const WRAP_BOX_CHILD_ORDER_VECTORS: ReadonlyArray<WrapBoxChildOrderVector>;