@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
@@ -2,11 +2,11 @@
2
2
  export interface AdwRowLabels {
3
3
  /** The title label's text — `''` for an unset title, never `null`. */
4
4
  title: string;
5
- /** `string_is_not_empty(title)` — adw-action-row.ui:49-53. */
5
+ /** `string_is_not_empty(title)`, bound from `adw-action-row.ui`. */
6
6
  titleVisible: boolean;
7
7
  /** The subtitle label's text — `''` for an unset subtitle. */
8
8
  subtitle: string;
9
- /** `string_is_not_empty(subtitle)` — adw-action-row.ui:71-75. */
9
+ /** `string_is_not_empty(subtitle)`, bound from `adw-action-row.ui`. */
10
10
  subtitleVisible: boolean;
11
11
  }
12
12
  /** What a row knows about its two labels. */
@@ -18,43 +18,38 @@ export interface AdwRowLabelInput {
18
18
  }
19
19
  /**
20
20
  * The title/subtitle labels of any Adwaita row, with the `visible` each binding
21
- * computes.
22
- *
23
- * Exported on its own — not just as part of {@link ActionRowState} — because the
24
- * rows that already have a core state machine of their OWN (`Adw.ComboRow`,
25
- * `Adw.ExpanderRow`, `Adw.SpinRow` via `rows.ts`) still render this pair, and
26
- * every one of them had hand-rolled it.
21
+ * computes. Exported on its own — not just as part of {@link ActionRowState} — because
22
+ * the rows that have a core state machine of their OWN (`Adw.ComboRow`,
23
+ * `Adw.ExpanderRow`, `Adw.SpinRow` via `rows.ts`) still render this pair.
27
24
  */
28
25
  export declare function deriveRowLabels(input: AdwRowLabelInput): AdwRowLabels;
29
26
  /** Everything a renderer needs to paint an `Adw.ActionRow`. */
30
27
  export interface ActionRowRenderState extends AdwRowLabels {
31
28
  /**
32
- * `GtkListBoxRow:activatable` — whether a click activates the row at all.
33
- * `False` in the template (adw-action-row.ui:5) and raised by an activatable
34
- * widget rather than by the row itself.
29
+ * `GtkListBoxRow:activatable` — whether a click activates the row at all. `False`
30
+ * in the template and raised by an activatable widget, not by the row itself.
35
31
  */
36
32
  activatable: boolean;
37
33
  }
38
34
  /**
39
- * `Adw.ActionRow`: two labels plus the `activatable-widget` coupling.
40
- *
41
- * The coupling is the part no port had, and it is counter-intuitive twice over.
35
+ * `Adw.ActionRow`: two labels plus the `activatable-widget` coupling, which is
36
+ * counter-intuitive twice over.
42
37
  *
43
- * (1) Setting an activatable widget does not set `activatable = TRUE`; it binds
44
- * the WIDGET's `sensitive` onto the row's `activatable` with
45
- * `G_BINDING_SYNC_CREATE` (adw-action-row.c:729-732). So handing the row an
46
- * INSENSITIVE widget leaves the row unactivatable, and later flipping that
47
- * widget's `sensitive` flips the row with it, for as long as the binding lives.
38
+ * (1) Setting an activatable widget does not set `activatable = TRUE`; it binds the
39
+ * WIDGET's `sensitive` onto the row's `activatable` with `G_BINDING_SYNC_CREATE`. So
40
+ * handing the row an INSENSITIVE widget leaves the row unactivatable, and later
41
+ * flipping that widget's `sensitive` flips the row with it, as long as the binding
42
+ * lives.
48
43
  *
49
- * (2) Clearing the widget only UNBINDS (`g_clear_pointer (&priv->
50
- * activatable_binding, g_binding_unbind)`, C:709); it never writes `activatable`
51
- * back. The row therefore STAYS activatable after its widget is taken away —
52
- * which the class documentation states outright ("unsetting it won't change the
53
- * row's activatability", C:28-30). A port that models this as
54
- * `activatable = hasActivatableWidget` gets the sticky case exactly backwards.
44
+ * (2) Clearing the widget only UNBINDS
45
+ * (`g_clear_pointer (&priv->activatable_binding, g_binding_unbind)`); it never writes
46
+ * `activatable` back, so the row STAYS activatable after its widget is taken away —
47
+ * which the class documentation states outright ("unsetting it won't change the row's
48
+ * activatability"). Modelling this as `activatable = hasActivatableWidget` gets the
49
+ * sticky case exactly backwards.
55
50
  *
56
- * `TWidget` is whatever the renderer calls a widget — a DOM element, an NS
57
- * `View`. Core only ever compares it by identity and hands it back.
51
+ * `TWidget` is whatever the renderer calls a widget — a DOM element, an NS `View`. Core
52
+ * only ever compares it by identity and hands it back.
58
53
  */
