@gjsify/adwaita-core 0.36.0 → 0.37.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 (61) hide show
  1. package/lib/esm/conformance/index.js +1 -1
  2. package/lib/esm/conformance/shortcut-label.js +1 -0
  3. package/lib/esm/index.js +1 -1
  4. package/lib/esm/shortcut-label.js +1 -0
  5. package/lib/types/about-dialog.d.ts +92 -98
  6. package/lib/types/action-row.d.ts +95 -125
  7. package/lib/types/avatar.d.ts +30 -37
  8. package/lib/types/banner.d.ts +25 -53
  9. package/lib/types/breakpoint.d.ts +6 -7
  10. package/lib/types/button-content.d.ts +41 -80
  11. package/lib/types/carousel.d.ts +175 -252
  12. package/lib/types/checks.d.ts +13 -30
  13. package/lib/types/chrome.d.ts +90 -136
  14. package/lib/types/color-scheme.d.ts +5 -6
  15. package/lib/types/conformance/about-dialog.d.ts +64 -91
  16. package/lib/types/conformance/action-row.d.ts +26 -46
  17. package/lib/types/conformance/avatar.d.ts +8 -10
  18. package/lib/types/conformance/banner.d.ts +17 -37
  19. package/lib/types/conformance/button-content.d.ts +24 -46
  20. package/lib/types/conformance/carousel.d.ts +35 -75
  21. package/lib/types/conformance/checks.d.ts +0 -4
  22. package/lib/types/conformance/chrome.d.ts +28 -36
  23. package/lib/types/conformance/data-grid.d.ts +28 -47
  24. package/lib/types/conformance/dialog.d.ts +4 -9
  25. package/lib/types/conformance/entry-row.d.ts +20 -39
  26. package/lib/types/conformance/index.d.ts +2 -0
  27. package/lib/types/conformance/navigation-view.d.ts +0 -4
  28. package/lib/types/conformance/popover.d.ts +4 -9
  29. package/lib/types/conformance/preferences.d.ts +15 -28
  30. package/lib/types/conformance/rows.d.ts +5 -12
  31. package/lib/types/conformance/shortcut-label.d.ts +34 -0
  32. package/lib/types/conformance/sidebar.d.ts +28 -49
  33. package/lib/types/conformance/spinner.d.ts +21 -27
  34. package/lib/types/conformance/split-button.d.ts +21 -43
  35. package/lib/types/conformance/split-view.d.ts +29 -36
  36. package/lib/types/conformance/tab-view.d.ts +32 -73
  37. package/lib/types/conformance/view-stack.d.ts +0 -12
  38. package/lib/types/conformance/view-switcher.d.ts +46 -114
  39. package/lib/types/conformance/wrap-box.d.ts +40 -63
  40. package/lib/types/data-grid.d.ts +38 -48
  41. package/lib/types/dialog.d.ts +39 -51
  42. package/lib/types/easing.d.ts +6 -12
  43. package/lib/types/entry-row.d.ts +94 -123
  44. package/lib/types/glib.d.ts +17 -25
  45. package/lib/types/index.d.ts +2 -0
  46. package/lib/types/length-unit.d.ts +7 -12
  47. package/lib/types/navigation-view.d.ts +62 -68
  48. package/lib/types/popover.d.ts +39 -66
  49. package/lib/types/preferences.d.ts +83 -100
  50. package/lib/types/rows.d.ts +45 -63
  51. package/lib/types/shortcut-label.d.ts +79 -0
  52. package/lib/types/shortcut-label.spec.d.ts +2 -0
  53. package/lib/types/sidebar.d.ts +95 -121
  54. package/lib/types/spinner.d.ts +39 -61
  55. package/lib/types/split-button.d.ts +78 -134
  56. package/lib/types/split-view.d.ts +74 -89
  57. package/lib/types/tab-view.d.ts +174 -256
  58. package/lib/types/view-stack.d.ts +87 -129
  59. package/lib/types/view-switcher.d.ts +126 -211
  60. package/lib/types/wrap-box.d.ts +62 -123
  61. package/package.json +3 -3
@@ -1,24 +1,17 @@
1
1
  import { stripMnemonic } from './glib.js';
2
2
  import type { AdwViewStackPageInfo } from './view-stack.js';
3
3
  /**
4
- * The "nothing is selected" sentinel, standing in for
5
- * `GTK_INVALID_LIST_POSITION` (adw-inline-view-switcher.c:366, :441).
6
- *
7
- * Returned by {@link toggleIndexForPage} / {@link pageIndexForToggle} when the
8
- * two index spaces have no counterpart for each other — a hidden page has no
9
- * toggle at all, which is a state `ToggleGroupState`'s always-non-negative
10
- * `selected` cannot express.
4
+ * The "nothing is selected" sentinel, standing in for `GTK_INVALID_LIST_POSITION`.
5
+ * Returned by {@link toggleIndexForPage} / {@link pageIndexForToggle} when the two index
6
+ * spaces have no counterpart for each other — a hidden page has no toggle at all, a state
7
+ * `ToggleGroupState`'s always-non-negative `selected` cannot express.
11
8
  */
