@gjsify/adwaita-core 0.35.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,39 +1,37 @@
1
1
  /**
2
2
  * The "no item is selected" index — the TS mirror of `GTK_INVALID_LIST_POSITION`
3
- * (`adw_sidebar_init`, adw-sidebar.c:2862).
3
+ * (`adw_sidebar_init`).
4
4
  *
5
- * libadwaita spells it `G_MAXUINT` because `AdwSidebar:selected` is a `guint`;
6
- * `-1` is the idiomatic TS sentinel and, being `G_MAXUINT` mod 2^32, it makes
7
- * {@link adjustSidebarSelection}'s arithmetic agree with the C code bit for bit.
5
+ * libadwaita spells it `G_MAXUINT` because `AdwSidebar:selected` is a `guint`; `-1` is the
6
+ * idiomatic TS sentinel and, being `G_MAXUINT` mod 2^32, it makes
7
+ * {@link adjustSidebarSelection}'s arithmetic agree with the C bit for bit.
8
8
  */
9
9
  export declare const ADW_SIDEBAR_NO_SELECTION = -1;
10
10
  /**
11
- * How a sidebar looks and behaves — `AdwSidebarMode` (adw-sidebar.h).
12
- *
13
- * `'sidebar'` is a flat navigation list with a persistent, VISIBLE selection;
14
- * `'page'` is a page of boxed lists where "the selection is invisible and only
15
- * tracked to determine the initially selected item once switched back"
16
- * (adw-sidebar.c:2948-2951). The tracked index is identical in both.
11
+ * How a sidebar looks and behaves — `AdwSidebarMode`. `'sidebar'` is a flat navigation list
12
+ * with a persistent, VISIBLE selection; `'page'` is a page of boxed lists where "the
13
+ * selection is invisible and only tracked to determine the initially selected item once
14
+ * switched back". The tracked index is identical in both.
17
15
  */
18
16
  export type AdwSidebarMode = 'sidebar' | 'page';
19
17
  /** One selectable row — the value half of `AdwSidebarItem`. */
20
18
  export interface AdwSidebarItemSpec {
21
- /** Row title. Defaults to `''` in libadwaita (adw-sidebar-item.c:419). */
19
+ /** Row title. Defaults to `''` in libadwaita. */
22
20
  title: string;
23
21
  /** Optional second line. Absent and `''` are the same thing. */
24
22
  subtitle?: string;
25
23
  /** Symbolic icon name, e.g. `'folder-symbolic'`. Absent means no icon. */
26
24
  iconName?: string;
27
- /** Whether the row is rendered at all — bound to `row:visible` (adw-sidebar.c:1382). Default true. */
25
+ /** Whether the row is rendered at all — bound to `row:visible`. Default true. */
28
26
  visible?: boolean;
29
- /** Whether the row can be activated — bound to `row:sensitive` (adw-sidebar.c:1383). Default true. */
27
+ /** Whether the row can be activated — bound to `row:sensitive`. Default true. */
30
28
  enabled?: boolean;
31
29
  }
32
30
  /**
33
31
  * A titled group of rows — the value half of `AdwSidebarSection`.
34
32
  *
35
33
  * An absent or empty title selects the `'separator'` header instead of the
36
- * `'title'` one (`update_header_page_cb`, adw-sidebar.c:1449-1455).
34
+ * `'title'` one (`update_header_page_cb`).
37
35
  */