59
54
  export declare class ActionRowState<TWidget = unknown> {
60
55
  private _title;
@@ -75,29 +70,27 @@ export declare class ActionRowState<TWidget = unknown> {
75
70
  /** `AdwActionRow:activatable-widget` — `null` when unset. */
76
71
  get activatableWidget(): TWidget | null;
77
72
  /**
78
- * `adw_action_row_set_activatable_widget` (C:696-741).
73
+ * `adw_action_row_set_activatable_widget`.
79
74
  *
80
- * `sensitive` is the widget's own `GtkWidget:sensitive` at the moment of the
81
- * set, which `G_BINDING_SYNC_CREATE` copies straight into `activatable`
82
- * (C:729-732); it defaults to `true` because a freshly built widget is
83
- * sensitive. Passing `null` unbinds and LEAVES `activatable` alone (C:709).
75
+ * `sensitive` is the widget's own `GtkWidget:sensitive` at the moment of the set,
76
+ * which `G_BINDING_SYNC_CREATE` copies straight into `activatable`; it defaults to
77
+ * `true` because a freshly built widget is sensitive. Passing `null` unbinds and
78
+ * LEAVES `activatable` alone.
84
79
  *
85
- * Returns whether the widget changed — the `notify::activatable-widget` gate
86
- * (C:740, guarded by the identity early-return at C:706-707).
80
+ * Returns whether the widget changed — the `notify::activatable-widget` gate, which
81
+ * the C guards with an identity early-return.
87
82
  */
88
83
  setActivatableWidget(widget: TWidget | null, sensitive?: boolean): boolean;
89
84
  /**
90
85
  * The live half of the binding: the activatable widget's `sensitive` is now
91
- * `sensitive`. Safe to call unconditionally — a renderer that re-reads the
92
- * widget rather than being told is the normal case on both ports.
93
- *
94
- * Two things make it a no-op, and both are the C's:
95
- * - no widget is set, so `g_clear_pointer (…, g_binding_unbind)` (C:709)
96
- * already took the binding away;
97
- * - the value is unchanged, so `gtk_widget_set_sensitive` early-returned
98
- * and `notify::sensitive` — the only thing a GBinding listens to — never
99
- * fired. Without this half, a re-assertion of the value the widget
100
- * already had would silently undo a direct write to `activatable`.
86
+ * `sensitive`. Safe to call unconditionally. Two things make it a no-op, both the
87
+ * C's:
88
+ * - no widget is set, so `g_clear_pointer (…, g_binding_unbind)` already took the
89
+ * binding away;
90
+ * - the value is unchanged, so `gtk_widget_set_sensitive` early-returned and
91
+ * `notify::sensitive` — the only thing a GBinding listens to — never fired.
92
+ * Without this half, re-asserting the value the widget already had would
93
+ * silently undo a direct write to `activatable`.
101
94
  *
102
95
  * Returns whether `activatable` changed.
103
96
  */
@@ -105,97 +98,84 @@ export declare class ActionRowState<TWidget = unknown> {
105
98
  /** `GtkListBoxRow:activatable`. */
106
99
  get activatable(): boolean;
107
100
  /**
108
- * Set `activatable` directly.
109
- *
110
- * Legal even while a binding is live: `g_object_bind_property` without
111
- * `G_BINDING_BIDIRECTIONAL` is one-way, so GTK lets the write land and the
112
- * next `sensitive` change overwrites it. Kept faithful rather than guarded —
113
- * a port that refused the write would diverge from every application that
114
- * sets `activatable` in a `.ui` file.
101
+ * Set `activatable` directly. Legal even while a binding is live:
102
+ * `g_object_bind_property` without `G_BINDING_BIDIRECTIONAL` is one-way, so GTK lets
103
+ * the write land and the next `sensitive` change overwrites it. Refusing the write
104
+ * would diverge from every application that sets `activatable` in a `.ui` file.
115
105
  *
116
106
  * Returns whether it changed.
117
107
  */
118
108
  setActivatable(activatable: boolean): boolean;
119
109
  /**
120
- * `adw_action_row_activate_real` (C:297-307): forward the activation to the
121
- * activatable widget, then emit `activated`.
110
+ * `adw_action_row_activate_real`: forward the activation to the activatable widget,
111
+ * then emit `activated`.
122
112
  *
123
113
  * Returns the widget to forward to, or `null`. The caller emits `activated`
124
- * UNCONDITIONALLY afterwards — C:306 is outside the `if`, and
125
- * `adw_action_row_activate` is public API (adw-action-row.h:90) with no
126
- * `activatable` check of its own. The `activatable` gate lives one level up,
127
- * in GtkListBox, which does not emit `row-activated` for an unactivatable
128
- * row; a renderer's CLICK handler is where that check belongs.
114
+ * UNCONDITIONALLY afterwards — the C's `g_signal_emit` sits outside the `if`, and
115
+ * `adw_action_row_activate` is public API with no `activatable` check of its own.
116
+ * The `activatable` gate lives one level up, in GtkListBox, which does not emit
117
+ * `row-activated` for an unactivatable row; a renderer's CLICK handler is where that
118
+ * check belongs.
129
119
  */
130
120
  activate(): TWidget | null;
131
121
  }
132
122
  /**
133
- * `Adw.SwitchRow`: one boolean, and the notify rule the two ports disagreed on.
123
+ * `Adw.SwitchRow`: one boolean and its notify rule.
134
124
  *
135
- * `adw_switch_row_set_active` (C:216-228) early-returns when the value is
136
- * unchanged and otherwise writes the slider, whose `notify::active` runs
137
- * `slider_notify_active_cb` (C:66-77) — which updates the a11y `checked` state
138
- * and emits `notify::active` on the ROW. That callback is the ONLY notify path,
139
- * and it cannot see where the change came from, so a programmatic set notifies
140
- * exactly like a drag on the handle.
125
+ * `adw_switch_row_set_active` early-returns when the value is unchanged and otherwise
126
+ * writes the slider, whose `notify::active` runs `slider_notify_active_cb` — which
127
+ * updates the a11y `checked` state and emits `notify::active` on the ROW. That callback
128
+ * is the ONLY notify path and it cannot see where the change came from, so a
129
+ * programmatic set notifies exactly like a drag on the handle. That is also why there is
130
+ * deliberately NO `interactive` flag here (the `SpinState`/`ComboState` shape): it would
131
+ * be an abstraction the C contradicts.
141
132
  *
142
- * Both renderers had half of it: `@gjsify/adwaita-web` emitted only from the
143
- * checkbox's `change` event, which the DOM does not fire for a programmatic
144
- * `.checked =`, so `row.active = true` was silent; `@gjsify/adwaita-nativescript`
145
- * re-emitted from `checkedChange`, which NS DOES fire on a programmatic write,
146
- * so it notified. One widget, one C source, two opposite answers.
147
- *
148
- * There is deliberately NO `interactive` flag (the `SpinState`/`ComboState`
149
- * shape): adding one would be an abstraction that actively contradicts C:66-77.
133
+ * The DOM makes this easy to get wrong: `<input>`'s `change` event does not fire for a
134
+ * programmatic `.checked =`, so a renderer that only re-emits `change` is silent for
135
+ * `row.active = true`.
150
136
  */
151
137
  export declare class SwitchRowState {
152
138
  private _active;
153
139
  /** `Adw.SwitchRow:active`. */
154
140
  get active(): boolean;
155
141
  /**
156
- * `adw_switch_row_set_active` (C:216-228). Returns whether it changed —
157
- * i.e. whether the renderer must emit `notify::active`. The `!!is_active`
158
- * normalisation is C:222.
142
+ * `adw_switch_row_set_active`. Returns whether it changed — i.e. whether the renderer
143
+ * must emit `notify::active`. The `!!is_active` normalisation is the C's.
159
144
  */
160
145
  setActive(active: boolean): boolean;
161
146
  /**
162
147
  * The row was activated (clicked, or <kbd>Enter</kbd>) — invert the state.
163
148
  *
164
- * `adw_switch_row_init` makes the row activatable and points the
165
- * activatable-widget at the slider (C:160-162), so an activation is
166
- * forwarded to the `GtkSwitch` and toggles it; the class docs state the
167
- * outcome directly ("When activated, the row will invert its active state.
168
- * The user can control the switch by activating the row or by dragging on
169
- * the switch handle", C:23-27). Neither port did this — the row's text was
170
- * dead and only the handle worked.
149
+ * `adw_switch_row_init` makes the row activatable and points the activatable-widget
150
+ * at the slider, so an activation is forwarded to the `GtkSwitch` and toggles it; the
151
+ * class docs state the outcome directly ("When activated, the row will invert its
152
+ * active state. The user can control the switch by activating the row or by dragging
153
+ * on the switch handle") — the whole row is the target, not just the handle.
171
154
  *
172
155
  * Always returns `true`: inverting a boolean always changes it.
173
156
  */
174
157
  activate(): boolean;
175
158
  }
176
159
  /**
177
- * `Adw.ButtonRow` is ALWAYS activatable — `<property name="activatable">True
178
- * </property>` in the template (adw-button-row.ui:5), with no setter, no
179
- * property and the class documentation saying so in one line
180
- * ("`AdwButtonRow` is always activatable.", adw-button-row.c:31).
181
- *
182
- * Exported as data because the browser renderer had INVENTED an
183
- * `activatable="false"` opt-out, and a passing test pinned it.
160
+ * `Adw.ButtonRow` is ALWAYS activatable — `<property name="activatable">True</property>`
161
+ * in the template, with no setter and no property, and the class documentation saying so
162
+ * in one line ("`AdwButtonRow` is always activatable."). Exported as data so a renderer
163
+ * cannot invent an `activatable="false"` opt-out.
184
164
  */
185
165
  export declare const BUTTON_ROW_ACTIVATABLE = true;
186
166
  /** Everything a renderer needs to paint an `Adw.ButtonRow`. */
187
167
  export interface ButtonRowRenderState {
188
168
  /** `AdwPreferencesRow:title` — `''` when unset. */
189
169
  title: string;
190
- /** `string_is_not_empty(title)` — adw-button-row.ui:34-38. */
170
+ /** `string_is_not_empty(title)`. */
191
171
  titleVisible: boolean;
192
- /** `AdwButtonRow:start-icon-name` — `''` when unset (C:209-210). */
172
+ /** `AdwButtonRow:start-icon-name` — `''` when unset. */
193
173
  startIconName: string;
194
- /** `string_is_not_empty(start_image.icon-name)` — adw-button-row.ui:20-24. */
174
+ /** `string_is_not_empty(start_image.icon-name)`. */
195
175
  startIconVisible: boolean;
196
- /** `AdwButtonRow:end-icon-name` — `''` when unset (C:221-222). */
176
+ /** `AdwButtonRow:end-icon-name` — `''` when unset. */
197
177
  endIconName: string;
198
- /** `string_is_not_empty(end_image.icon-name)` — adw-button-row.ui:55-59. */
178
+ /** `string_is_not_empty(end_image.icon-name)`. */
199
179
  endIconVisible: boolean;
200
180
  /** Always {@link BUTTON_ROW_ACTIVATABLE}. */
201
181
  activatable: true;
@@ -203,16 +183,11 @@ export interface ButtonRowRenderState {
203
183
  /**
204
184
  * `Adw.ButtonRow`: a centered title between two optional symbolic icons.
205
185
  *
206
- * The second icon is the lift: `AdwButtonRow:end-icon-name` (C:213-223, with
207
- * `adw_button_row_set_end_icon_name` at C:342-352 and the image bound at
208
- * adw-button-row.ui:52-65) has existed since libadwaita 1.6 and neither renderer
209
- * had it — so the "Open in Files ›" shape that the property exists for could not
210
- * be expressed at all.
211
- *
212
- * Both icon setters go through `g_set_str`, which returns FALSE for an unchanged
213
- * value and thereby gates the notify (C:309-312, C:348-351). `g_set_str (&s,
214
- * NULL)` stores NULL, but every read is `string_is_not_empty`-guarded and the
215
- * pspec default is `""`, so `''` is the faithful TS spelling of both.
186
+ * `AdwButtonRow:end-icon-name` has existed since libadwaita 1.6 and is what the
187
+ * "Open in Files ›" shape needs. Both icon setters go through `g_set_str`, which returns
188
+ * FALSE for an unchanged value and thereby gates the notify; `g_set_str (&s, NULL)`
189
+ * stores NULL, but every read is `string_is_not_empty`-guarded and the pspec default is
190
+ * `""`, so `''` is the faithful TS spelling of both.
216
191
  */
217
192
  export declare class ButtonRowState {
218
193
  private _title;
@@ -226,33 +201,28 @@ export declare class ButtonRowState {
226
201
  setTitle(title: string | null | undefined): boolean;
227
202
  /** `AdwButtonRow:start-icon-name`. */
228
203
  get startIconName(): string;
229
- /** `adw_button_row_set_start_icon_name` (C:303-313). Returns whether it changed. */
204
+ /** `adw_button_row_set_start_icon_name`. Returns whether it changed. */
230
205
  setStartIconName(iconName: string | null | undefined): boolean;
231
206
  /** `AdwButtonRow:end-icon-name`. */
232
207
  get endIconName(): string;
233
- /** `adw_button_row_set_end_icon_name` (C:342-352). Returns whether it changed. */
208
+ /** `adw_button_row_set_end_icon_name`. Returns whether it changed. */
234
209
  setEndIconName(iconName: string | null | undefined): boolean;
235
210
  }
236
211
  /** Everything a renderer needs to paint an `Adw.WindowTitle`. */
237
212
  export type WindowTitleRenderState = AdwRowLabels;
238
213
  /**
239
- * `Adw.WindowTitle`: the same two labels, one level out of the boxed list.
240
- *
241
- * Three rules, two lines each, and neither renderer had any of them: the TITLE
242
- * label is hidden when the title is empty (C:207-208 — the `.ui` even starts it
243
- * `visible=False`, adw-window-title.ui:15), a set to the CURRENT value returns
244
- * early (C:203-204, C:244-245), and a real change notifies (C:210, C:251).
214
+ * `Adw.WindowTitle`: the same two labels, one level out of the boxed list. Three rules —
215
+ * the TITLE label is hidden when the title is empty (the `.ui` even starts it
216
+ * `visible=False`), a set to the CURRENT value returns early, and a real change notifies.
245
217
  *
246
- * DIVERGENCE, deliberate: setting `null` over an already-empty value does NOT
247
- * notify here, where libadwaita does. Its guard is `g_strcmp0 (gtk_label_get_label
248
- * (…), title)` and `gtk_label_get_label` never returns NULL, so `g_strcmp0 ("",
249
- * NULL)` is 1 — the early return is skipped, the label is re-set to the same
250
- * `""`, and `notify::title` fires for a no-op. That is an artefact of a
251
- * NULL-vs-`""` pointer comparison, not a designed behaviour; both renderers
252
- * carry `null` for "attribute absent" and `''` for `title=""`, and emitting a
253
- * change notification for the difference between them would be noise. The
254
- * normalisation happens BEFORE the comparison, and `WINDOW_TITLE_VECTORS` pins
255
- * the divergence rather than hiding it.
218
+ * DIVERGENCE, deliberate: setting `null` over an already-empty value does NOT notify
219
+ * here, where libadwaita does. Its guard is `g_strcmp0 (gtk_label_get_label (…), title)`
220
+ * and `gtk_label_get_label` never returns NULL, so `g_strcmp0 ("", NULL)` is 1 — the
221
+ * early return is skipped, the label is re-set to the same `""`, and `notify::title` fires
222
+ * for a no-op. That is an artefact of a NULL-vs-`""` pointer comparison, not a designed
223
+ * behaviour; both renderers carry `null` for "attribute absent" and `''` for `title=""`.
224
+ * The normalisation happens BEFORE the comparison, and `WINDOW_TITLE_VECTORS` pins the
225
+ * divergence rather than hiding it.
256
226
  */
257
227
  export declare class WindowTitleState {
258
228
  private _title;
@@ -261,10 +231,10 @@ export declare class WindowTitleState {
261
231
  get state(): WindowTitleRenderState;
262
232
  /** `Adw.WindowTitle:title`. */
263
233
  get title(): string;
264
- /** `adw_window_title_set_title` (C:197-211). Returns whether it changed. */
234
+ /** `adw_window_title_set_title`. Returns whether it changed. */
265
235
  setTitle(title: string | null | undefined): boolean;
266
236
  /** `Adw.WindowTitle:subtitle`. */
267
237
  get subtitle(): string;
268
- /** `adw_window_title_set_subtitle` (C:238-252). Returns whether it changed. */
238
+ /** `adw_window_title_set_subtitle`. Returns whether it changed. */
269
239
  setSubtitle(subtitle: string | null | undefined): boolean;
270
240
  }
@@ -17,35 +17,31 @@ export declare const AVATAR_COLORS: ReadonlyArray<AdwAvatarColor>;
17
17
  /**
18
18
  * GLib's `g_str_hash` — the DJB2 variant `h = h * 33 + c`, as `guint32`.
19
19
  *
20
- * Two details decide whether the avatar colour matches GTK, and both were wrong
21
- * in the renderer copies this replaces: `c` is a **`signed char` of the UTF-8
22
- * encoding**, not a UTF-16 code unit, so bytes ≥ 0x80 contribute NEGATIVE values
23
- * (`"Jörg Schröder"` picked colour 5 instead of 13); and the C loop stops at the
24
- * first NUL byte, so an embedded `\0` truncates the input.
20
+ * Two details decide whether the avatar colour matches GTK: `c` is a **`signed char` of
21
+ * the UTF-8 encoding**, not a UTF-16 code unit, so bytes ≥ 0x80 contribute NEGATIVE
22
+ * values; and the C loop stops at the first NUL byte, so an embedded `\0` truncates the
23
+ * input.
25
24
  */
26
25
  export declare function gStrHash(text: string): number;
27
26
  /**
28
- * The initials `Adw.Avatar` shows for `text`: the first character, plus the
29
- * character following the LAST space if there is one.
27
+ * The initials `Adw.Avatar` shows for `text`: the first character, plus the character
28
+ * following the LAST space if there is one.
30
29
  *
31
- * Mirrors `extract_initials_from_text` step for step — upcase, then strip, then
32
- * NFC-normalise, then take code points (never UTF-16 units, so an astral first
33
- * letter survives). Only a literal ASCII space separates the two initials, so
34
- * `"Ada\tLovelace"` yields `"A"`, exactly as GTK does.
30
+ * Mirrors `extract_initials_from_text` step for step — upcase, strip, NFC-normalise,
31
+ * then take code points (never UTF-16 units, so an astral first letter survives). Only a
32
+ * literal ASCII space separates the two initials, so `"Ada\tLovelace"` yields `"A"`.
35
33
  *
36
- * Returns `''` for a blank name. libadwaita instead emits a one-NUL-byte label
37
- * there, because its caller only guards the RAW text against being empty; an
38
- * empty string is the sane rendering of the same "no initials" state.
34
+ * Returns `''` for a blank name, where libadwaita emits a one-NUL-byte label because its
35
+ * caller only guards the RAW text against being empty.
39
36
  */
40
37
  export declare function avatarInitials(text: string): string;
41
38
  /**
42
39
  * The 1-based colour class (`color1`…`color14`) `Adw.Avatar` assigns to `text`,
43
40
  * i.e. `set_class_color`'s `(g_str_hash (text) % NUMBER_OF_COLORS) + 1`.
44
41
  *
45
- * `null` for a blank name: libadwaita picks a RANDOM class there, so no value is
46
- * derivable from the name. A renderer that wants that behaviour calls
47
- * {@link randomAvatarColorClass}; one that paints nothing without initials — as
48
- * both current renderers do — can ignore the `null`.
42
+ * `null` for a blank name: libadwaita picks a RANDOM class there, so no value is derivable
43
+ * from the name. {@link randomAvatarColorClass} is that behaviour; a renderer that paints
44
+ * nothing without initials can ignore the `null`.
49
45
  */
50
46
  export declare function avatarColorClass(text: string): number | null;
51
47
  /**
@@ -64,13 +60,12 @@ export declare function avatarColor(text: string): AdwAvatarColor;
64
60
  /** Which of the three mutually exclusive things an avatar shows. */
65
61
  export type AdwAvatarMode = 'image' | 'initials' | 'icon';
66
62
  /**
67
- * `update_visibility` (adw-avatar.c:117): a custom image wins outright,
68
- * otherwise initials show when they were asked for and the name is non-empty,
69
- * otherwise the fallback icon.
63
+ * `update_visibility`: a custom image wins outright, otherwise initials show when they
64
+ * were asked for and the name is non-empty, otherwise the fallback icon.
70
65
  *
71
- * The gate is the length of the TEXT, not of the derived initials — a
72
- * whitespace-only name is in `'initials'` mode with a blank label, where a
73
- * renderer keying on the initials would fall back to the icon instead.
66
+ * The gate is the length of the TEXT, not of the derived initials — a whitespace-only name
67
+ * is in `'initials'` mode with a blank label, where a renderer keying on the initials
68
+ * would fall back to the icon instead.
74
69
  */
75
70
  export declare function avatarMode(input: {
76
71
  hasCustomImage: boolean;
@@ -79,26 +74,24 @@ export declare function avatarMode(input: {
79
74
  }): AdwAvatarMode;
80
75
  /**
81
76
  * The largest font size that still fits the initials inside the circle
82
- * (`update_font_size`, adw-avatar.c:221-227): the biggest square inscribed in
83
- * the circle, `size / 1.4142`, less a size-proportional padding
84
- * `max(size * 0.4 - 5, 0)`.
77
+ * (`update_font_size`): the biggest square inscribed in the circle, `size / 1.4142`, less
78
+ * a size-proportional padding `max(size * 0.4 - 5, 0)`.
85
79
  *
86
- * Monotonically increasing in `size`. A renderer that cannot measure text can
87
- * use this alone and stay inside libadwaita's bound — which the browser
88
- * renderer's old `size * (size < 32 ? 0.5 : 0.4)` did not: at size 31 it asked
89
- * for 15.5px against a 14.5px cap, then DROPPED to 12.8px at size 32.
80
+ * Monotonically increasing in `size`, which a breakpoint-style approximation
81
+ * (`size * (size < 32 ? 0.5 : 0.4)`) is not — that one both exceeds the cap and DROPS as
82
+ * the avatar grows. A renderer that cannot measure text can use this alone and stay
83
+ * inside libadwaita's bound.
90
84
  */
91
85
  export declare function avatarMaxFontSize(size: number): number;
92
86
  /**
93
87
  * The font size `Adw.Avatar` gives the initials label, given the label's
94
88
  * measured box: `height * (max / width)`, clamped to `[0, max]`.
95
89
  *
96
- * Text measurement is the one genuinely renderer-specific input, so it is
97
- * injected — the same seam style as `ToastScheduler`. Only the ASPECT RATIO of
98
- * the measurement matters (the formula scales it against the cap), so a renderer
99
- * may measure at any font size it likes, exactly as Pango's reset-then-measure
100
- * does. A non-positive width means "not laid out yet"; the cap is then the only
101
- * defensible answer.
90
+ * Text measurement is the one genuinely renderer-specific input, so it is injected (the
91
+ * `ToastScheduler` seam style). Only the ASPECT RATIO matters — the formula scales it
92
+ * against the cap — so a renderer may measure at any font size it likes, as Pango's
93
+ * reset-then-measure does. A non-positive width means "not laid out yet", and the cap is
94
+ * then the only defensible answer.
102
95
  */
103
96
  export declare function avatarFontSize(size: number, measured: {
104
97
  width: number;
@@ -1,16 +1,11 @@
1
- /**
2
- * `AdwBannerButtonStyle` as a string union — the two enum nicks
3
- * (adw-banner.c:23-35, Since 1.7).
4
- */
1
+ /** `AdwBannerButtonStyle` as a string union — the two enum nicks (since libadwaita 1.7). */
5
2
  export type AdwBannerButtonStyle = 'default' | 'suggested';
6
3
  /** Both `AdwBannerButtonStyle` members, in enum order. */
7
4
  export declare const ADW_BANNER_BUTTON_STYLES: readonly AdwBannerButtonStyle[];
8
5
  /**
9
- * Every style class `button-style` MANAGES on the banner button.
10
- *
11
- * A renderer swaps within this set and leaves every other class alone — the C
12
- * only ever adds or removes `suggested-action` (:766, :769), it never rewrites
13
- * the button's class list.
6
+ * Every style class `button-style` MANAGES on the banner button. A renderer swaps
7
+ * within this set and leaves every other class alone — the C only ever adds or
8
+ * removes `suggested-action`, it never rewrites the class list.
14
9
  */
15
10
  export declare const ADW_BANNER_BUTTON_STYLE_CLASSES: readonly string[];
16
11
  /** The five `Adw.Banner` properties, as a renderer holds them. */
@@ -26,79 +21,56 @@ export interface AdwBannerProps {
26
21
  /** `button-style` — grey (`'default'`) or `.suggested-action`. */
27
22
  buttonStyle: AdwBannerButtonStyle;
28
23
  }
29
- /**
30
- * The property defaults a freshly constructed `Adw.Banner` has, straight from
31
- * the `GParamSpec`s.
32
- *
33
- * Two of these are the whole reason this module exists, and both are easy to get
34
- * backwards from the rendered widget rather than from the source: `revealed` is
35
- * FALSE (:456-459) and `use-markup` is TRUE (:422-425).
36
- */
24
+ /** The property defaults of a freshly constructed `Adw.Banner`, from the `GParamSpec`s. */
37
25
  export declare const ADW_BANNER_DEFAULTS: Readonly<AdwBannerProps>;
38
26
  /** Whether `value` is one of the two `AdwBannerButtonStyle` nicks. */
39
27
  export declare function isBannerButtonStyle(value: unknown): value is AdwBannerButtonStyle;
40
28
  /**
41
- * The button style for a renderer-supplied string — an HTML attribute, an XML
42
- * property, a JSON config.
29
+ * The button style for a renderer-supplied string — an HTML attribute, an XML property,
30
+ * a JSON config.
43
31
  *
44
- * Anything that is not a nick becomes `'default'`. That is NOT the C setter's
45
- * behaviour and cannot be: `adw_banner_set_button_style` guards the ENUM range
46
- * (:756-757) and returns without changing anything, because by the time it runs
47
- * the value is already an `AdwBannerButtonStyle`. A string never becomes one, so
48
- * there is nothing to keep — falling back to the property default is what
49
- * GObject itself does when an invalid nick reaches `g_object_set`.
32
+ * MODIFICATION: anything that is not a nick becomes `'default'`, where
33
+ * `adw_banner_set_button_style` guards the ENUM range and keeps the old value. It can
34
+ * afford to, because by then the value already IS an `AdwBannerButtonStyle`; a string
35
+ * never becomes one, so there is nothing to keep. Falling back to the property default
36
+ * is what `g_object_set` does with an invalid nick.
50
37
  */
51
38
  export declare function parseBannerButtonStyle(value: string | null | undefined): AdwBannerButtonStyle;
52
39
  /**
53
40
  * The style classes the banner button carries for `style` —
54
- * `adw_banner_set_button_style`'s switch (:764-774).
41
+ * `adw_banner_set_button_style`'s switch.
55
42
  */
56
43
  export declare function bannerButtonStyleClasses(style: AdwBannerButtonStyle): readonly string[];
57
44
  /**
58
45
  * Whether the action button is shown: `gtk_widget_set_visible (button, label &&
59
- * label[0])` (:663).
60
- *
61
- * The test is on the FIRST CHARACTER, so it is not a trim and not a truthiness
62
- * check on the trimmed value — `" "` is a one-character label and its button is
63
- * shown, blank-looking though it is. A renderer that trimmed here would silently
64
- * drop a button GTK draws.
46
+ * label[0])` — FIRST CHARACTER, not a trim, so `" "` is a label and its button is
47
+ * shown. A renderer that trimmed would drop a button GTK draws.
65
48
  */
66
49
  export declare function bannerButtonVisible(label: string | null | undefined): boolean;
67
50
  /**
68
- * The text painted on the action button.
69
- *
70
- * The template pins the button to `use-underline=True` (adw-banner.ui:33) and
71
- * exposes no property to turn it off, so an `_` in `button-label` is ALWAYS an
72
- * accelerator marker — `"_Resume"` reads `Resume` with an underlined R. A
73
- * renderer with no accelerator layer wants the marker gone, which is what
74
- * {@link stripMnemonic} returns.
75
- *
76
- * The TITLE deliberately has no counterpart here: the same template pins the
77
- * title label to `use-underline=False` (adw-banner.ui:20), so a title keeps
78
- * every underscore it was given. Passing a title through this function would be
79
- * a bug, not a symmetry.
51
+ * The text painted on the action button. The template pins the button to
52
+ * `use-underline=True` with no property to turn it off, so `_` in `button-label` is
53
+ * ALWAYS an accelerator marker. The TITLE has no counterpart on purpose: the same
54
+ * template pins it to `use-underline=False`, so a title keeps its underscores and
55
+ * passing one through this function is a bug, not a symmetry.
80
56
  */
81
57
  export declare function bannerButtonText(label: string): string;
82
58
  /** What one banner derivation tells a renderer to draw. */
83
59
  export interface AdwBannerRenderState {
84
- /** Whether the strip is on screen (`GtkRevealer:reveal-child`, :817). */
60
+ /** Whether the strip is on screen (`GtkRevealer:reveal-child`). */
85
61
  revealed: boolean;
86
62
  /** Whether {@link AdwBannerProps.title} is to be read as Pango markup. */
87
63
  useMarkup: boolean;
88
- /** Whether the action button is in the tree (:663). */
89
64
  buttonVisible: boolean;
90
65
  /** The button's label with mnemonic markers removed. */
91
66
  buttonText: string;
92
- /** The style classes `button-style` puts on the button (:764-774). */
67
+ /** The style classes `button-style` puts on the button. */
93
68
  buttonClasses: readonly string[];
94
69
  }
95
70
  /**
96
71
  * The full render state for a banner, filling every unset property from
97
- * {@link ADW_BANNER_DEFAULTS}.
98
- *
99
- * Takes a `Partial` on purpose: a renderer reading attributes has "not set" as a
100
- * real state, and the whole point of this module is that "not set" resolves to
101
- * the libadwaita default rather than to whatever the renderer's field
102
- * initialiser happened to be.
72
+ * {@link ADW_BANNER_DEFAULTS}. `Partial` on purpose: a renderer reading attributes
73
+ * has "not set" as a real state, and it must resolve to the libadwaita default
74
+ * rather than to a field initialiser.
103
75
  */
104
76
  export declare function bannerRenderState(props?: Partial<AdwBannerProps>): AdwBannerRenderState;
@@ -39,10 +39,9 @@ export interface AdwBreakpointHandlers {
39
39
  onUnapply?: () => void;
40
40
  }
41
41
  /**
42
- * A single responsive breakpoint: a condition plus apply/unapply callbacks.
43
- * Mirrors `Adw.Breakpoint`. Drive {@link evaluate} from your renderer's size
44
- * source (e.g. `addBreakpoints` in `@gjsify/adwaita-nativescript`, or a
45
- * `ResizeObserver` in a browser renderer).
42
+ * A single responsive breakpoint: a condition plus apply/unapply callbacks, mirroring
43
+ * `Adw.Breakpoint`. Drive {@link evaluate} from the renderer's size source (`addBreakpoints`
44
+ * in `@gjsify/adwaita-nativescript`, a `ResizeObserver` in a browser renderer).
46
45
  */
47
46
  export declare class AdwBreakpoint {
48
47
  /** The parsed condition (null when an invalid string was passed). */
@@ -53,9 +52,9 @@ export declare class AdwBreakpoint {
53
52
  /** Whether the condition is currently satisfied (apply has fired, not unapply). */
54
53
  get applied(): boolean;
55
54
  /**
56
- * Re-evaluate against `size`, firing apply / unapply ONLY on a state change
57
- * (so a steady stream of layout passes doesn't re-run the callbacks). Returns
58
- * the post-evaluation applied state. A null condition never applies.
55
+ * Re-evaluate against `size`, firing apply / unapply ONLY on a state change, so a steady
56
+ * stream of layout passes does not re-run the callbacks. Returns the post-evaluation
57
+ * applied state; a null condition never applies.
59
58
  */
60
59
  evaluate(size: BreakpointSize): boolean;
61
60
  }