@gjsify/adwaita-core 0.47.0 → 0.49.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 (37) hide show
  1. package/lib/esm/adjustment.js +1 -0
  2. package/lib/esm/avatar.js +1 -1
  3. package/lib/esm/conformance/adjustment.js +1 -0
  4. package/lib/esm/conformance/avatar.js +1 -1
  5. package/lib/esm/conformance/index.js +1 -1
  6. package/lib/esm/conformance/list.js +1 -0
  7. package/lib/esm/conformance/menu.js +1 -0
  8. package/lib/esm/conformance/rows.js +1 -1
  9. package/lib/esm/conformance/shared-trees.js +1 -0
  10. package/lib/esm/conformance/split-button.js +1 -1
  11. package/lib/esm/index.js +1 -1
  12. package/lib/esm/list.js +1 -0
  13. package/lib/esm/menu.js +2 -0
  14. package/lib/esm/rows.js +1 -1
  15. package/lib/esm/split-button.js +1 -1
  16. package/lib/esm/tab-view.js +1 -1
  17. package/lib/types/adjustment.d.ts +198 -0
  18. package/lib/types/adjustment.spec.d.ts +2 -0
  19. package/lib/types/avatar.d.ts +15 -0
  20. package/lib/types/conformance/adjustment.d.ts +33 -0
  21. package/lib/types/conformance/avatar.d.ts +16 -0
  22. package/lib/types/conformance/index.d.ts +12 -4
  23. package/lib/types/conformance/list.d.ts +171 -0
  24. package/lib/types/conformance/menu.d.ts +118 -0
  25. package/lib/types/conformance/rows.d.ts +3 -3
  26. package/lib/types/conformance/shared-trees.d.ts +93 -0
  27. package/lib/types/conformance/split-button.d.ts +9 -19
  28. package/lib/types/index.d.ts +12 -6
  29. package/lib/types/list.d.ts +109 -0
  30. package/lib/types/list.spec.d.ts +2 -0
  31. package/lib/types/menu.d.ts +366 -0
  32. package/lib/types/menu.spec.d.ts +2 -0
  33. package/lib/types/rows.d.ts +78 -109
  34. package/lib/types/shared-trees.spec.d.ts +2 -0
  35. package/lib/types/split-button.d.ts +21 -32
  36. package/lib/types/tab-view.d.ts +35 -2
  37. package/package.json +3 -3