12
9
  export declare const VIEW_SWITCHER_NO_SELECTION = -1;
13
- /**
14
- * The icon substituted for a NULL or empty icon name
15
- * (adw-view-switcher-button.c:347, :399-405; adw-inline-view-switcher.c:131-145).
16
- */
10
+ /** The icon substituted for a NULL or empty icon name. */
17
11
  export declare const VIEW_SWITCHER_FALLBACK_ICON = "image-missing";
18
12
  /**
19
- * `TIMEOUT_EXPAND` — how long a drag has to dwell over a non-active button
20
- * before it switches to it (adw-view-switcher-button.c:14,
21
- * adw-inline-view-switcher.c:80). Defined identically in both C files.
13
+ * `TIMEOUT_EXPAND` — how long a drag must dwell over a non-active button before it
14
+ * switches to it. Defined identically in both C files.
22
15
  */
23
16
  export declare const VIEW_SWITCHER_DRAG_SWITCH_DELAY = 500;
24
17
  /** The largest badge `AdwIndicatorBin` prints; anything above collapses to `999+`. */
@@ -26,49 +19,41 @@ export declare const VIEW_SWITCHER_BADGE_LIMIT = 999;
26
19
  /** `AdwViewSwitcherPolicy` — which button layout the switcher forces. */
27
20
  export type AdwViewSwitcherPolicy = 'narrow' | 'wide';
28
21
  /**
29
- * Every policy, in enum order. Doubles as the style-class list: libadwaita adds
30
- * the current policy's class and removes the other (adw-view-switcher.c:539-545),
31
- * so a renderer toggles each entry against the current value rather than
32
- * hard-coding an add/remove pair.
22
+ * Every policy, in enum order. Doubles as the style-class list: libadwaita adds the
23
+ * current policy's class and removes the other, so a renderer toggles each entry against
24
+ * the current value rather than hard-coding an add/remove pair.
33
25
  */
34
26
  export declare const VIEW_SWITCHER_POLICIES: readonly AdwViewSwitcherPolicy[];
35
27
  /** `AdwInlineViewSwitcherDisplayMode` — what the inline switcher's toggles show. */
36
28
  export type AdwInlineViewSwitcherDisplayMode = 'labels' | 'icons' | 'both';
37
29
  /**
38
- * Every display mode, in enum order — and the toggle-group style classes
39
- * (adw-inline-view-switcher.c:826-850), same toggle-against-current pattern as
40
- * {@link VIEW_SWITCHER_POLICIES}.
30
+ * Every display mode, in enum order — and the toggle-group style classes, same
31
+ * toggle-against-current pattern as {@link VIEW_SWITCHER_POLICIES}.
41
32
  */
42
33
  export declare const INLINE_VIEW_SWITCHER_DISPLAY_MODES: readonly AdwInlineViewSwitcherDisplayMode[];
43
34
  /**
44
- * Whether `value` is a policy libadwaita would accept.
45
- *
46
- * The C setter is guarded by the enum's own type (`g_value_get_enum`), and the
47
- * browser port instead coerced anything unrecognised to a default — see
48
- * {@link isInlineViewSwitcherDisplayMode} for why that is not the same thing.
35
+ * Whether `value` is a policy libadwaita would accept. The C setter is guarded by the
36
+ * enum's own type (`g_value_get_enum`); coercing an unrecognised value to a default is
37
+ * NOT the same thing — see {@link isInlineViewSwitcherDisplayMode}.
49
38
  */
50
39
  export declare function isViewSwitcherPolicy(value: unknown): value is AdwViewSwitcherPolicy;
51
40
  /**
52
41
  * Whether `value` is a display mode libadwaita would accept.
53
- *
54
42
  * `adw_inline_view_switcher_set_display_mode` opens with
55
- * `g_return_if_fail (mode <= ADW_INLINE_VIEW_SWITCHER_BOTH)`
56
- * (adw-inline-view-switcher.c:819), which REJECTS the call and leaves the
57
- * current mode alone. The browser port's `includes(raw) ? raw : 'both'` replaced
58
- * the current mode with `'both'` instead, so a typo in one attribute silently
59
- * changed what every toggle displayed.
43
+ * `g_return_if_fail (mode <= ADW_INLINE_VIEW_SWITCHER_BOTH)`, which REJECTS the call and
44
+ * leaves the current mode alone — substituting a default instead would let a typo in one
45
+ * attribute silently change what every toggle displays.
60
46
  */
61
47
  export declare function isInlineViewSwitcherDisplayMode(value: unknown): value is AdwInlineViewSwitcherDisplayMode;