38
36
  export interface AdwSidebarSectionSpec {
39
37
  /** Group heading. Absent/empty renders a separator instead. */
@@ -44,11 +42,10 @@ export interface AdwSidebarSectionSpec {
44
42
  /** One entry of the flattened item model. */
45
43
  export interface SidebarFlatItem {
46
44
  /**
47
- * The flat index `adw_sidebar_item_get_index` returns — the section's first
48
- * index plus the local one (adw-sidebar-item.c:1040). It stays in the
49
- * UNFILTERED space even when the item came out of a filtered walk, because
50
- * libadwaita keeps the selection on `items_model` and the row list on
51
- * `filtered_items` (adw-sidebar.c:2866, :2177-2180).
45
+ * The flat index `adw_sidebar_item_get_index` returns — the section's first index plus the
46
+ * local one. It stays in the UNFILTERED space even when the item came out of a filtered
47
+ * walk, because libadwaita keeps the selection on `items_model` and the row list on
48
+ * `filtered_items`.
52
49
  */
53
50
  index: number;
54
51
  /** Index of the owning section. */
@@ -57,22 +54,22 @@ export interface SidebarFlatItem {
57
54
  sectionItemIndex: number;
58
55
  /** The item as declared — same object identity, so `selectedItem === spec` holds. */
59
56
  item: AdwSidebarItemSpec;
60
- /** `string_is_not_empty(title)` — the title label's visibility (adw-sidebar.c:1411-1412). */
57
+ /** `string_is_not_empty(title)` — the title label's visibility. */
61
58
  titleVisible: boolean;
62
- /** `string_is_not_empty(subtitle)` (adw-sidebar.c:1420-1421). */
59
+ /** `string_is_not_empty(subtitle)`. */
63
60
  subtitleVisible: boolean;
64
- /** `notify_icon_cb`'s `icon_name && *icon_name` (adw-sidebar.c:1303). */
61
+ /** `notify_icon_cb`'s `icon_name && *icon_name`. */
65
62
  iconVisible: boolean;
66
63
  }
67
64
  /** The header libadwaita draws above one RENDERED section. */
68
65
  export interface SidebarHeaderSpec {
69
66
  /** Index of the section this header belongs to. */
70
67
  sectionIndex: number;
71
- /** Which page of the header stack shows — `'title'` or `'separator'` (adw-sidebar.c:1449-1455). */
68
+ /** Which page of the header stack shows — `'title'` or `'separator'`. */
72
69
  kind: 'title' | 'separator';
73
70
  /** The section title (`''` for a separator header). */
74
71
  title: string;
75
- /** True only for the section owning the FIRST rendered row — the `.first` class (adw-sidebar.c:1526). */
72
+ /** True only for the section owning the FIRST rendered row — the `.first` class. */
76
73
  first: boolean;
77
74
  }
78
75
  /** Payload of a `notify::selected` re-emit. */
@@ -91,67 +88,58 @@ export interface SidebarActivation {
91
88
  /** The index that was clicked, echoed back unchanged. */
92
89
  index: number;
93
90
  /**
94
- * Whether a row was actually activated. False when `index` addresses no
95
- * rendered, enabled row — libadwaita's callbacks run off an existing,
96
- * sensitive `GtkListBoxRow`, so there is nothing to activate otherwise.
91
+ * Whether a row was actually activated. False when `index` addresses no rendered, enabled
92
+ * row — libadwaita's callbacks run off an existing, sensitive `GtkListBoxRow`.
97
93
  */
98
94
  activated: boolean;
99
95
  /** Whether the selection moved. `activated && !selectionChanged` is a re-click of the current row. */
100
96
  selectionChanged: boolean;
101
97
  }
102
- /** Per-instance subscriber, same shape as `ComboStateListener` (rows.ts:114). */
98
+ /** Per-instance subscriber, same shape as `ComboStateListener` (rows.ts). */
103
99
  export type SidebarStateListener = (change: SidebarSelectionChange) => void;
104
100
  /**
105
- * The TS stand-in for `GtkFilter` on `AdwSidebar:filter` (adw-sidebar.c:3127).
101
+ * The TS stand-in for `GtkFilter` on `AdwSidebar:filter`.
106
102
  *
107
103
  * Decides only what is RENDERED and whether the sidebar counts as empty — never
108
104
  * the selection index space, which counts the unfiltered model.
109
105
  */
110
106
  export type SidebarItemFilter = (item: AdwSidebarItemSpec, index: number) => boolean;
111
107
  /**
112
- * The out-of-range rule, and the one all three implementations disagreed on:
113
- * anything that is not a valid position becomes NO SELECTION — never the
114
- * nearest in-range index.
115
- *
116
- * `adw_sidebar_set_selected` (adw-sidebar.c:3028-3029) is literally
117
- * `if (selected >= self->n_items) selected = GTK_INVALID_LIST_POSITION;`. A
118
- * negative input agrees with that for free: as a `guint`, `-7` is `4294967289`,
119
- * which is `>= n_items` for any real sidebar.
108
+ * The out-of-range rule: anything that is not a valid position becomes NO SELECTION — never
109
+ * the nearest in-range index. `adw_sidebar_set_selected` is literally
110
+ * `if (selected >= self->n_items) selected = GTK_INVALID_LIST_POSITION;`, and a negative
111
+ * input agrees with that for free: as a `guint`, `-7` is `4294967289`, which is
112
+ * `>= n_items` for any real sidebar.
120
113
  *
121
- * Non-integers and `NaN` are rejected rather than truncated. C cannot express
122
- * them, so there is no ground truth to copy; rejecting is the reading that
123
- * matches "not a valid position is no position", and it is what stops
124
- * `sidebar.selected = 1.5` from leaving the NativeScript port highlighting no
125
- * row while reporting a selection.
114
+ * Non-integers and `NaN` are rejected rather than truncated. C cannot express them, so
115
+ * there is no ground truth to copy; rejecting matches "not a valid position is no
116
+ * position", and it stops `sidebar.selected = 1.5` from highlighting no row while still
117
+ * reporting a selection.
126
118
  */
127
119
  export declare function clampSidebarSelection(index: number, count: number): number;
128
120
  /**
129
- * Where the selection lands after the item model spliced — `items_changed_cb`
130
- * (adw-sidebar.c:2246-2284), which neither renderer implemented.
121
+ * Where the selection lands after the item model spliced — `items_changed_cb`.
131
122
  *
132
123
  * Four cases, in the C code's order:
133
- * 1. `0 → n` auto-selects index 0 and notifies (adw-sidebar.c:2270-2273);
134
- * 2. a splice covering the selected index clears it (adw-sidebar.c:2275-2278);
135
- * 3. a splice at or before it shifts by `added - removed` (adw-sidebar.c:2280-2283);
124
+ * 1. `0 → n` auto-selects index 0 and notifies;
125
+ * 2. a splice covering the selected index clears it;
126
+ * 3. a splice at or before it shifts by `added - removed`;
136
127
  * 4. a splice after it changes nothing.
137
128
  *
138
- * The comparisons run in the UNSIGNED domain (`>>> 0`) because that is where C
139
- * runs them: with no selection, `selected` is `G_MAXUINT`, so case 2 can never
140
- * fire and case 3 wraps. That wraparound is REPRODUCED, not repaired — inserting
141
- * two items above a selection-less sidebar genuinely selects index 1 in GTK, and
142
- * a renderer that "fixed" it would stop matching the toolkit it mirrors.
129
+ * The comparisons run in the UNSIGNED domain (`>>> 0`) because that is where C runs them:
130
+ * with no selection, `selected` is `G_MAXUINT`, so case 2 can never fire and case 3 wraps.
131
+ * That wraparound is REPRODUCED, not repaired — inserting two items above a selection-less
132
+ * sidebar genuinely selects index 1 in GTK.
143
133
  */
144
134
  export declare function adjustSidebarSelection(selected: number, oldCount: number, newCount: number, position: number, removed: number, added: number): number;
145
135
  /**
146
- * Flatten the sections into the item model, the way `items_changed_cb`'s section
147
- * walk does: `set_first_index (section, current); current += get_n_items (section)`
148
- * (adw-sidebar.c:2261-2267).
149
- *
150
- * `sectionFirstIndex[i]` is `adw_sidebar_section_get_first_index` for section
151
- * `i` — a zero-item section advances nothing, so it shares its successor's index.
136
+ * Flatten the sections into the item model, the way `items_changed_cb`'s section walk does:
137
+ * `set_first_index (section, current); current += get_n_items (section)`.
152
138
  *
153
- * With a `filter`, `items` is the RENDERED subset while every `index` stays in
154
- * the unfiltered space; `sectionFirstIndex` is likewise unfiltered.
139
+ * `sectionFirstIndex[i]` is `adw_sidebar_section_get_first_index` for section `i` — a
140
+ * zero-item section advances nothing, so it shares its successor's index. With a `filter`,
141
+ * `items` is the RENDERED subset while every `index` (and `sectionFirstIndex`) stays in the
142
+ * unfiltered space.
155
143
  */
156
144
  export declare function flattenSidebarItems(sections: readonly AdwSidebarSectionSpec[], filter?: SidebarItemFilter | null): {
157
145
  items: SidebarFlatItem[];
@@ -160,28 +148,25 @@ export declare function flattenSidebarItems(sections: readonly AdwSidebarSection
160
148
  /**
161
149
  * The headers that actually get drawn, in render order.
162
150
  *
163
- * In sidebar mode a header is a property OF A ROW (`gtk_list_box_row_set_header`,
164
- * adw-sidebar.c:1563), so a section with no rows contributes none; in page mode
165
- * the group's `visible` is bound to `filtered n-items > 0` (adw-sidebar.c:1780-1781),
166
- * which comes to the same thing. Either way it is the sections that RENDER
167
- * something that produce headers — not the declared section list, which is what
168
- * the web port used and why an empty leading section drew a stray separator.
151
+ * In sidebar mode a header is a property OF A ROW (`gtk_list_box_row_set_header`), so a
152
+ * section with no rows contributes none; in page mode the group's `visible` is bound to
153
+ * `filtered n-items > 0`, which comes to the same thing. Either way it is the sections that
154
+ * RENDER something that produce headers, NOT the declared section list — deriving from the
155
+ * declared list draws a stray separator for an empty leading section.
169
156
  *
170
- * The section owning the first rendered row gets `first: true`; when that
171
- * section has no title its header is bound to `string_is_not_empty(title)` and
172
- * therefore invisible (adw-sidebar.c:1521-1527), so it is omitted entirely.
157
+ * The section owning the first rendered row gets `first: true`; when that section has no
158
+ * title its header is bound to `string_is_not_empty(title)` and therefore invisible, so it
159
+ * is omitted entirely.
173
160
  */
174
161
  export declare function sidebarHeaders(sections: readonly AdwSidebarSectionSpec[], filter?: SidebarItemFilter | null): SidebarHeaderSpec[];
175
162
  /**
176
163
  * The sidebar state machine both renderers drive.
177
164
  *
178
- * Programmatic changes ({@link setSelected}, {@link setSections},
179
- * {@link insertSection}, {@link removeSectionAt}, {@link removeAllSections})
180
- * notify with `interactive: false`; {@link activate} — the row click — notifies
181
- * with `interactive: true` and applies the selection BEFORE reporting the
182
- * activation, matching GtkListBox's `row-selected`-then-`row-activated` order
183
- * (adw-sidebar.c:2188-2191) and page mode's `set_selected`-then-emit
184
- * (`boxed_row_activated_cb`, adw-sidebar.c:1672-1673).
165
+ * Programmatic changes ({@link setSelected}, {@link setSections}, {@link insertSection},
166
+ * {@link removeSectionAt}, {@link removeAllSections}) notify with `interactive: false`;
167
+ * {@link activate} — the row click — notifies with `interactive: true` and applies the
168
+ * selection BEFORE reporting the activation, matching GtkListBox's
169
+ * `row-selected`-then-`row-activated` order and page mode's `set_selected`-then-emit.
185
170
  */
186
171
  export declare class SidebarState {
187
172
  private _mode;
@@ -196,22 +181,21 @@ export declare class SidebarState {
196
181
  /** Subscribe to selection changes. Returns an unsubscribe function. */
197
182
  subscribe(listener: SidebarStateListener): () => void;
198
183
  private _emit;
199
- /** Store an already-derived index; notify only on a real change (adw-sidebar.c:3031-3032). */
184
+ /** Store an already-derived index; notify only on a real change. */
200
185
  private _applySelected;
201
186
  /** Recompute everything derived from `sections` + `filter`. */
202
187
  private _invalidate;
203
- /** The current look/behaviour. Defaults to `'sidebar'` (adw-sidebar.c:2860). */
188
+ /** The current look/behaviour. Defaults to `'sidebar'`. */
204
189
  get mode(): AdwSidebarMode;
205
190
  /**
206
191
  * Switch mode. Returns whether it changed — `adw_sidebar_set_mode` early-returns
207
- * on the current value (adw-sidebar.c:2968-2969). Never touches the selection.
192
+ * on the current value. Never touches the selection.
208
193
  */
209
194
  setMode(mode: AdwSidebarMode): boolean;
210
195
  /**
211
- * Whether the selection is PAINTED. Page mode tracks the selection but shows
212
- * no selected row: its rows are plain `AdwActionRow`s in a boxed list
213
- * (`create_boxed_row`, adw-sidebar.c:1676) and the mode is documented as
214
- * "the selection is invisible, but still tracked" (adw-sidebar.c:2948-2951).
196
+ * Whether the selection is PAINTED. Page mode tracks the selection but shows no selected
197
+ * row: its rows are plain `AdwActionRow`s in a boxed list (`create_boxed_row`) and the
198
+ * mode is documented as "the selection is invisible, but still tracked".
215
199
  */
216
200
  get selectionVisible(): boolean;
217
201
  /** The declared sections. */
@@ -219,59 +203,52 @@ export declare class SidebarState {
219
203
  /**
220
204
  * Replace every section at once — the renderers' "here is my whole tree" call.
221
205
  *
222
- * Equivalent to `adw_sidebar_remove_all()` followed by appending each section,
223
- * i.e. two splices: everything removed (which clears the selection via
224
- * adw-sidebar.c:2275-2278) and everything added (which re-runs the `0 → n`
225
- * auto-select of index 0 at adw-sidebar.c:2270-2273). They are coalesced into
226
- * ONE notification, because one property write should produce one change.
206
+ * Equivalent to `adw_sidebar_remove_all()` followed by appending each section, i.e. two
207
+ * splices: everything removed (which clears the selection) and everything added (which
208
+ * re-runs the `0 → n` auto-select of index 0). Coalesced into ONE notification, because
209
+ * one property write should produce one change.
227
210
  */
228
211
  setSections(sections: readonly AdwSidebarSectionSpec[]): void;
229
212
  /**
230
- * Insert a section, returning the index it landed at.
231
- *
232
- * `adw_sidebar_insert` appends when `position` is negative OR at/past the end
233
- * (adw-sidebar.c:3358-3364) — so on a two-section sidebar, positions `-1`,
213
+ * Insert a section, returning the index it landed at. `adw_sidebar_insert` appends when
214
+ * `position` is negative OR at/past the end — so on a two-section sidebar, positions `-1`,
234
215
  * `2` and `5` all append, and position `2` is NOT an "insert at 2".
235
216
  */
236
217
  insertSection(section: AdwSidebarSectionSpec, position: number): number;
237
218
  /**
238
219
  * Remove the section at `index`. Returns false for an index that addresses no
239
220
  * section — `adw_sidebar_remove` warns and returns when the section is not
240
- * found (adw-sidebar.c:3387-3393), changing nothing.
221
+ * found, changing nothing.
241
222
  */
242
223
  removeSectionAt(index: number): boolean;
243
- /** `adw_sidebar_remove_all` (adw-sidebar.c:3417) — one splice removing every item. */
224
+ /** `adw_sidebar_remove_all` — one splice removing every item. */
244
225
  removeAllSections(): void;
245
226
  /**
246
227
  * Re-derive the item model after an ITEM's own properties changed in place.
247
228
  *
248
- * libadwaita has no such call because it does not need one: title, subtitle
249
- * and icon are live `g_object_bind_property` bindings straight onto the
250
- * labels (adw-sidebar.c:1409-1421) and `notify::icon-name` goes to
251
- * `notify_icon_cb` (:1393-1397) — none of them runs through
252
- * `items_changed_cb`, so the selection cannot move. This method is the same
253
- * contract for renderers that hand `SidebarState` mutable specs: the derived
254
- * flags are recomputed, the selection is untouched, nothing is emitted.
255
- * Both ports ignored post-construction item changes entirely.
229
+ * libadwaita needs no such call: title, subtitle and icon are live
230
+ * `g_object_bind_property` bindings straight onto the labels and `notify::icon-name` goes
231
+ * to `notify_icon_cb` — none of them runs through `items_changed_cb`, so the selection
232
+ * cannot move. Same contract here for renderers that hand `SidebarState` mutable specs:
233
+ * the derived flags are recomputed, the selection is untouched, nothing is emitted.
256
234
  */
257
235
  refresh(): void;
258
- /** `adw_sidebar_get_section` — `undefined` past the end (adw-sidebar.c:3297-3298). */
236
+ /** `adw_sidebar_get_section` — `undefined` past the end. */
259
237
  sectionAt(index: number): AdwSidebarSectionSpec | undefined;
260
238
  /** `adw_sidebar_section_get_first_index` — 0 for a section that is not in this sidebar. */
261
239
  sectionFirstIndex(sectionIndex: number): number;
262
- /** Number of items in the UNFILTERED model — the selection index space (adw-sidebar.c:2255). */
240
+ /** Number of items in the UNFILTERED model — the selection index space. */
263
241
  get count(): number;
264
242
  /** The full flattened item model, in flat-index order. */
265
243
  get items(): readonly SidebarFlatItem[];
266
- /** `adw_sidebar_get_item` — `undefined` for `index >= n_items` (adw-sidebar.c:3256). */
244
+ /** `adw_sidebar_get_item` — `undefined` for `index >= n_items`. */
267
245
  itemAt(index: number): AdwSidebarItemSpec | undefined;
268
246
  /** The current item filter, or `null`. */
269
247
  get filter(): SidebarItemFilter | null;
270
248
  /**
271
- * Set the item filter — `adw_sidebar_set_filter` (adw-sidebar.c:3127-3139).
272
- *
273
- * It only swaps the filter on the `GtkFilterListModel`; the selection is
274
- * never re-derived, so a selected item that filters out stays selected.
249
+ * Set the item filter — `adw_sidebar_set_filter`. It only swaps the filter on the
250
+ * `GtkFilterListModel`; the selection is never re-derived, so a selected item that filters
251
+ * out stays selected.
275
252
  */
276
253
  setFilter(filter: SidebarItemFilter | null): void;
277
254
  /** The items that pass the filter — the rows a renderer actually builds. */
@@ -279,14 +256,13 @@ export declare class SidebarState {
279
256
  /** The headers to draw, derived from the sections that render at least one row. */
280
257
  get headers(): readonly SidebarHeaderSpec[];
281
258
  /**
282
- * The `.empty` / placeholder state — `update_placeholder` counts the FILTERED
283
- * model (adw-sidebar.c:1828, :1839-1842), so a fully filtered-out sidebar is
284
- * empty even though its selection index space is not.
259
+ * The `.empty` / placeholder state — `update_placeholder` counts the FILTERED model, so a
260
+ * fully filtered-out sidebar is empty even though its selection index space is not.
285
261
  */
286
262
  get isEmpty(): boolean;
287
263
  /** The selected flat index, or {@link ADW_SIDEBAR_NO_SELECTION}. */
288
264
  get selected(): number;
289
- /** `adw_sidebar_get_selected_item` (adw-sidebar.c:3092). */
265
+ /** `adw_sidebar_get_selected_item`. */
290
266
  get selectedItem(): AdwSidebarItemSpec | undefined;
291
267
  /**
292
268
  * Programmatic selection — {@link clampSidebarSelection} then notify with
@@ -294,15 +270,13 @@ export declare class SidebarState {
294
270
  */
295
271
  setSelected(index: number): boolean;
296
272
  /**
297
- * A row click. Selects (notifying `interactive: true` if that moved) and then
298
- * reports the activation, which libadwaita emits on EVERY click including a
299
- * re-click of the already-selected row (`row_activated_cb`, adw-sidebar.c:1601-1612).
300
- * That unconditional emit is how re-tapping the current row reveals the content
301
- * pane of a split view (adw-sidebar.c:73-75) — the NativeScript port had no
302
- * activation path at all, so that gesture did nothing there.
273
+ * A row click. Selects (notifying `interactive: true` if that moved) and then reports the
274
+ * activation, which libadwaita emits on EVERY click including a re-click of the
275
+ * already-selected row (`row_activated_cb`). That unconditional emit is how re-tapping the
276
+ * current row reveals the content pane of a split view.
303
277
  *
304
- * A row that is filtered out, `visible: false`, or `enabled: false` is not
305
- * activatable: it either has no `GtkListBoxRow` or has an insensitive one.
278
+ * A row that is filtered out, `visible: false`, or `enabled: false` is not activatable: it
279
+ * either has no `GtkListBoxRow` or has an insensitive one.
306
280
  */
307
281
  activate(index: number): SidebarActivation;
308
282
  }
@@ -1,84 +1,66 @@
1
- /** `SPIN_DURATION_MS` (adw-spinner-paintable.c:20) — one full turn. */
1
+ /** `SPIN_DURATION_MS` — one full turn. */
2
2
  export declare const ADW_SPINNER_SPIN_DURATION_MS = 1200;
3
3
  /**
4
- * `START_ANGLE` (adw-spinner-paintable.c:21) — a fixed phase offset added to
5
- * both arc ends (:379-380), so the figure does not start at 3 o'clock.
6
- *
7
- * Neither port had it, which is a constant rotation error rather than a wrong
8
- * speed — invisible in a still frame, visible against a GTK spinner beside it.
4
+ * `START_ANGLE` — a fixed phase offset added to both arc ends, so the figure does not
5
+ * start at 3 o'clock. Omitting it is a constant rotation error rather than a wrong
6
+ * speed: invisible in a still frame, visible against a GTK spinner beside it.
9
7
  */
10
8
  export declare const ADW_SPINNER_START_ANGLE: number;
11
9
  /**
12
- * `CIRCLE_OPACITY` (adw-spinner-paintable.c:22) — the track is the WIDGET's
13
- * colour at 15%, not a hardcoded grey.
14
- *
15
- * The browser port used `rgba(127, 127, 127, 0.25)`: too dark, and
16
- * hue-independent, so a spinner on a coloured background lost its track
17
- * relationship entirely.
10
+ * `CIRCLE_OPACITY` — the track is the WIDGET's colour at 15%, not a hardcoded grey,
11
+ * so a spinner on a coloured background keeps its track relationship.
18
12
  */
19
13
  export declare const ADW_SPINNER_TRACK_OPACITY = 0.15;
20
- /** `MIN_ARC_LENGTH` (:24) — GSK refuses to draw an arc shorter than this. */
14
+ /** `MIN_ARC_LENGTH` — GSK refuses to draw an arc shorter than this. */
21
15
  export declare const ADW_SPINNER_MIN_ARC_LENGTH: number;
22
- /** `MAX_ARC_LENGTH` (:25) — the LERP TARGET, 162°. The drawn arc peaks at 102.8°. */
16
+ /** `MAX_ARC_LENGTH` — the LERP TARGET, 162°. The drawn arc peaks at 102.8°. */
23
17
  export declare const ADW_SPINNER_MAX_ARC_LENGTH: number;
24
- /** `IDLE_DISTANCE` (:26). */
18
+ /** `IDLE_DISTANCE`. */
25
19
  export declare const ADW_SPINNER_IDLE_DISTANCE: number;
26
- /** `OVERLAP_DISTANCE` (:27). */
20
+ /** `OVERLAP_DISTANCE`. */
27
21
  export declare const ADW_SPINNER_OVERLAP_DISTANCE: number;
28
- /** `EXTEND_DISTANCE` (:28). */
22
+ /** `EXTEND_DISTANCE`. */
29
23
  export declare const ADW_SPINNER_EXTEND_DISTANCE: number;
30
- /** `CONTRACT_DISTANCE` (:29). */
24
+ /** `CONTRACT_DISTANCE`. */
31
25
  export declare const ADW_SPINNER_CONTRACT_DISTANCE: number;
32
26
  /**
33
- * `N_CYCLES` (:33) — how many full TURNS the animation runs before repeating.
27
+ * `N_CYCLES` — how many full TURNS the animation runs before repeating.
34
28
  *
35
- * The C states the constraint it satisfies: the cycle length
36
- * `IDLE + EXTEND + CONTRACT - OVERLAP` must divide `N_CYCLES * 2pi` exactly, or
37
- * the arc would jump when the animation loops. It does — 53 turns is 40 arc
38
- * cycles — and {@link ADW_SPINNER_CYCLES_PER_LOOP} is that quotient, asserted
39
- * rather than assumed.
29
+ * The constraint the C states: the cycle length `IDLE + EXTEND + CONTRACT - OVERLAP`
30
+ * must divide `N_CYCLES * 2pi` exactly, or the arc jumps when the animation loops. It
31
+ * does — 53 turns is 40 arc cycles — and {@link ADW_SPINNER_CYCLES_PER_LOOP} is that
32
+ * quotient, asserted rather than assumed.
40
33
  */
41
34
  export declare const ADW_SPINNER_N_CYCLES = 53;
42
35
  /**
43
36
  * One arc cycle, in radians of base angle:
44
- * `IDLE_DISTANCE + EXTEND_DISTANCE + CONTRACT_DISTANCE - OVERLAP_DISTANCE`
45
- * (adw-spinner-paintable.c:112, :130).
37
+ * `IDLE_DISTANCE + EXTEND_DISTANCE + CONTRACT_DISTANCE - OVERLAP_DISTANCE`.
46
38
  */
47
39
  export declare const ADW_SPINNER_CYCLE_LENGTH: number;
48
40
  /** Whole arc cycles per animation loop — an integer, which is the C's constraint. */
49
41
  export declare const ADW_SPINNER_CYCLES_PER_LOOP: number;
50
42
  /**
51
43
  * The base angle a NON-animating spinner is drawn at — `EXTEND_DISTANCE -
52
- * OVERLAP_DISTANCE / 2` (adw-spinner-paintable.c:375-376), i.e. `pi * 0.75`.
53
- *
54
- * Reached whenever there is no animation object: before the paintable has a
55
- * widget, and in a still frame. Both ports left the resting pose undefined, so a
56
- * spinner that had not started yet drew whatever its keyframe origin happened to
57
- * be.
44
+ * OVERLAP_DISTANCE / 2`, i.e. `pi * 0.75`. Reached whenever there is no animation
45
+ * object: before the paintable has a widget, and in a still frame.
58
46
  */
59
47
  export declare const ADW_SPINNER_STILL_PROGRESS: number;
60
48
  /**
61
- * `normalize_angle` (adw-spinner-paintable.c:97-107) — fold into `[0, 2pi]`.
62
- *
63
- * The C loops rather than taking a modulo, and the boundary follows: it stops at
64
- * `angle > G_PI * 2`, so exactly `2pi` is left alone where a modulo would give 0.
49
+ * `normalize_angle` — fold into `[0, 2pi]`. The C loops rather than taking a modulo,
50
+ * and the boundary follows: it stops at `angle > G_PI * 2`, so exactly `2pi` is left
51
+ * alone where a modulo would give 0.
65
52
  */
66
53
  export declare function normalizeSpinnerAngle(angle: number): number;
67
54
  /**
68
- * `get_arc_start` (adw-spinner-paintable.c:109-125) — the trailing end of the
69
- * arc, relative to the base angle.
70
- *
71
- * The `- angle * MAX_ARC_LENGTH / l` term is the drift that makes the arc
72
- * advance around the circle as it breathes; without it the figure would pulse in
73
- * place.
55
+ * `get_arc_start` — the trailing end of the arc, relative to the base angle. The
56
+ * `- angle * MAX_ARC_LENGTH / l` term is the drift that makes the arc advance around
57
+ * the circle as it breathes; without it the figure would pulse in place.
74
58
  */
75
59
  export declare function spinnerArcStart(angle: number): number;
76
60
  /**
77
- * `get_arc_end` (adw-spinner-paintable.c:127-145) — the leading end.
78
- *
79
- * Its phase is offset by `EXTEND_DISTANCE - OVERLAP_DISTANCE`: the end only
80
- * starts moving once the start has extended past the overlap, which is what
81
- * makes the arc grow before it slides.
61
+ * `get_arc_end` — the leading end. Its phase is offset by
62
+ * `EXTEND_DISTANCE - OVERLAP_DISTANCE`: the end only starts moving once the start has
63
+ * extended past the overlap, which is what makes the arc grow before it slides.
82
64
  */
83
65
  export declare function spinnerArcEnd(angle: number): number;
84
66
  /** The two ends of the drawn arc, in radians clockwise from 3 o'clock. */
@@ -88,30 +70,26 @@ export interface SpinnerArc {
88
70
  /** Leading end, folded into `[0, 2pi]`. */
89
71
  end: number;
90
72
  /**
91
- * Arc length along the circle, `start - end` unwrapped into `(0, 2pi]`.
92
- *
93
- * The segment runs from `end` to `start` (`gsk_path_builder_add_segment
94
- * (builder, circle, &end_point, &start_point)`, :395) — the naming is the C's
95
- * and it is the opposite way round from what "start" suggests.
73
+ * Arc length along the circle, `start - end` unwrapped into `(0, 2pi]`. The segment
74
+ * runs from `end` to `start` (`gsk_path_builder_add_segment (builder, circle,
75
+ * &end_point, &start_point)`) — the naming is the C's and it is the opposite way
76
+ * round from what "start" suggests.
96
77
  */
97
78
  length: number;
98
79
  }
99
80
  /**
100
- * The arc for a base angle — `adw_spinner_paintable_snapshot_with_weight`
101
- * (adw-spinner-paintable.c:373-383).
81
+ * The arc for a base angle — `adw_spinner_paintable_snapshot_with_weight`.
102
82
  *
103
- * `progress` is the animation's value: 0 at the start of a loop, rising linearly
104
- * to `N_CYCLES * 2pi`. A renderer that has no animation passes
83
+ * `progress` is the animation's value: 0 at the start of a loop, rising linearly to
84
+ * `N_CYCLES * 2pi`. A renderer with no animation passes
105
85
  * {@link ADW_SPINNER_STILL_PROGRESS}.
106
86
  */
107
87
  export declare function spinnerArc(progress: number): SpinnerArc;
108
88
  /**
109
89
  * The animation's value after `elapsedMs` — `adw_timed_animation_new (widget, 0,
110
- * N_CYCLES * 2pi, SPIN_DURATION_MS * N_CYCLES, target)` with `ADW_LINEAR` easing
111
- * and `repeat_count = 0`, i.e. forever (adw-spinner-paintable.c:532-540).
112
- *
113
- * A linear ramp over the whole loop reduces to one turn per
114
- * {@link ADW_SPINNER_SPIN_DURATION_MS}; the loop length only decides where it
90
+ * N_CYCLES * 2pi, SPIN_DURATION_MS * N_CYCLES, target)` with `ADW_LINEAR` easing and
91
+ * `repeat_count = 0`, i.e. forever. A linear ramp over the whole loop reduces to one
92
+ * turn per {@link ADW_SPINNER_SPIN_DURATION_MS}; the loop length only decides where it
115
93
  * restarts, and it restarts at a point the arc phase agrees with.
116
94
  */
117
95
  export declare function spinnerProgressAt(elapsedMs: number): number;