@@ -0,0 +1,93 @@
1
+ /** One node of an authored tree — the shape `ADWAITA_GALLERY_SHARED_TREES` is written in. */
2
+ export interface SharedTreeNode {
3
+ /** A GIR class name, e.g. `AdwPreferencesGroup`. */
4
+ tag: string;
5
+ slot?: string;
6
+ props?: Readonly<Record<string, string | number | boolean>>;
7
+ children?: readonly SharedTreeNode[];
8
+ }
9
+ /**
10
+ * What a renderer must be able to READ off the widget it built.
11
+ *
12
+ * A closed vocabulary on purpose: it is the seam between this renderer-free module and the
13
+ * per-renderer drivers, and an open one would let a driver answer a question nobody else
14
+ * answers. Each name says WHICH widget and WHICH observation, never how to make it.
15
+ */
16
+ export type SharedTreeObservable =
17
+ /** `adw_entry_row_get_text_length` — characters, not UTF-16 units. */
18
+ 'entry-text-length'
19
+ /** `Adw.SwitchRow:active` after the tree's own write. */
20
+ | 'switch-row-active'
21
+ /** Whether the banner's action button is on screen. */
22
+ | 'banner-button-visible'
23
+ /** The text painted in the banner's action button, after mnemonic resolution. */
24
+ | 'banner-button-text';
25
+ /** One vector row an authored node instantiates, addressed to the renderer that built it. */
26
+ export interface SharedTreeExpectation {
27
+ /** Pre-order address inside the block, e.g. `AdwPreferencesGroup > AdwSwitchRow[1]`. */
28
+ path: string;
29
+ /** The GIR class of the node this is about. */
30
+ gtype: string;
31
+ /** The conformance table the row comes from — the name, so a failure cites its source. */
32
+ table: string;
33
+ observable: SharedTreeObservable;
34
+ expected: string | number | boolean;
35
+ /** The row's own `rule`, which is also the test title. */
36
+ rule: string;
37
+ }
38
+ /**
39
+ * The tables this module joins an authored tree against.
40
+ *
41
+ * NAMED IN CODE rather than in prose, because `check-adwaita-conformance-drivers.mjs` reads
42
+ * this list to decide which tables a tree driver drives. A table added here that no corpus
43
+ * node reaches fails the drivers' own suite — see `reachedTables` below, which is DERIVED
44
+ * from the corpus and not written down.
45
+ */
46
+ export declare const SHARED_TREE_TABLES: readonly ["BANNER_BUTTON_TEXT_VECTORS", "BANNER_BUTTON_VISIBLE_VECTORS", "ENTRY_TEXT_LENGTH_VECTORS", "SWITCH_ROW_NOTIFY_VECTORS"];
47
+ /**
48
+ * Blocks that reach NO vector row, with the measured reason — ADR 0051 § 4.
49
+ *
50
+ * A block in the corpus that proves nothing must SAY so, or the pass count reads as
51
+ * coverage it does not have. Self-retiring: a driver fails on a declared block that has
52
+ * started reaching a row, the same shape as arm 11's stale-divergence rule.
53
+ *
54
+ * A reason has to name the mechanism, not a consequence of it: the two below reach nothing
55
+ * for DIFFERENT reasons — one table is not joined, the other's rows do not match the
56
+ * authored values — and a declaration that blurs them is a silence nobody can retire.
57
+ */
58
+ export declare const SHARED_TREE_BLOCKS_WITHOUT_EXPECTATIONS: Readonly<Record<string, string>>;
59
+ /** Every authored node of `root`, in pre-order — the sequence a realised tree must reproduce. */
60
+ export declare function authoredNodes(root: SharedTreeNode): {
61
+ node: SharedTreeNode;
62
+ path: string;
63
+ }[];
64
+ /**
65
+ * The authored classes a realised tree must carry, in authored order.
66
+ *
67
+ * `tagOf` is the renderer's own spelling of a GIR class name — `hostTagOf` on the web, the
68
+ * GIR name itself in GTK. Both drivers filter their real tree down to this list and compare
69
+ * against it, so it lives here rather than in each of them: a driver deriving it privately
70
+ * is a second walk, free to disagree with the one {@link subjectIndexOf} addresses into.
71
+ */
72
+ export declare function authoredTags(root: SharedTreeNode, tagOf?: (gtype: string) => string): string[];
73
+ /**
74
+ * Where the node an expectation is about sits in that filtered walk.
75
+ *
76
+ * The pre-order addresses are unique and the filter preserves them, so this index into
77
+ * {@link authoredTags} is also the index into the realised tree — which is why a driver may
78
+ * pick its subject by position instead of by hunting for the first widget of the class. Both
79
+ * halves of that are asserted on Node in `shared-trees.spec.ts`, before either renderer
80
+ * relies on them.
81
+ */
82
+ export declare function subjectIndexOf(root: SharedTreeNode, path: string): number;
83
+ /** Every vector row the tree rooted at `root` instantiates, in pre-order. */
84
+ export declare function sharedTreeExpectations(root: SharedTreeNode): SharedTreeExpectation[];
85
+ /**
86
+ * The tables the CORPUS actually reaches, derived from the trees themselves.
87
+ *
88
+ * The counterweight to {@link SHARED_TREE_TABLES}: that list is a claim about what this
89
+ * module joins, this is what the corpus delivers. A driver holding them against each other
90
+ * is what stops a table being listed as tree-driven while no tree touches it — the false
91
+ * coverage class `check-adwaita-conformance-drivers.mjs`'s three incidents are all about.
92
+ */
93
+ export declare function reachedTables(roots: readonly SharedTreeNode[]): string[];
@@ -1,4 +1,5 @@
1
- import type { AdwArrowIcon, AdwMenuEntry, SplitButtonContentMode, SplitButtonDirection, SplitButtonHalfState, SplitButtonProperty, SplitButtonStyleClass } from '../split-button.js';
1
+ import type { AdwMenuItem, AdwMenuModel, AdwMenuPath } from '../menu.js';
2
+ import type { AdwArrowIcon, SplitButtonContentMode, SplitButtonDirection, SplitButtonHalfState, SplitButtonProperty, SplitButtonStyleClass } from '../split-button.js';
2
3
  /** One mutation in a {@link SplitButtonContentVector} sequence, with its outcome. */