62
48
  /**
63
- * The page record every switcher flavour reads — `AdwViewStackPage`'s properties
64
- * with their C defaults (adw-view-stack.c:373-436).
49
+ * The page record every switcher flavour reads — `AdwViewStackPage`'s properties with
50
+ * their C defaults.
65
51
  *
66
52
  * `null` vs `''` is LOAD-BEARING and is why this record exists next to
67
- * {@link AdwViewStackPageInfo} rather than being replaced by it: the
68
- * button-visibility rule tests `title != NULL`, and an empty title is not NULL.
69
- * Wave 1's stack page model resolves an absent title to the page NAME (a
70
- * deliberate, documented deviation), so a page's "had no title at all" state
71
- * only survives where the switcher owns its own pages.
53
+ * {@link AdwViewStackPageInfo} rather than being replaced by it: the button-visibility
54
+ * rule tests `title != NULL` and an empty title is not NULL, while the stack page model
55
+ * resolves an absent title to the page NAME. So "had no title at all" only survives where
56
+ * the switcher owns its own pages.
72
57
  */
73
58
  export interface AdwViewSwitcherPage {
74
59
  /** Stable id, matching `AdwViewStackPage`'s name. */
@@ -92,76 +77,52 @@ export interface AdwViewSwitcherPageInit extends Partial<AdwViewSwitcherPage> {
92
77
  name: string;
93
78
  }
94
79
  /**
95
- * Normalize a partial page into the full record with the C defaults applied, so
96
- * a renderer that only knows `{ name, title }` gets exactly the same derivations
97
- * as one that knows badges.
98
- *
99
- * `undefined` collapses to the C default; an explicit `null` title or icon name
100
- * stays `null`. The badge is normalized to a non-negative integer because
101
- * `badge-number` is a `guint` (adw-view-stack.c:420-423) and every derivation
102
- * below assumes it.
80
+ * Normalize a partial page into the full record with the C defaults applied, so a renderer
81
+ * that only knows `{ name, title }` gets the same derivations as one that knows badges.
82
+ * `undefined` collapses to the C default, an explicit `null` title or icon name stays
83
+ * `null`, and the badge becomes a non-negative integer because `badge-number` is a `guint`.
103
84
  */
104
85
  export declare function createViewSwitcherPage(init: AdwViewSwitcherPageInit): AdwViewSwitcherPage;
105
86
  /**
106
- * Project a wave-1 stack page descriptor onto a switcher page, for a switcher
107
- * BOUND to an `Adw.ViewStack` rather than owning its own pages.
108
- *
109
- * One fidelity note remains: `AdwViewStackPageInfo.title` is already resolved
110
- * against the page name, so it is never `null` and the button-visibility rule
111
- * reduces to the `visible` flag.
112
- *
113
- * The second one is gone. This used to say the stack page carried none of
114
- * `badge-number`, `needs-attention` or `use-underline`, "so a bound switcher
115
- * derives an empty badge and no description" — which made a switcher bound to a
116
- * stack STRUCTURALLY unable to show a badge, and both `ViewSwitcherBar`s go
117
- * through here. The stack page carries all three now.
87
+ * Project a stack page descriptor onto a switcher page, for a switcher BOUND to an
88
+ * `Adw.ViewStack` rather than owning its own pages. Fidelity note:
89
+ * `AdwViewStackPageInfo.title` is already resolved against the page name, so it is never
90
+ * `null` and the button-visibility rule reduces to the `visible` flag.
118
91
  */
119
92
  export declare function viewSwitcherPageFromStackPage(page: AdwViewStackPageInfo): AdwViewSwitcherPage;
120
93
  /** {@link viewSwitcherPageFromStackPage} over a whole page list. */
121
94
  export declare function viewSwitcherPagesFromStack(pages: readonly AdwViewStackPageInfo[]): AdwViewSwitcherPage[];
122
95
  /**
123
- * `update_button`'s visibility rule (adw-view-switcher.c:178):
124
- * `visible && (title != NULL || icon_name != NULL)`.
125
- *
126
- * The empty string is NOT NULL, so `title: ''` still yields a button — the
127
- * opposite of what both ports did, which was to keep the button and hide only
128
- * its label. `undefined` is read as absent, i.e. as C's NULL.
96
+ * `update_button`'s visibility rule: `visible && (title != NULL || icon_name != NULL)`.
97
+ * The empty string is NOT NULL, so `title: ''` still yields a button; `undefined` is read
98
+ * as absent, i.e. as C's NULL.
129
99
  */
130
100
  export declare function isViewSwitcherButtonVisible(page: Pick<AdwViewSwitcherPage, 'visible' | 'title' | 'iconName'>): boolean;
131
101
  /**
132
- * The icon a switcher actually renders: a NULL or EMPTY name becomes
133
- * `image-missing` (adw-view-switcher-button.c:399-405,
134
- * adw-inline-view-switcher.c:137-142 — `icon_name && *icon_name` fails on `''`).
135
- *
136
- * Never returns `''`, so a renderer has an icon to paint in every mode where the
137
- * C widget creates a `GtkImage` at all. Both ports instead omitted the icon
138
- * node, which is why an icon-only toggle for a page without an icon rendered as
139
- * a blank box.
102
+ * The icon a switcher actually renders: a NULL or EMPTY name becomes `image-missing` (C's
103
+ * `icon_name && *icon_name` fails on `''`). Never returns `''`, so a renderer has an icon
104
+ * to paint in every mode where the C widget creates a `GtkImage` at all — otherwise an
105
+ * icon-only toggle for a page without an icon renders as a blank box.
140
106
  */
141
107
  export declare function viewSwitcherIconName(iconName: string | null | undefined): string;
142
108
  /**
143
- * The text a switcher paints for a page: `''` for a NULL title, otherwise the
144
- * title with its mnemonic stripped when `use-underline` is set.
145
- *
146
- * `update_button` binds `title` onto the button's label together with
147
- * `use-underline` (adw-view-switcher.c:170-176), and the template label carries
148
- * `use-underline` too (adw-view-switcher-button.ui) — so GTK DISPLAYS `_Files`
149
- * as `Files` with an underlined F. A renderer with no accelerator layer displays
150
- * the same text; keeping the underscore would render a literal one, which is
151
- * what the browser port did in the inline switcher's tooltip.
109
+ * The text a switcher paints for a page: `''` for a NULL title, otherwise the title with
110
+ * its mnemonic stripped when `use-underline` is set. GTK DISPLAYS `_Files` as `Files` with
111
+ * an underlined F (the template label carries `use-underline` too), so a renderer with no
112
+ * accelerator layer must display the same text — keeping the underscore renders a literal
113
+ * one.
152
114
  */
153
115
  export declare function viewSwitcherLabel(page: Pick<AdwViewSwitcherPage, 'title' | 'useUnderline'>): string;
154
116
  /**
155
- * `get_badge_label` (adw-indicator-bin.c:58-68): `''` for 0, `999+` above 999,
156
- * the decimal otherwise. 999 itself prints, because the test is `> 999`.
117
+ * `get_badge_label`: `''` for 0, `999+` above 999, the decimal otherwise. 999 itself
118
+ * prints, because the test is `> 999`.
157
119
  */
158
120
  export declare function viewSwitcherBadgeLabel(badgeNumber: number): string;
159
121
  /**
160
- * The message catalogue {@link viewSwitcherIndicatorDescription} composes, so the
161
- * core needs no gettext dependency while the composition ORDER stays pinned.
162
- *
163
- * C reads these through `C_("view switcher button badge", …)`; a renderer with a
164
- * translation layer passes its own catalogue.
122
+ * The message catalogue {@link viewSwitcherIndicatorDescription} composes, so the core
123
+ * needs no gettext dependency while the composition ORDER stays pinned. C reads these
124
+ * through `C_("view switcher button badge", …)`; a renderer with a translation layer
125
+ * passes its own catalogue.
165
126
  */
166
127
  export interface IndicatorDescriptionStrings {
167
128
  /** `needs-attention` clause — C's "Attention requested." */
@@ -171,49 +132,36 @@ export interface IndicatorDescriptionStrings {
171
132
  /** Badge clause for a printable count — C's "Has a badge: %u." */
172
133
  badge: (badgeNumber: number) => string;
173
134
  }
174
- /** The English source strings from adw-indicator-bin.c:77-92. */
135
+ /** The English source strings from `adw-indicator-bin.c`. */
175
136
  export declare const DEFAULT_INDICATOR_DESCRIPTION_STRINGS: IndicatorDescriptionStrings;
176
137
  /**
177
- * `update_description` (adw-indicator-bin.c:70-113) — the screen-reader
178
- * description bound onto the switcher button (adw-view-switcher-button.c:98-113)
179
- * or the inline toggle (adw-inline-view-switcher.c:267).
180
- *
181
- * The BADGE clause comes first when both apply: the format string is
182
- * `"%s %s", badge_description, needs_attention_description` (:96). `''` when
183
- * neither applies — C stores the empty string there, not NULL, and the button
184
- * then RESETS the accessible property rather than setting it.
138
+ * `update_description` — the screen-reader description bound onto the switcher button or
139
+ * the inline toggle. The BADGE clause comes first when both apply (`"%s %s",
140
+ * badge_description, needs_attention_description`), and `''` when neither applies: C
141
+ * stores the empty string there, not NULL, and the button then RESETS the accessible
142
+ * property rather than setting it.
185
143
  */
186
144
  export declare function viewSwitcherIndicatorDescription(needsAttention: boolean, badgeNumber: number, strings?: IndicatorDescriptionStrings): string;
187
145
  /**
188
- * `update_tooltip` (adw-inline-view-switcher.c:163-192): the empty string in
189
- * every display mode except `icons`, where it is the title with the mnemonic
190
- * stripped when `use-underline` is set.
191
- *
192
- * Returns PLAIN text — see {@link stripMnemonic} on why the C markup escape does
193
- * not belong in a port. A NULL title yields `''`: C would hand NULL to
194
- * `g_markup_escape_text`, which every page libadwaita renders avoids by always
195
- * having a title.
146
+ * `update_tooltip`: the empty string in every display mode except `icons`, where it is
147
+ * the title with the mnemonic stripped when `use-underline` is set. Returns PLAIN text —
148
+ * see {@link stripMnemonic} on why the C markup escape does not belong in a port. A NULL
149
+ * title yields `''`, a case C avoids by every rendered page having a title.
196
150
  */
197
151
  export declare function inlineToggleTooltip(page: Pick<AdwViewSwitcherPage, 'title' | 'useUnderline'>, displayMode: AdwInlineViewSwitcherDisplayMode): string;
198
152
  /**
199
- * `update_bar_revealed` (adw-view-switcher-bar.c:104-126): the bar is revealed
200
- * only when `reveal` is set AND more than one page is VISIBLE.
201
- *
202
- * When `reveal` is false the C loop never runs, so the count stays 0 — the two
203
- * clauses are not independent and a renderer must not reorder them into
204
- * `visibleCount > 1 || reveal`. Absent from both ports, which is why a bar bound
205
- * to a one-page stack showed an empty strip libadwaita keeps collapsed.
206
- *
207
- * Takes the minimal shape so a caller can pass either
208
- * {@link AdwViewSwitcherPage}s or wave-1 {@link AdwViewStackPageInfo}s.
153
+ * `update_bar_revealed`: the bar is revealed only when `reveal` is set AND more than one
154
+ * page is VISIBLE. When `reveal` is false the C loop never runs, so the count stays 0 —
155
+ * the clauses are not independent and must not be reordered into `visibleCount > 1 ||
156
+ * reveal`. Takes the minimal shape so a caller can pass either
157
+ * {@link AdwViewSwitcherPage}s or {@link AdwViewStackPageInfo}s.
209
158
  */
210
159
  export declare function shouldRevealViewSwitcherBar(reveal: boolean, pages: readonly {
211
160
  readonly visible: boolean;
212
161
  }[]): boolean;
213
162
  /**
214
- * The button orientation the policy implies — `WIDE` is horizontal, anything
215
- * else vertical (adw-view-switcher.c:219-220, :534-537). The same ternary is
216
- * used when a button is created and when the policy changes.
163
+ * The button orientation the policy implies — `WIDE` is horizontal, anything else
164
+ * vertical. C uses the same ternary at button creation and on a policy change.
217
165
  */
218
166
  export declare function viewSwitcherButtonOrientation(policy: AdwViewSwitcherPolicy): 'horizontal' | 'vertical';
219
167
  /** The fully-derived per-button view model an `AdwViewSwitcher` renderer paints. */
@@ -240,20 +188,17 @@ export interface ViewSwitcherButtonModel {
240
188
  description: string;
241
189
  }
242
190
  /**
243
- * One model per page for `AdwViewSwitcher`, in PAGE index space.
244
- *
245
- * `populate_switcher` adds a button for EVERY page and `update_button` merely
246
- * hides the ones that fail the visibility rule (adw-view-switcher.c:230-238,
247
- * :178), so the index space is preserved — unlike the inline switcher, which
248
- * drops hidden pages entirely. `selected` is the page index; `-1` selects
249
- * nothing.
191
+ * One model per page for `AdwViewSwitcher`, in PAGE index space: `populate_switcher` adds
192
+ * a button for EVERY page and `update_button` merely hides the ones that fail the
193
+ * visibility rule, so the index space is preserved — unlike the inline switcher, which
194
+ * drops hidden pages entirely. `selected` is the page index; `-1` selects nothing.
250
195
  */
251
196
  export declare function buildViewSwitcherButtons(pages: readonly AdwViewSwitcherPage[], selected: number, policy: AdwViewSwitcherPolicy, strings?: IndicatorDescriptionStrings): ViewSwitcherButtonModel[];
252
197
  /** The fully-derived per-toggle view model an `AdwInlineViewSwitcher` renderer paints. */
253
198
  export interface InlineToggleModel {
254
199
  /** Position among the TOGGLES — compacted, hidden pages skipped. */
255
200
  toggleIndex: number;
256
- /** Position in the PAGE list — libadwaita's `child-index` (adw-inline-view-switcher.c:346). */
201
+ /** Position in the PAGE list — libadwaita's `child-index`. */
257
202
  pageIndex: number;
258
203
  /** The page name. */
259
204
  name: string;
@@ -275,46 +220,36 @@ export interface InlineToggleModel {
275
220
  description: string;
276
221
  }
277
222
  /**
278
- * `populate_group`'s filter + order (adw-inline-view-switcher.c:360-392): a page
279
- * with `visible == FALSE` produces NO toggle.
223
+ * `populate_group`'s filter + order: a page with `visible == FALSE` produces NO toggle,
224
+ * which is why every model carries BOTH indices — `toggleIndex` is the compacted `0..k-1`
225
+ * position the toggle group knows, `pageIndex` the position the selection model knows, and
226
+ * libadwaita reconciles them through the `child-index` it stashes on each toggle.
280
227
  *
281
- * Which is why every model carries BOTH indices — `toggleIndex` is the compacted
282
- * `0..k-1` position the toggle group knows, `pageIndex` is the position the
283
- * selection model knows, and libadwaita reconciles them through the
284
- * `child-index` it stashes on each toggle (:346, :114-129). Neither port
285
- * filtered, so the two spaces coincided and the reconciliation looked
286
- * unnecessary.
287
- *
288
- * Note this uses the page's `visible` flag ALONE — the title-or-icon rule
289
- * belongs to `AdwViewSwitcher.update_button` and has no counterpart here, so a
290
- * page with neither title nor icon still gets an (empty) toggle.
228
+ * Uses the page's `visible` flag ALONE — the title-or-icon rule belongs to
229
+ * `AdwViewSwitcher.update_button` and has no counterpart here, so a page with neither
230
+ * title nor icon still gets an (empty) toggle.
291
231
  */
292
232
  export declare function buildInlineToggles(pages: readonly AdwViewSwitcherPage[], displayMode: AdwInlineViewSwitcherDisplayMode, strings?: IndicatorDescriptionStrings): InlineToggleModel[];
293
233
  /**
294
- * Page index → toggle index, or {@link VIEW_SWITCHER_NO_SELECTION} when the page
295
- * is hidden or out of range — `selection_changed_cb`
296
- * (adw-inline-view-switcher.c:434-453), where `index` stays
234
+ * Page index → toggle index, or {@link VIEW_SWITCHER_NO_SELECTION} when the page is
235
+ * hidden or out of range — `selection_changed_cb`, where `index` stays
297
236
  * `GTK_INVALID_LIST_POSITION` unless the visible child's page is itself visible.
298
- *
299
- * Non-integers are refused for the same reason `ViewStackState` refuses them:
300
- * the C position is a `guint`.
237
+ * Non-integers are refused because the C position is a `guint`.
301
238
  */
302
239
  export declare function toggleIndexForPage(pages: readonly AdwViewSwitcherPage[], pageIndex: number): number;
303
240
  /**
304
- * Toggle index → page index, or {@link VIEW_SWITCHER_NO_SELECTION} when there is
305
- * no such toggle — `notify_active_cb` (adw-inline-view-switcher.c:114-129), which
306
- * reads the active toggle's `child-index` and selects THAT page position.
241
+ * Toggle index → page index, or {@link VIEW_SWITCHER_NO_SELECTION} when there is no such
242
+ * toggle — `notify_active_cb` reads the active toggle's `child-index` and selects THAT
243
+ * page position.
307
244
  */
308
245
  export declare function pageIndexForToggle(pages: readonly AdwViewSwitcherPage[], toggleIndex: number): number;
309
246
  /** Opaque handle a {@link ViewSwitcherScheduler} returns for a pending dwell. */
310
247
  export type ViewSwitcherTimerHandle = unknown;
311
248
  /**
312
- * The injected timing seam for the drag-hover auto-switch.
313
- *
314
- * Deliberately the same SHAPE as `ToastScheduler` in `toast.ts`, so a renderer
315
- * writes ONE adapter over its platform timer and passes it to both. The core
316
- * never reaches for a global `setTimeout` — that is what `gjsify.headless: true`
317
- * machine-checks.
249
+ * The injected timing seam for the drag-hover auto-switch. Same SHAPE as `ToastScheduler`
250
+ * in `toast.ts`, so a renderer writes ONE adapter over its platform timer and passes it to
251
+ * both. The core never reaches for a global `setTimeout` — `gjsify.headless: true`
252
+ * machine-checks that.
318
253
  */
319
254
  export interface ViewSwitcherScheduler {
320
255
  /** Run `callback` after `ms`; return a handle {@link cancel} understands. */
@@ -332,14 +267,10 @@ export interface ViewSwitcherDragSwitchOptions {
332
267
  delay?: number;
333
268
  }
334
269
  /**
335
- * The 500 ms drag-hover auto-switch: hovering a non-active button while dragging
336
- * switches to it, and leaving before the dwell elapses cancels.
337
- *
338
- * Present in BOTH C files and in neither port
339
- * (adw-view-switcher-button.c:14, :58-63, :79-96; adw-inline-view-switcher.c:80,
340
- * :194-236). Each button/toggle owns its OWN timer there, so this keeps one
341
- * pending handle per index rather than a single global one — an enter on a
342
- * second index does not silently disarm the first.
270
+ * The 500 ms drag-hover auto-switch: hovering a non-active button while dragging switches
271
+ * to it, and leaving before the dwell elapses cancels. Each button/toggle owns its OWN
272
+ * timer in C, so this keeps one pending handle per index rather than a single global one —
273
+ * an enter on a second index does not silently disarm the first.
343
274
  */
344
275
  export declare class ViewSwitcherDragSwitch {
345
276
  private readonly _scheduler;
@@ -351,10 +282,8 @@ export declare class ViewSwitcherDragSwitch {
351
282
  * A drag entered the button at `index` while `activeIndex` is selected.
352
283
  * Returns whether a dwell was armed.
353
284
  *
354
- * `drag_enter_cb` early-returns when the hovered button is already active
355
- * (adw-view-switcher-button.c:82-83; the inline twin compares indices at
356
- * adw-inline-view-switcher.c:219), so hovering the current tab never
357
- * schedules anything.
285
+ * `drag_enter_cb` early-returns when the hovered button is already active (the inline
286
+ * twin compares indices instead), so hovering the current tab schedules nothing.
358
287
  */
359
288
  enter(index: number, activeIndex: number): boolean;
360
289
  /** The drag left the button at `index` — `drag_leave_cb` removes its source. */
@@ -373,11 +302,10 @@ export interface ViewSwitcherStateChange {
373
302
  /** Its rendered label ({@link viewSwitcherLabel}), `''` when nothing is selected. */
374
303
  title: string;
375
304
  /**
376
- * `true` for a user activation or an explicit select, `false` for a model-
377
- * driven auto-pick (a page list rebuild, a visibility flip). Same tagging
378
- * convention as `ComboState`/`SpinState`/`ViewStackState`; libadwaita
379
- * notifies on both paths, so this is for suppressing feedback loops, not for
380
- * dropping the notification.
305
+ * `true` for a user activation or an explicit select, `false` for a model-driven
306
+ * auto-pick (page list rebuild, visibility flip). Same convention as
307
+ * `ComboState`/`SpinState`/`ViewStackState`; libadwaita notifies on both paths, so this
308
+ * is for suppressing feedback loops, not for dropping the notification.
381
309
  */
382
310
  interactive: boolean;
383
311
  }
@@ -392,22 +320,18 @@ export interface ViewSwitcherStateOptions {
392
320
  }
393
321
  /**
394
322
  * The page model + selection of a switcher that OWNS its pages — the browser and
395
- * NativeScript switchers, which bundle the `AdwViewStack` libadwaita keeps
396
- * separate.
323
+ * NativeScript switchers, which bundle the `AdwViewStack` libadwaita keeps separate.
397
324
  *
398
- * Selection is DELEGATED to {@link ViewStackState}, not re-implemented: the
399
- * integer/range/already-selected/hidden guards, the by-name lookup, the
400
- * first-VISIBLE-page auto-pick and the hide-fallback all come from there, which
401
- * is where their conformance vectors already live. What this class adds is the
402
- * C-faithful page record (so the button-visibility and badge rules have their
403
- * inputs) and a name-preserving {@link setPages}, because both renderers rebuild
404
- * their page list wholesale and libadwaita's selection follows the page OBJECT
405
- * across such a rebuild (adw-view-stack.c:660-672) rather than the index.
325
+ * Selection is DELEGATED to {@link ViewStackState}: the integer/range/already-selected/
326
+ * hidden guards, the by-name lookup, the first-VISIBLE-page auto-pick and the
327
+ * hide-fallback all come from there, where their conformance vectors already live. This
328
+ * class adds the C-faithful page record and a name-preserving {@link setPages}, because
329
+ * renderers rebuild their page list wholesale and libadwaita's selection follows the page
330
+ * OBJECT across such a rebuild rather than the index.
406
331
  *
407
- * Policy and display mode are deliberately NOT here: each is one enum value plus
408
- * one style class, validated by {@link isViewSwitcherPolicy} /
409
- * {@link isInlineViewSwitcherDisplayMode} and rendered from
410
- * {@link VIEW_SWITCHER_POLICIES} / {@link INLINE_VIEW_SWITCHER_DISPLAY_MODES}.
332
+ * Policy and display mode are deliberately NOT here: each is one enum value plus one style
333
+ * class, validated by {@link isViewSwitcherPolicy} /
334
+ * {@link isInlineViewSwitcherDisplayMode}.
411
335
  */
412
336
  export declare class ViewSwitcherState {
413
337
  private _pages;
@@ -425,10 +349,9 @@ export declare class ViewSwitcherState {
425
349
  * rebuild whenever a page of the same name survives.
426
350
  *
427
351
  * libadwaita's selection is a page pointer compared by identity
428
- * (`adw_view_stack_pages_is_selected`, adw-view-stack.c:660-672), so an
429
- * insert before the selected page shifts its index without changing what is
430
- * shown; a rebuild that dropped the selected page falls through to the
431
- * first-visible auto-pick. Emits at most ONE change, tagged
352
+ * (`adw_view_stack_pages_is_selected`), so an insert before the selected page shifts its
353
+ * index without changing what is shown; a rebuild that dropped the selected page falls
354
+ * through to the first-visible auto-pick. Emits at most ONE change, tagged
432
355
  * `interactive: false` — the page set changed, the user did not click.
433
356
  */
434
357
  setPages(specs: readonly AdwViewSwitcherPageInit[]): void;
@@ -443,12 +366,9 @@ export declare class ViewSwitcherState {
443
366
  /**
444
367
  * Select by page index. Returns whether the selection changed.
445
368
  *
446
- * Every guard is {@link ViewStackState.setVisibleIndex}'s: a non-integer, a
447
- * negative, an out-of-range and a hidden page are all silent no-ops — NOT
448
- * clamped into range, which is what the browser switcher did (`active="-1"`
449
- * jumped to the first page, `active="99"` to the last) where
450
- * `adw_view_stack_pages_select_item` simply returns FALSE
451
- * (adw-view-stack.c:682-684).
369
+ * Every guard is {@link ViewStackState.setVisibleIndex}'s: a non-integer, a negative, an
370
+ * out-of-range and a hidden page are all silent no-ops, NOT clamped into range —
371
+ * `adw_view_stack_pages_select_item` simply returns FALSE.
452
372
  */
453
373
  setSelected(index: number, interactive?: boolean): boolean;
454
374
  /** Select by page name. Returns whether the selection changed. */
@@ -456,9 +376,9 @@ export declare class ViewSwitcherState {
456
376
  /**
457
377
  * Flip a page's `visible` flag. Returns whether the SELECTION moved.
458
378
  *
459
- * Both the switcher's page record and the delegated stack are updated, so the
460
- * derived buttons and toggles rebuild against the same truth the selection
461
- * fallback used (`update_child_visible`, adw-view-stack.c:1061-1082).
379
+ * Both the switcher's page record and the delegated stack are updated, so the derived
380
+ * buttons and toggles rebuild against the same truth the selection fallback used
381
+ * (`update_child_visible`).
462
382
  */
463
383
  setPageVisible(name: string, visible: boolean): boolean;
464
384
  /** A drag entered the button/toggle for page `pageIndex`; arms the dwell. */
@@ -484,16 +404,12 @@ export interface ViewSwitcherBarChange {
484
404
  /** Subscriber for {@link ViewSwitcherBarState} changes. */
485
405
  export type ViewSwitcherBarListener = (change: ViewSwitcherBarChange) => void;
486
406
  /**
487
- * `AdwViewSwitcherBar`'s reveal state machine: `reveal` is what the layout ASKS
488
- * for, `revealed` is what the bar actually does.
489
- *
490
- * `update_bar_revealed` is re-run from `set_reveal`, from `set_stack` and from
491
- * the pages' `items-changed` (adw-view-switcher-bar.c:340-343, :383, :277), so
492
- * the derived value flips both when the flag changes and when the page set does
493
- * — which is why {@link setPages} exists rather than the count being passed to
494
- * {@link setReveal}. `reveal` defaults to FALSE (:256-259); the NativeScript bar
495
- * started life VISIBLE, so a freshly constructed bar covered the screen bottom
496
- * until someone set `revealed = false`.
407
+ * `AdwViewSwitcherBar`'s reveal state machine: `reveal` is what the layout ASKS for,
408
+ * `revealed` is what the bar actually does. `update_bar_revealed` is re-run from
409
+ * `set_reveal`, from `set_stack` and from the pages' `items-changed`, so the derived value
410
+ * flips both when the flag changes and when the page set does — which is why
411
+ * {@link setPages} exists rather than the count being passed to {@link setReveal}.
412
+ * `reveal` defaults to FALSE, so a freshly constructed bar is collapsed.
497
413
  */
498
414
  export declare class ViewSwitcherBarState {
499
415
  private _reveal;
@@ -507,9 +423,8 @@ export declare class ViewSwitcherBarState {
507
423
  /** Whether the bar is actually shown — the derived truth. */
508
424
  get revealed(): boolean;
509
425
  /**
510
- * Set the request. Returns whether `reveal` itself changed (C returns early
511
- * before its notify when it did not, adw-view-switcher-bar.c:379-380); the
512
- * subscriber only fires when the DERIVED value moves.
426
+ * Set the request. Returns whether `reveal` itself changed (C returns early before its
427
+ * notify when it did not); the subscriber only fires when the DERIVED value moves.
513
428
  */
514
429
  setReveal(value: boolean): boolean;
515
430
  /**