3
4
  export interface SplitButtonContentStep {
4
5
  op: 'label' | 'icon-name' | 'child';
@@ -122,29 +123,18 @@ export interface SplitButtonRootStateVector {
122
123
  * CORE-ONLY: GAP — two of its three axes are hardcoded in the renderer, so there is nothing to vary. Tracked in #1072
123
124
  */
124
125
  export declare const SPLIT_BUTTON_ROOT_STATE_VECTORS: ReadonlyArray<SplitButtonRootStateVector>;
125
- /** One `parseMenuEntries` expectation. */
126
- export interface SplitButtonMenuParseVector {
127
- /** The raw `menu` attribute (or `null` when absent). */
128
- json: string | null;
129
- entries: readonly AdwMenuEntry[];
130
- rule: string;
131
- }
132
- /**
133
- * Menu-attribute parsing — the byte-identical helper both browser elements
134
- * carried. Total: nothing an author can type may prevent the widget upgrading.
135
- */
136
- export declare const SPLIT_BUTTON_MENU_PARSE_VECTORS: ReadonlyArray<SplitButtonMenuParseVector>;
137
126
  /** One activate-by-position expectation. */
138
127
  export interface SplitButtonMenuActivationVector {
139
- entries: readonly AdwMenuEntry[];
140
- index: number;
141
- /** The entry that must be dispatched, or `null`. */
142
- activated: AdwMenuEntry | null;
128
+ model: AdwMenuModel;
129
+ path: AdwMenuPath;
130
+ /** The item that must be dispatched, or `null`. */
131
+ activated: AdwMenuItem | null;
143
132
  rule: string;
144
133
  }
145
134
  /**
146
135
  * Activation is BY POSITION, never by label lookup: a `GMenuModel` addresses its
147
- * items by index and each carries its own detailed action.
136
+ * items by index and each carries its own detailed action. A PATH since ADR 0042,
137
+ * because a link is a model of its own and a flat index cannot name a nested item.
148
138
  */
149
139
  export declare const SPLIT_BUTTON_MENU_ACTIVATION_VECTORS: ReadonlyArray<SplitButtonMenuActivationVector>;
150
140
  /**
@@ -154,7 +144,7 @@ export declare const SPLIT_BUTTON_MENU_ACTIVATION_VECTORS: ReadonlyArray<SplitBu
154
144
  */
155
145
  export interface SplitButtonDropdownVector {
156
146
  /** The menu model to install (empty = none). */
157
- entries: readonly AdwMenuEntry[];
147
+ model: AdwMenuModel;
158
148
  /** Whether a popover is installed before it. */
159
149
  popover: boolean;
160
150
  /** Whether the dropdown half is live. */
@@ -2,7 +2,7 @@ export { ActionRowState, BUTTON_ROW_ACTIVATABLE, ButtonRowState, SwitchRowState,
2
2
  export type { ActionRowRenderState, AdwRowLabelInput, AdwRowLabels, ButtonRowRenderState, WindowTitleRenderState, } from './action-row.js';
3
3
  export { ADW_ABOUT_DIALOG_LABELS, ADW_CREDITS_SECTION_TITLES, ADW_LICENSES, ADW_LICENSE_ALIASES, ADW_LICENSE_DEFAULTS, ADW_LICENSE_WARRANTY_TEMPLATE, ADW_TRANSLATOR_CREDITS_SENTINELS, GTK_LICENSE, aboutDialogVisibility, creditsSections, isLicenseType, legalSectionVisible, licenseText, licenseTypeForSpdxId, parseCreditPerson, setLicense, setLicenseType, translatorCreditsPeople, } from './about-dialog.js';
4
4
  export type { AdwAboutDialogProps, AdwAboutDialogVisibility, AdwCreditPerson, AdwCreditsInput, AdwCreditsSection, AdwCreditsSectionInput, AdwLicenseAlias, AdwLicenseInfo, AdwLicenseNotify, AdwLicenseState, AdwLicenseTransition, AdwLicenseType, } from './about-dialog.js';
5
- export { AVATAR_COLOR_COUNT, AVATAR_COLORS, avatarColor, avatarColorClass, avatarFontSize, avatarInitials, avatarMaxFontSize, avatarMode, flattenAvatarGradient, gStrHash, randomAvatarColorClass, } from './avatar.js';
5
+ export { AVATAR_COLOR_COUNT, AVATAR_COLORS, avatarColor, avatarColorClass, avatarFontSize, avatarIconSize, avatarInitials, avatarMaxFontSize, avatarMode, flattenAvatarGradient, gStrHash, randomAvatarColorClass, } from './avatar.js';
6
6
  export type { AdwAvatarColor, AdwAvatarMode } from './avatar.js';
7
7
  export { ADW_BANNER_BUTTON_STYLES, ADW_BANNER_BUTTON_STYLE_CLASSES, ADW_BANNER_DEFAULTS, bannerButtonStyleClasses, bannerButtonText, bannerButtonVisible, bannerRenderState, isBannerButtonStyle, parseBannerButtonStyle, } from './banner.js';
8
8
  export type { AdwBannerButtonStyle, AdwBannerProps, AdwBannerRenderState } from './banner.js';
@@ -24,8 +24,12 @@ export { AdwToast, AdwToastQueue, DEFAULT_TOAST_TIMEOUT } from './toast.js';
24
24
  export type { AdwToastOptions, AdwToastQueueHandlers, AdwToastQueueOptions, ToastScheduler, ToastTimerHandle, } from './toast.js';
25
25
  export { AdwAlertResponses, BottomSheetPresentation, resolveBottomSheetClose } from './dialog.js';
26
26
  export type { AdwAlertResponse, AdwResponseAppearance, AdwResponseOptions, BottomSheetCloseOutcome, BottomSheetCloseSource, BottomSheetCloseState, BottomSheetPresentationListener, BottomSheetPresentationOptions, BottomSheetTeardownCallback, OrderedConfirmResponses, } from './dialog.js';
27
- export { ADW_COMBO_NO_SELECTION, ComboState, ExpanderState, SpinState, ToggleGroupState, normalizeComboOptions, } from './rows.js';
28
- export type { AdwComboOption, AdwComboOptionInput, ComboStateChange, ComboStateListener, ExpanderStateListener, SpinStateChange, SpinStateListener, ToggleGroupStateChange, ToggleGroupStateListener, } from './rows.js';
27
+ export { ADW_COMBO_NO_SELECTION, clampListSelection, listItemsChanged, normalizeComboOptions, parseListModel, } from './list.js';
28
+ export type { AdwComboOption, AdwComboOptionInput, AdwListItemsChanged, AdwListModel, AdwListModelInput, } from './list.js';
29
+ export { ADW_ADJUSTMENT_DEFAULTS, adjustmentRange, clampAdjustmentValue, normalizeAdjustment, parseAdjustment, snapAdjustmentValue, SpinState, } from './adjustment.js';
30
+ export type { AdwAdjustment, AdwAdjustmentInput, SpinStateChange, SpinStateListener, SpinStateRangeListener, } from './adjustment.js';
31
+ export { ComboState, ExpanderState, ToggleGroupState } from './rows.js';
32
+ export type { ComboItemsListener, ComboStateChange, ComboStateListener, ExpanderStateListener, ToggleGroupStateChange, ToggleGroupStateListener, } from './rows.js';
29
33
  export { glibClamp, gStrStrip, stringIsNotEmpty } from './glib.js';
30
34
  export { ViewStackState, normalizeIconName, resolvePageTitle } from './view-stack.js';
31
35
  export type { AdwViewStackPageInfo, AdwViewStackPageSpec, ViewStackStateChange, ViewStackStateListener, } from './view-stack.js';
@@ -44,11 +48,13 @@ export { ADW_LENGTH_UNITS, DEFAULT_DPI, adwLengthToPx, normalizeLengthUnit } fro
44
48
  export type { AdwLengthUnit } from './length-unit.js';
45
49
  export { ADW_SWIPE_BORDER, DEFAULT_MAX_SIDEBAR_WIDTH, DEFAULT_MIN_SIDEBAR_WIDTH, DEFAULT_SIDEBAR_WIDTH_FRACTION, DEFAULT_SIDEBAR_WIDTH_UNIT, INSTANT_SPLIT_VIEW_ANIMATOR, NAVIGATION_SPLIT_VIEW_CRITICALS, NavigationSplitViewState, OverlaySplitViewState, isSidebarAtVisualStart, layoutNavigationSplitView, layoutOverlaySplitView, measureSplitViewHorizontal, resolveNaturalSidebarWidth, resolveNavigationAction, resolveNavigationSidebarWidth, resolveNavigationStack, resolveOverlaySidebarWidth, resolveSidebarBounds, resolveSwipeArea, resolveSwipeRelease, resolveSwipeSnapPoints, resolveSwipeStart, swipeCancelProgress, tagsConflict, } from './split-view.js';
46
50
  export type { AdwPackType, AdwTextDirection, NavigationActionInput, NavigationActionResult, NavigationPageRef, NavigationSplitViewChange, NavigationSplitViewHandlers, NavigationSplitViewLayout, NavigationSplitViewListener, NavigationSplitViewOptions, NavigationSplitViewProperty, NavigationStackPlan, OverlaySplitViewChange, OverlaySplitViewLayout, OverlaySplitViewListener, OverlaySplitViewOptions, OverlaySplitViewProperty, SidebarBounds, SidebarWidthInput, SidebarWidthSpec, SplitViewAnimation, SplitViewAnimationRequest, SplitViewAnimator, SplitViewMeasureInput, SplitViewPane, SplitViewPaneRect, SwipeReleasePlan, } from './split-view.js';
47
- export { DEFAULT_DROPDOWN_TOOLTIP, SPLIT_BUTTON_DISABLED_OPACITY, SplitButtonState, isSplitButtonDirection, menuButtonArrowIcon, menuButtonPopupDirection, parseMenuEntries, resolveDropdownTooltip, splitButtonArrowIcon, splitButtonPopupDirection, splitButtonRootState, splitButtonStyleClasses, } from './split-button.js';
48
- export type { AdwArrowIcon, AdwMenuEntry, SplitButtonChange, SplitButtonContentMode, SplitButtonDirection, SplitButtonHalfState, SplitButtonListener, SplitButtonProperty, SplitButtonStyleClass, } from './split-button.js';
51
+ export { DEFAULT_DROPDOWN_TOOLTIP, SPLIT_BUTTON_DISABLED_OPACITY, SplitButtonState, isSplitButtonDirection, menuButtonArrowIcon, menuButtonPopupDirection, resolveDropdownTooltip, splitButtonArrowIcon, splitButtonPopupDirection, splitButtonRootState, splitButtonStyleClasses, } from './split-button.js';
52
+ export type { AdwArrowIcon, SplitButtonChange, SplitButtonContentMode, SplitButtonDirection, SplitButtonHalfState, SplitButtonListener, SplitButtonProperty, SplitButtonStyleClass, } from './split-button.js';
53
+ export { ADW_MENU_SURFACE_NATIVESCRIPT, ADW_MENU_SURFACE_WEB, assertMenuRenderable, flattenMenu, menuItemAt, menuNodeAt, menuRefusals, normalizeMenuModel, parseDetailedAction, parseMenuModel, resolveMenuItemState, } from './menu.js';
54
+ export type { AdwDetailedAction, AdwMenuAction, AdwMenuActions, AdwMenuDisplayHint, AdwMenuEntryInput, AdwMenuFlatRow, AdwMenuHiddenWhen, AdwMenuInput, AdwMenuItem, AdwMenuItemInput, AdwMenuItemRole, AdwMenuItemState, AdwMenuModel, AdwMenuNode, AdwMenuPath, AdwMenuRefusal, AdwMenuSection, AdwMenuSectionInput, AdwMenuSubmenu, AdwMenuSubmenuInput, AdwMenuSurface, AdwMenuTextDirection, } from './menu.js';
49
55
  export { DEFAULT_INDICATOR_DESCRIPTION_STRINGS, INLINE_VIEW_SWITCHER_DISPLAY_MODES, VIEW_SWITCHER_BADGE_LIMIT, VIEW_SWITCHER_DRAG_SWITCH_DELAY, VIEW_SWITCHER_FALLBACK_ICON, VIEW_SWITCHER_NO_SELECTION, VIEW_SWITCHER_POLICIES, ViewSwitcherBarState, ViewSwitcherDragSwitch, ViewSwitcherState, buildInlineToggles, buildViewSwitcherButtons, createViewSwitcherPage, inlineToggleTooltip, isInlineViewSwitcherDisplayMode, isViewSwitcherButtonVisible, isViewSwitcherPolicy, pageIndexForToggle, shouldRevealViewSwitcherBar, stripMnemonic, toggleIndexForPage, viewSwitcherBadgeLabel, viewSwitcherButtonOrientation, viewSwitcherIconName, viewSwitcherIndicatorDescription, viewSwitcherLabel, viewSwitcherPageFromStackPage, viewSwitcherPagesFromStack, } from './view-switcher.js';
50
56
  export type { AdwInlineViewSwitcherDisplayMode, AdwViewSwitcherPage, AdwViewSwitcherPageInit, AdwViewSwitcherPolicy, IndicatorDescriptionStrings, InlineToggleModel, ViewSwitcherBarChange, ViewSwitcherBarListener, ViewSwitcherButtonModel, ViewSwitcherDragSwitchOptions, ViewSwitcherScheduler, ViewSwitcherStateChange, ViewSwitcherStateListener, ViewSwitcherStateOptions, ViewSwitcherTimerHandle, } from './view-switcher.js';
51
- export { DEFAULT_TAB_AUTOHIDE, TabViewState, isDescendantOfPage, successorAfterClose, tabCloseVisible, tabIconState, tabTooltip, tabTooltipIsMarkup, tabsRevealed, } from './tab-view.js';
57
+ export { DEFAULT_TAB_AUTOHIDE, TabViewState, isDescendantOfPage, successorAfterClose, tabCloseVisible, tabIconState, tabTooltip, tabTooltipIsMarkup, tabViewItemsChanged, tabsRevealed, } from './tab-view.js';
52
58
  export type { AdwTabPageSpec, AdwTabPageState, TabIconState, TabViewHandlers, TabViewPagesChange, TabViewPagesChangeKind, TabViewPagesListener, TabViewSelectionChange, TabViewSelectionListener, } from './tab-view.js';
53
59
  export { ADW_SWIPE_DECELERATION_TOUCH, ADW_SWIPE_DECELERATION_TOUCHPAD, ADW_SWIPE_DRAG_THRESHOLD, ADW_SWIPE_EPSILON, ADW_SWIPE_HISTORY_THRESHOLD_MS, ADW_SWIPE_PARABOLA_MULTIPLIER, ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_H, ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_V, ADW_SWIPE_VELOCITY_CURVE_THRESHOLD, ADW_SWIPE_VELOCITY_THRESHOLD_TOUCH, ADW_SWIPE_VELOCITY_THRESHOLD_TOUCHPAD, SwipeTracker, swipeBounds, swipeClosestPointIndex, swipeEndProgress, swipeNextPointIndex, swipePreviousPointIndex, swipeProjectedPointIndex, swipeSlope, swipeVelocityThreshold, } from './swipe.js';
54
60
  export type { AdwSwipeEnd, AdwSwipeEndInput, AdwSwipeRange, AdwSwipeSource } from './swipe.js';
@@ -0,0 +1,109 @@
1
+ /** One selectable item — the display text plus the value it is addressed by. */
2
+ export interface AdwComboOption {
3
+ /** Display label shown in the row + chooser. */
4
+ label: string;
5
+ /** Underlying value the item is addressed by. */
6
+ value: string;
7
+ }
8
+ /**
9
+ * What an author may write for one item before {@link normalizeComboOptions} has seen it:
10
+ * a bare string (value === label, the `Gtk.StringList` case), or a partial descriptor
11
+ * where either half may stand in for the other.
12
+ */
13
+ export type AdwComboOptionInput = string | {
14
+ value?: unknown;
15
+ label?: unknown;
16
+ };
17
+ /** A normalised portable list model — what a `model` property holds on every surface. */
18
+ export type AdwListModel = ReadonlyArray<AdwComboOption>;
19
+ /** What a `model` property ACCEPTS: the widened form of {@link AdwListModel}. */
20
+ export type AdwListModelInput = ReadonlyArray<AdwComboOptionInput>;
21
+ /**
22
+ * Raw authored items → the stable `{ value, label }` descriptors every list surface
23
+ * works with.
24
+ *
25
+ * A bare string is both value and label (`Gtk.StringList`'s model, which is what
26
+ * `Adw.ComboRow` is fed in the common case). In a descriptor either half stands in for the
27
+ * missing other, so `{ label: 'Apple' }` is addressable by the value `'Apple'` rather than
28
+ * by `undefined`. ONE home for the rule, so no two list widgets can accept two different
29
+ * item vocabularies.
30
+ *
31
+ * TOTAL — it throws for no input. The doors this reaches are a property assignment and a
32
+ * markup attribute, and an author's typo must not take the widget down.
33
+ */
34
+ export declare function normalizeComboOptions(raw: AdwListModelInput | null | undefined): AdwComboOption[];
35
+ /**
36
+ * The MARKUP door: a JSON attribute → the normalised model.
37
+ *
38
+ * Total in both of its failure modes, which are different things and both an author slip:
39
+ * unparseable JSON and well-formed JSON that is not an array (an object, a number)
40
+ * each yield the empty model. Neither may stop the element upgrading — the reasoning
41
+ * `parseMenuModel` records for the same door on the same surfaces.
42
+ *
43
+ * It lives here rather than in each element because it was written twice, byte for byte,
44
+ * in `<adw-combo-row>` and `<gtk-drop-down>`: the second copy is where a helper is lifted.
45
+ */
46
+ export declare function parseListModel(raw: string | null | undefined): AdwComboOption[];
47
+ /**
48
+ * The "no item is selected" index — the TS mirror of `GTK_INVALID_LIST_POSITION`
49
+ * (`AdwComboRow:selected`'s default and empty value).
50
+ *
51
+ * libadwaita spells it `G_MAXUINT` because the property is a `guint`; `-1` is the idiomatic
52
+ * TS sentinel and the spelling {@link ADW_SIDEBAR_NO_SELECTION} uses for the same GTK
53
+ * constant. Without it, an EMPTY model and a model whose first item has an empty label are
54
+ * indistinguishable — both report index 0 with an empty value — so a renderer that wants to
55
+ * draw a placeholder has nothing to test.
56
+ */
57
+ export declare const ADW_COMBO_NO_SELECTION = -1;
58
+ /**
59
+ * Where a selection lands after the model under it was REPLACED.
60
+ *
61
+ * `GtkSingleSelection` autoselects, so a position the new model does not have falls back
62
+ * to 0 — including the sentinel, which is how a widget recovers a selection when its model
63
+ * grows. An EMPTY model has no 0 to fall back to and lands on
64
+ * {@link ADW_COMBO_NO_SELECTION}.
65
+ *
66
+ * The test is membership and not `selected >= length`: the sentinel is BELOW the range, so
67
+ * a one-sided comparison leaves a `-1` in place and a model that was emptied and refilled
68
+ * comes back with nothing selected.
69
+ *
70
+ * Lifted out of `ComboState.setModel` so a second list widget cannot re-derive it. The
71
+ * cross-renderer rule it encodes was already conformance data — `conformance/rows.ts`
72
+ * carries it as "the ports' shared answer" — it just had no name of its own.
73
+ */
74
+ export declare function clampListSelection(selected: number, length: number): number;
75
+ /**
76
+ * One positional change — `Gio.ListModel::items-changed`'s own three parameters.
77
+ *
78
+ * `position` is where the model changed, `removed` how many items went, `added` how many
79
+ * arrived. WHAT arrived is deliberately absent, because that is GLib's contract too: a
80
+ * consumer re-reads the model over `[position, position + added)`. Carrying the items
81
+ * would make the signal a second copy of the model that can disagree with it.
82
+ */
83
+ export interface AdwListItemsChanged {
84
+ /** The position at which the model changed. */
85
+ readonly position: number;
86
+ /** The number of items removed at {@link position}. */
87
+ readonly removed: number;
88
+ /** The number of items added at {@link position}. */
89
+ readonly added: number;
90
+ }
91
+ /**
92
+ * The ONE splice that turns `previous` into `next` — the `items-changed` a model
93
+ * replacement should emit, or `null` when the two are equal and GTK would emit nothing.
94
+ *
95
+ * It is the minimal single range: the shared prefix and the shared suffix are kept, and
96
+ * everything between them is the change. That is `g_list_store_splice`'s shape and its
97
+ * stated reason — one emission per change rather than one per item — and it is what lets
98
+ * a renderer append an item to a hundred-item list by adding ONE node.
99
+ *
100
+ * Items compare by BOTH halves: a descriptor whose label changed at an unchanged value is
101
+ * a different thing to draw, so it is inside the range. Comparing by `value` alone would
102
+ * leave a renamed row showing its old text, which is the exact failure `selection_item_changed`
103
+ * exists for upstream.
104
+ *
105
+ * NOT a diff algorithm. A model that moves one item from the front to the back reports the
106
+ * whole span, because `items-changed` has no vocabulary for a move — GTK's own list store
107
+ * reports `g_list_store_move` the same way.
108
+ */
109
+ export declare function listItemsChanged(previous: AdwListModel | null | undefined, next: AdwListModel | null | undefined): AdwListItemsChanged | null;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;