import { CSSResult, CSSResultGroup, LitElement, PropertyValues, ReactiveController, ReactiveControllerHost, TemplateResult, html, nothing } from "lit"; export type FormatValueForHuman = (v: unknown) => string; export type TooltipOrientations = `top` | `right` | `bottom` | `left`; export declare class TooltipElement extends LitElement { #private; connectedCallback(): void; static numberFormatter: (v: number) => string; static defaultFormatter: FormatValueForHuman; valueFormatTooltip: FormatValueForHuman; orientation: TooltipOrientations; anchor: string; value: unknown; icon?: string; protected render(): import("lit").TemplateResult<1>; protected createRenderRoot(): this; } declare global { interface HTMLElementTagNameMap { "ixfx-tooltip": TooltipElement; } } interface TooltipControllerOptions { keyboard?: boolean; delay?: number; } export declare const TooltipController: { init(opts?: TooltipControllerOptions): void; show(_target: HTMLElement): void; hide(): void; }; export declare class IxfxIconElement extends LitElement { #private; name: string; size: number | undefined; label: string; prominence: boolean; rotate: string; connectedCallback(): void; disconnectedCallback(): void; protected render(): typeof nothing | import("lit").TemplateResult<1>; protected updated(changed: Map): void; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-icon': IxfxIconElement; } } export type AcTextItem = { readonly label: string; readonly subLabel?: string; readonly icon?: string; readonly key?: string; readonly data?: unknown; /** When true, Tab-accept will not append `tabSuffix`. */ readonly isLeaf?: boolean; /** Character positions within label that matched the query, used for CSS highlight rendering. */ readonly positions?: ReadonlySet; }; export type AcTextSelectDetail = { readonly item: AcTextItem; readonly query: string; }; export type AcTextSelectEvent = CustomEvent; /** * Fired when the user commits a value — either by pressing Enter on typed text * or by selecting an item from the autocomplete popup (keyboard or click). */ export type AcTextChangeDetail = { /** The committed text value (typed text, or the selected item's label). */ readonly value: string; /** * The item key. For autocomplete items: `item.key ?? item.label`. * For plain typed text: the text itself. */ readonly key: string; /** The item's `data` payload. Only present for autocomplete selections. */ readonly data?: unknown; /** Whether the commit came from plain typed text or an autocomplete selection. */ readonly source: `text` | `autocomplete`; }; export type AcTextChangeEvent = CustomEvent; /** * Fired on every edit of the text (each keystroke, paste, or Tab-accept), * whether or not it is ever committed. Lets a consumer keep a half-typed value * that is left with a blur, which `change` never reports. */ export type AcTextValueDetail = { /** The text now in the input. */ readonly value: string; }; export type AcTextValueEvent = CustomEvent; export type AcTextCompletionProvider = (query: string, signal: AbortSignal) => Promise | AcTextItem[]; export declare class AcTextElement extends LitElement { #private; private static _count; private readonly _anchorName; /** Provides completion results for a query string. */ completionProvider: AcTextCompletionProvider | undefined; /** Placeholder text for the input. */ placeholder: string; /** Maximum number of query results to cache (LRU). */ cacheSize: number; /** Debounce delay in ms before invoking the provider after keystroke. */ debounceMs: number; /** * Pre-populate the input with this value. Updated externally after construction is ignored * unless the input is not currently focused. */ value: string; /** * String appended to the label when Tab is used to accept a suggestion. * Useful for path-style inputs where Tab-accepting a segment should add the separator. */ tabSuffix: string; private _query; private _results; private _isOpen; private _isLoading; /** How many of `_results` are in the DOM (the rest render as the popup scrolls). */ private _renderLimit; private tickled; constructor(); disconnectedCallback(): void; firstUpdated(): void; protected updated(changedProps: PropertyValues): void; focus(options?: FocusOptions, selectionStart?: number, selectionEnd?: number): void; focusWithValue(value: string, selectionStart?: number, selectionEnd?: number): void; selectRange(start: number, end?: number): void; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-ac-text': AcTextElement; } } /** * Shared data-provider contract used by components that render a list of items. * * A provider is a simple callable — the consuming component (via DataController) * manages the request lifecycle, cancellation, and reactive state. */ /** * One batch of items within a streaming provider response. * * For sync and async one-shot providers, the DataController synthesises a single * DataBatch internally — you only need this type when writing a streaming provider. */ export type DataBatch = { /** Items delivered in this batch. */ readonly items: readonly T[]; /** * When true, replace all previously accumulated items with this batch instead * of appending. Useful for re-ranked or filtered results mid-stream. * Default: false (append). */ replace?: boolean; /** * Provider's current estimate of the total number of items that will be * delivered across all batches. Enables progress percentage in the consumer. * May be refined in subsequent batches as the estimate improves. * Omit when the total is unknown. */ total?: number; }; /** * The three return modes a provider may use. * DataController normalises all three — callers can mix modes freely. * * - `readonly T[]` — sync, items available immediately * - `Promise` — async one-shot, resolves to the full result * - `AsyncIterable>` — streaming, batches arrive over time */ export type DataProviderResult = readonly T[] | Promise | AsyncIterable>; /** * A data provider callable. * * @typeParam TQuery - The input that scopes the request (e.g. `string` for * autocomplete, `{ node, depth }` for a tree branch, `void` for a plain list). * @typeParam TItem - The item type produced. * * The AbortSignal is cancelled when the consumer supersedes the request (e.g. * a new query arrives before the previous one completes). Streaming providers * should check `signal.aborted` between yields or pass the signal to their * underlying fetch calls. */ export type IDataProvider = (query: TQuery, signal: AbortSignal) => DataProviderResult; /** * Collects all items from any DataProviderResult into a flat array. * Useful for components that need a complete list before rendering (e.g. tree branches). * Respects the AbortSignal — stops accumulating if cancelled mid-stream. */ export declare function collectDataResult(result: DataProviderResult, signal: AbortSignal): Promise; type AcTokenItem = { readonly label: string; readonly subLabel?: string; readonly icon?: string; readonly key?: string; readonly data?: unknown; readonly positions?: ReadonlySet; }; /** Per-token visual overrides. Any CSS colour value. Ignored while the chip is selected. */ type AcTokenStyle = { readonly background?: string; readonly color?: string; readonly borderColor?: string; }; /** Given a committed token, returns style overrides for its chip (or undefined for default). */ type AcTokenStyleFn = (item: AcTokenItem) => AcTokenStyle | undefined; type AcTokenizerFn = (text: string) => string[]; type AcTokensChangeDetail = { readonly tokens: readonly AcTokenItem[]; }; type AcTokensChangeEvent = CustomEvent; type AcTokenAddDetail = { readonly item: AcTokenItem; readonly index: number; }; type AcTokenAddEvent = CustomEvent; type AcTokenRemoveDetail = { readonly item: AcTokenItem; readonly index: number; }; type AcTokenRemoveEvent = CustomEvent; interface AcTokenElementEventMap { 'ac-token-change': AcTokensChangeEvent; 'ac-token-add': AcTokenAddEvent; 'ac-token-remove': AcTokenRemoveEvent; } /** * Token/tag input with per-token autocomplete suggestions. * * Users type tokens separated by space, comma or semicolon (default). Each * committed token appears as a chip inline with the text cursor. The * suggestion popup follows the input cursor position. * * @fires {AcTokensChangeEvent} ac-token-change — any time the token list changes * @fires {AcTokenAddEvent} ac-token-add — when a token is added * @fires {AcTokenRemoveEvent} ac-token-remove — when a token is removed * * @example * ```html * * ``` */ export declare class AcTokenElement extends LitElement { #private; /** Provides completion results for the current draft token. */ completionProvider: IDataProvider | undefined; /** Custom tokenizer — defaults to splitting on space, comma, semicolon. */ tokenizer: AcTokenizerFn | undefined; /** * Optional per-token styling. Called when rendering each committed chip; * return `{ background, color, borderColor }` overrides, or undefined for * the default look. Selected chips keep the selected style. */ tokenStyle: AcTokenStyleFn | undefined; /** Placeholder text shown when no tokens or draft text are present. */ placeholder: string; /** Maximum number of query results to cache (LRU). */ cacheSize: number; /** Debounce delay in ms before invoking the provider after keystroke. */ debounceMs: number; /** * When true, only suggestions from the popup can be committed. * When false (default), typing text and pressing Enter commits it as-is. */ strict: boolean; /** * When false (default), tokens that have already been committed are * filtered out of the suggestion list. Set to true to show all * suggestions including duplicates. */ allowDuplicates: boolean; private _tokens; private _draft; private _selectedTokenIndex; private _isOpen; /** How many suggestions are in the DOM (the rest render as the popup scrolls). */ private _renderLimit; private _tickled; constructor(); get tokens(): readonly AcTokenItem[]; set tokens(value: readonly AcTokenItem[]); /** * Set the token list programmatically. Unlike the `tokens` property setter, * this does not dispatch `ac-token-change` — use it for initialisation or any * other programmatic update that should not re-enter a parent's own * `ac-token-change` handler. */ setTokens(value: readonly AcTokenItem[]): void; /** All committed token labels joined with commas. */ get value(): string; connectedCallback(): void; disconnectedCallback(): void; protected willUpdate(changedProps: PropertyValues): void; protected updated(changedProps: PropertyValues): void; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-ac-token': AcTokenElement; } } export interface AcTokenElement { addEventListener: ((type: K, listener: (this: AcTokenElement, event: AcTokenElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } export type SplitButtonSelectDetail = { readonly value: string; readonly label: string; }; export type SplitButtonSelectEvent = CustomEvent; export type SwitcherItem = { readonly command: string; readonly label: string; readonly icon: string; }; export type PopupItem = { readonly command: string; readonly label: string; readonly icon?: string; readonly disabled?: boolean; }; export type ItemsProvider = () => PopupItem[] | Promise; export type ButtonToggleDetail = { readonly value: boolean; }; export type ButtonToggleEvent = CustomEvent; export declare class ButtonElement extends LitElement { #private; disabled: boolean; icon?: string; hideIcon: boolean; hideLabel: boolean; hasIcon: boolean; subtle: boolean; /** * When true, this button acts as a toggle: clicking it flips `value` * between `true` and `false` instead of (or in addition to) firing a * regular click. */ toggleable: boolean; /** * Current on/off state of a toggleable button. Ignored when `toggleable` * is false. Can be set programmatically or declaratively (`value` * attribute). */ value: boolean; /** * What clicking does inside a `
` (including `ixfx-form`): `submit` * submits it, `reset` resets it. The default, `button`, does nothing. */ type: `button` | `submit` | `reset`; static formAssociated: boolean; formDisabledCallback(disabled: boolean): void; protected _renderIcon(): typeof nothing | import("lit").TemplateResult<1>; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { "ixfx-button": ButtonElement; } } export interface ButtonElementEventMap { toggle: ButtonToggleEvent; } export interface ButtonElement { addEventListener: ((type: K, listener: (this: ButtonElement, event: ButtonElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } export type RadioGroupMode = `compact` | `max`; export type RadioItem = Readonly<{ value: string; label: string; disabled?: boolean; iconName?: string; iconNameOff?: string; }>; export declare class RadioGroup extends LitElement { #private; value: string; orientation: `horizontal` | `vertical`; items: RadioItem[]; name: string; mode: RadioGroupMode; checked: boolean; valueOff: string; iconName: string; iconNameOff: string; hideLabels: boolean; wrap: boolean; private _computedItems; private _icons; private _slot?; private get _isSingleToggle(); private get _singleToggleIconName(); protected firstUpdated(): void; protected updated(changedProperties: PropertyValues): void; protected render(): unknown; static styles: import("lit").CSSResult[]; } export type RadioGroupChangeDetail = { readonly checked: boolean; readonly value: string | undefined; }; export type RadioGroupChangeEvent = CustomEvent; declare global { interface HTMLElementTagNameMap { 'ixfx-radio-group': RadioGroup; } } type CommandId = string; type CommandOptions = Readonly<{ onInvoke?: (id: CommandId, args?: Record) => void; onInvokeError?: (id: CommandId, error: Error, stage: `on-invoke` | `listener` | `execute`) => void; onCommandNotFound?: (id: CommandId) => void; }>; type Command = Readonly<{ id: CommandId; /** * User-facing label. A plain string, or a function of the state for labels that * vary by context. Resolve with `CommandRegistry.getLabel`. */ label: string | ((state: TState) => string); icon?: string; description: string; enabledWhen?: (state: TState) => boolean; execute: (args?: Record) => void; }>; type InputSource = `keyboard` | `pointer` | `midi`; type InputContext = Readonly<{ source: InputSource; element: HTMLElement | null; commandContext?: string; /** _true_ if the keydown was an auto-repeat from a held key (`KeyboardEvent.repeat`). Always false for other sources. */ repeat?: boolean; }>; type ModifierKey = `ctrl` | `shift` | `alt` | `meta`; interface Modifiers { ctrl: boolean; shift: boolean; alt: boolean; meta: boolean; } interface KeyBinding { key: string; modifiers: Set; mode?: TAppModes | `all`; nonExclusive?: boolean; commandContext?: string; /** Fire even while focus is in a text field (input, textarea, contenteditable). Default false. */ inTextInput?: boolean; /** Require the event's modifiers to match exactly, rather than being a superset. Default false. */ exact?: boolean; /** Fire on auto-repeat keydown events while the key is held. Default true. Set false for toggles/cycles. */ allowRepeat?: boolean; commandId: CommandId; } type KeyEventHandler = (commandId: CommandId, modifiers: Modifiers, context: InputContext) => void; /** * Command registry. */ declare class CommandRegistry { private commands; private invokeListeners; private labelOverrides; private labelListeners; private options; /** * Creates, with options. * @param options */ constructor(options?: CommandOptions); /** * Registers a command. * @throws If command with this id is already registered * @param command */ register(command: Command): void; /** * Unregisters a command. * @param id - Command ID to unregister * @returns _true_ if a command was removed */ unregister(id: CommandId): boolean; /** * Overrides a command's label until cleared, without re-registering it. * Listeners added with `addOnLabelChangeHandler` are notified if the override changed. * @param id - Command ID * @param text - New label, or _undefined_ to clear the override and use the command's own label * @returns _false_ if the command is not registered */ setLabel(id: CommandId, text: string | undefined): boolean; /** * Resolves a command's current label: a `setLabel` override if present, * otherwise the command's label (calling it with `state` if it is a function). * @param id - Command ID * @param state - Current application state, passed to a function label * @returns The label, or _undefined_ if the command is not registered */ getLabel(id: CommandId, state: TState): string | undefined; /** * Adds a function to call when a label is changed via `setLabel`. * @param handler - Receives the command id and new override (_undefined_ if cleared) * @returns Function to unsubscribe the handler */ addOnLabelChangeHandler(handler: (id: CommandId, label: string | undefined) => void): () => void; /** * Runs a command by its id. * * If the id was not found, the `onCommandNotFound` callback is used. * * Order is: * command.execute * options onInvoke handler executed * each invoke listener executed * @param id * @param args * @returns _false_ if command could not be executed or was not found. */ invoke(id: CommandId, args?: Record): boolean; /** * Adds a function to call when a command is invoked. * @param handler - Handler to add * @returns Function to unsubscribe the handler */ addOnInvokeHandler(handler: (id: CommandId, args?: Record) => void): () => void; /** * Gets a command by id. * @param id - Command ID to retrieve * @returns The command or _undefined_ if not found */ get(id: CommandId): Command | undefined; /** * Returns a copy of all commands. * @returns Array of all commands */ getAll(): ReadonlyArray>; /** * Returns a filtered array of all commands that are enabled for the given state. * @param state - Current application state * @returns Array of enabled commands */ getEnabled(state: TState): ReadonlyArray>; /** * Returns _true_ if this command is registered. * @param id - Command ID to check * @returns _true_ if the command exists */ has(id: CommandId): boolean; } /** A binding as accepted by `bind`: modifiers may be a Set or any iterable (e.g. the array from `captureKeyBinding`). */ type BindingInput = Omit, `modifiers`> & { modifiers: Iterable; }; /** * Selects bindings for `unbind`. Every field given must match; omitted fields match anything. * Keys compare case-insensitively, modifiers as exact sets, and an omitted `mode` on a binding counts as `all`. */ interface BindingMatch { commandId?: string; key?: string; modifiers?: Iterable; mode?: M | `all`; commandContext?: string; } interface KeyboardManagerOptions { /** Value of `exact` for bindings that do not set it. Default false. */ defaultExact?: boolean; } /** * Manages keyboard bindings and event handling. * @typeParam M - The mode type (e.g., 'detail' | 'coarse') */ declare class KeyboardManager { private bindings; private active; private element; private eventHandlers; private modeGetter; private defaultExact; private readonly keydownListener; constructor(options?: KeyboardManagerOptions); /** * Sets the default for `exact` on bindings added from now on that do not set it. * @param exact - Whether bindings require an exact modifier match by default */ setDefaultExact(exact: boolean): void; /** * Sets the function that returns the current application mode. * @param getter - Function that returns the current mode */ setModeGetter(getter: () => M): void; /** * Adds a key binding. Throws if an exclusive binding clashes with an existing one; * use `findConflict` first to ask. * @param binding - The binding to add. `modifiers` may be a Set or an array. */ bind(binding: BindingInput): void; /** * Returns the existing binding that `bind` would reject the given binding for, if any. * Non-exclusive bindings never conflict. * @param binding - The binding to check */ findConflict(binding: BindingInput): KeyBinding | undefined; /** * Removes key bindings. Keys compare case-insensitively, like matching and `bind`. * * - `unbind(key, modifiers)` removes every binding with that key and modifier set, whatever its mode, context or command. * - `unbind(match)` removes bindings matching every field given (see `BindingMatch`); an empty match removes nothing. * - `unbind(predicate)` removes bindings for which the predicate returns true. * @returns The number of bindings removed */ unbind(key: string, modifiers: Iterable): number; unbind(match: BindingMatch | ((binding: KeyBinding) => boolean)): number; /** * Removes all bindings of a command. * @param commandId - The command whose bindings to remove * @returns The number of bindings removed */ unbindCommand(commandId: string): number; /** * Enables or disables keyboard event handling. * @param active - Whether keyboard handling should be active */ setActive(active: boolean): void; /** * Whether keyboard event handling is active. */ isActive(): boolean; /** * Adds a handler for key events. * @param handler - The handler to call when a key event matches a binding * @returns Function to unsubscribe the handler */ onKeyEvent(handler: KeyEventHandler): () => void; /** * Attaches keyboard event listeners to an element. * @param element - The element to attach to */ attach(element: HTMLElement): void; /** * Removes keyboard event listeners. */ detach(): void; /** * Returns all registered bindings. * @returns Readonly array of bindings */ getBindings(): ReadonlyArray>; private handleKeydown; private getInputContext; private getModifiers; private findBinding; private pickBestBinding; private matchesCommandContext; private formatModifiers; private isSubset; private setsEqual; private toModifiers; } declare class MenuContainer extends LitElement { anchor?: string; registry?: CommandRegistry; keyboardManager?: KeyboardManager; private _popover; private tickled; static styles: import("lit").CSSResult[]; private _updateIconSections; private _propagateContext; updated(changedProperties: Map): void; /** * Sync data-input-mode to :host so CSS variables cascade to slotted items */ willUpdate(changed: Map): void; render(): import("lit").TemplateResult<1>; private _getMenuItems; /** * Sync .tickled class on slotted items to match controller state * This is called via onStateChange whenever the tickled state changes */ private _syncTickledClasses; private _handleMouseOver; focusFirst(): void; private _focusNext; private _focusItem; private _activateFocusedItem; private _handleKeydown; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-container': MenuContainer; } } type MenuMode = `trigger` | `dropdown` | `context`; type Placement = `bottom-start` | `bottom-end` | `right-start`; type MenuTriggerCommandDetail = { readonly command?: string; readonly value?: string; readonly checked?: boolean; }; declare class MenuTrigger extends LitElement { mode: MenuMode; label: string; /** Render an `ixfx-icon` in the default button instead of the text `label`. */ iconName: string; registry?: CommandRegistry; keyboardManager?: KeyboardManager; placement: Placement; /** Set false when a host widget manages its own roving/virtual focus (e.g. crumb-navigation) and opens this menu programmatically, so the trigger button should not be a native Tab stop. */ tabStop: boolean; private _isOpen; private _hasMenu; private _hasTriggerSlot; private _hasContextTarget; private _triggerBtn; private _popup; private static _count; private _anchorName; private _clickListener; /** Element focused when the menu opened; focus returns here on Escape/Tab when there is no trigger button (context-target mode). */ private _focusBeforeOpen; /** A mouse button is currently down on the trigger area. */ private _mouseHeld; /** A context open was requested while the mouse button was still down. */ private _openOnRelease; connectedCallback(): void; disconnectedCallback(): void; firstUpdated(): void; updated(changedProperties: Map): void; private _updatePosition; private _propagateContext; private _handleSlotChange; private _handleTriggerSlotChange; private _handleContextTargetSlotChange; get isOpen(): boolean; openMenu(): void; closeMenu(): void; focusTrigger(): void; private _openMenu; private _handlePopoverToggle; private _closeMenu; private _handleTriggerClick; private _handleClickOutside; private _getMenuContainer; private _handleKeydown; /** * Return focus after a keyboard close. The trigger button is the natural * target, but it is not rendered for a context target — then fall back to * whatever was focused at open (don't rely on the browser's popover focus * restoration), and finally the host. */ private _restoreFocus; private _handleCommand; private _handleRadioChange; private _handlePointerDown; private _removeReleaseListeners; /** * End of a mouse press. If a context open was deferred, open after the * release has been fully dispatched, so popover light-dismiss (which * evaluates the pointerup) does not immediately close the new popover. */ private _handleRelease; /** * Opens the menu at a client point. For hosts that decide for themselves * when a context menu applies (e.g. a canvas whose right-click target is a * node, a wire or the background) and so can't use `mode="context"`'s own * context-target. Call it from the host's `contextmenu` handler; if the * mouse button is still down (macOS fires `contextmenu` on mousedown), wait * for the release first, as `mode="context"` does. */ openAt(clientX: number, clientY: number): void; private _handleContextMenu; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-trigger': MenuTrigger; } } declare class MenuItem extends LitElement { command: string; commandArgs: string; label: string; disabled: boolean; iconName: string; registry?: CommandRegistry; keyboardManager?: KeyboardManager; submenuPopover?: HTMLElement; private _hasChildren; private _slot; private _hoverTimeout; disconnectedCallback(): void; private _handleSlotChange; private _handleMouseEnter; private _handleMouseLeave; private _showSubmenu; private _hideSubmenu; private handleClick; private _resolvedLabel; private _resolvedIcon; willUpdate(changedProperties: Map): void; updated(changedProperties: Map): void; private _getShortcut; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-item': MenuItem; } } export type SplitButtonMode = `default` | `switcher`; /** Fills the popover (panel or target) just before it is shown. */ export type PopoverProvider = (popover: HTMLElement) => void | Promise; export declare class SplitButton extends ButtonElement { #private; registry?: CommandRegistry; keyboardManager?: KeyboardManager; mode: SplitButtonMode; defaultValue: string; /** When set, called each time the popup is opened; its return value replaces declarative items. */ itemsProvider?: ItemsProvider; /** Directly set popup items. Ignored when itemsProvider is also set. */ items?: PopupItem[]; /** * Id of a `popover` element elsewhere in the same tree (or shadow root) that the * caret toggles instead of opening the menu, like the native `popovertarget`. * The caret is passed as the popover's `source`, so it anchors implicitly. */ popoverTarget: string; /** * Builds popover content just in time. Called each time the popover is about to be * shown (awaited if it returns a promise) with the popover element — the built-in * panel, or the `popover-target` element — so it can fill it in before it appears. * Setting this (without `popover-target`) makes the caret open the built-in panel. */ popoverProvider?: PopoverProvider; private _menuTrigger?; private _popoverPanel?; private _caretEl?; private _hasPopoverSlot; private _popoverOpen; private _selectedCommand; private _selectedLabel; private _selectedIcon; private _switcherItems; private _dynamicItems; private _loadingItems; private _menuHasItems; updated(changedProperties: Map): void; private _applyItems; /** In switcher mode, programmatically select the active command. Returns false if not found. */ selectCommand(command: string): boolean; /** Invokes the primary button action as if clicked by the user. */ invoke(): boolean; /** True when there is (or will be) popup content. Used to dim the caret visually. */ private get _caretHasContent(); /** The caret toggles a popover (slotted content, `popover-target` or `popoverProvider`) rather than the menu. */ private get _popoverMode(); private _resolvePopover; private _onPopoverSlotChange; private _onPopoverToggle; /** Show the popover (building its content first). `toggle`: hide it instead when already open. */ private _showPopover; private _onDefaultMenuSlotChange; private _onSwitcherSlotChange; private _applySwitcherItems; private _handleSwitcherMenuCommand; private _handleSwitcherPrimaryClick; private _handleCaretClick; private _openOverlay; private _handlePrimaryKeyDown; private _handleCaretKeyDown; private _handleCaretPointerDown; protected render(): import("lit").TemplateResult<1>; private _renderCaret; /** The caret with its overlay: the popover panel in popover mode, otherwise the menu trigger + menu. */ private _renderCaretArea; private _renderLoadingOrItems; private _renderDefault; private _renderSwitcher; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-split-button': SplitButton; } } export declare class Checkbox extends LitElement { #private; static styles: import("lit").CSSResult[]; checked: boolean; disabled: boolean; indeterminate: boolean; readonly: boolean; label: string; name: string; value: string; /** Focus the inner input, so the host can be focused like a native checkbox. */ focus(options?: FocusOptions): void; render(): ReturnType; } export type CheckboxChangeDetail = { readonly checked: boolean; }; export type CheckboxChangeEvent = CustomEvent; declare global { interface HTMLElementTagNameMap { 'ixfx-checkbox': Checkbox; } } export interface CheckboxEventMap { change: CheckboxChangeEvent; } export interface Checkbox { addEventListener: ((type: K, listener: (this: Checkbox, event: CheckboxEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } type CheckState = `true` | `false` | `indeterminate`; type CheckedSelectItem = { readonly value: string; readonly label: string; readonly checked: CheckState; }; type ItemDisplay = `checkbox` | `text`; type ItemOrientation = `horizontal` | `vertical`; export declare class CheckedSelect extends LitElement { #private; static styles: import("lit").CSSResult[]; items: readonly CheckedSelectItem[]; multiline: boolean; /** At-rest checkboxes are display-only; clicking them just opens the popup. (Not `inert`: that native attribute would block the whole element.) */ itemsInert: boolean; /** How at-rest items are shown: as `checkbox`es, or as comma-separated `text`. */ itemDisplay: ItemDisplay; /** Direction the resting items flow: `horizontal` (default) or `vertical` (one per row). */ orientation: ItemOrientation; placeholder: string; disabled: boolean; private _open; private _draft; private _order; private _size; get isOpen(): boolean; disconnectedCallback(): void; willUpdate(changed: PropertyValues): void; open(): Promise; commit(): void; cancel(): void; protected render(): import("lit").TemplateResult<1>; } export type CheckedSelectChangeDetail = { /** Every item, with its committed state. */ readonly items: readonly CheckedSelectItem[]; /** Only the items whose state changed. */ readonly changed: readonly CheckedSelectItem[]; }; export type CheckedSelectChangeEvent = CustomEvent; declare global { interface HTMLElementTagNameMap { 'ixfx-checked-select': CheckedSelect; } } export interface CheckedSelectEventMap { change: CheckedSelectChangeEvent; } export interface CheckedSelect { addEventListener: ((type: K, listener: (this: CheckedSelect, event: CheckedSelectEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } /** * OKLCH colour value representation */ type OklchValue = { readonly l: number; readonly c: number; readonly h: number; readonly a?: number; readonly unit: `scalar`; readonly space: `oklch`; }; /** * Event detail for colour picker input/change events */ type ColourPickerEventDetail = OklchValue; /** * Colour picker custom events */ type ColourPickerInputEvent = CustomEvent; type ColourPickerChangeEvent = CustomEvent; type Range = readonly [number, number]; type RangeInput$1 = readonly [number, number] | readonly number[]; /** * Augment HTMLElementTagNameMap for the custom element */ declare global { interface HTMLElementTagNameMap { 'ixfx-colour-picker': ColourPicker; } } /** * An angle with unit. * - [Degrees](https://en.wikipedia.org/wiki/Degree_(angle)): 0..360 * - [Radians](https://en.wikipedia.org/wiki/Radian): 0...2Pi * - [Gradians](https://en.wikipedia.org/wiki/Gradian): 0..400 * - [Turns](https://en.wikipedia.org/wiki/Turn_(angle)): 0..1 * * * ``` * 100 grad * 1/4 turn * 90 deg * PI/2 rad * | * Pi rad | 0 or 2PI rad * 180deg -------+------- 0 or 360 deg * 1/2 turn | 0 or 1 turn * 200 grad | 0 or 400 grad * | * 270 deg * 3PI/2 rad * 3/4 turn * 300 grad * ``` */ type Angle = { value: number; unit: `deg` | `rad` | `turn` | `grad`; }; type ResultOk = { success: true; value: TValue; info?: string; }; type ResultError = { success: false; error: TError; info?: string; }; type Result$1 = ResultOk | ResultError; //#region src/types.d.ts /** * Key-value pairs in an array * @see {@link ObjectKeys} */ type ArrayKeys = readonly (readonly [key: K, value: V])[]; /** * Key-value pairs in object form * @see {@link ArrayKeys} */ type ObjectKeys = readonly { readonly key: K; readonly value: V; }[]; /** * Type that represents key-values in object or array form */ type EitherKey = ArrayKeys | ObjectKeys; /** * A table value or _undefined_ */ type TableValue = V | undefined; /** * A row of table values */ type TableRow = TableValue[]; //#endregion //#region src/map/imap-base.d.ts interface IMapBase { /** * Gets an item by key * @example * ```js * const item = map.get(`hello`); * ``` * @param key */ get(key: K): V | undefined; /** * Returns _true_ if map contains key * @example * ```js * if (map.has(`hello`)) ... * ``` * @param key */ has(key: K): boolean; /** * Returns _true_ if map is empty */ isEmpty(): boolean; /** * Iterates over entries (consisting of [key,value]) * @example * ```js * for (const [key, value] of map.entries()) { * // Use key, value... * } * ``` */ entries(): IterableIterator; values(): IterableIterator; } //#endregion //#region src/map/map.d.ts /** * An immutable map. Rather than changing the map, functions like `add` and `delete` * return a new map reference which must be captured. * * Immutable data is useful because as it gets passed around your code, it never * changes from underneath you. You have what you have. * * @example * ```js * let m = map(); // Create * let m2 = m.set(`hello`, `samantha`); * // m is still empty, only m2 contains a value. * ``` * * @typeParam K - Type of map keys. Typically `string` * @typeParam V - Type of stored values */ interface IMapImmutable extends IMapBase { /** * Adds one or more items, returning the changed map. * * Can add items in the form of `[key,value]` or `{key, value}`. * @example These all produce the same result * ```js * map.set(`hello`, `samantha`); * map.add([`hello`, `samantha`]); * map.add({key: `hello`, value: `samantha`}) * ``` * @param itemsToAdd */ add: (...itemsToAdd: EitherKey) => IMapImmutable; /** * Deletes an item by key, returning the changed map * @param key */ delete: (key: K) => IMapImmutable; /** * Returns an empty map */ clear: () => IMapImmutable; /** * Sets `key` to be `value`, overwriting anything existing. * Returns a new map with added key. * @param key * @param value */ set: (key: K, value: V) => IMapImmutable; } //#region src/table.d.ts /** * Stores values in a table of rows (vertical) and columns (horizontal) */ declare class Table { #private; rows: TableRow[]; rowLabels: string[]; colLabels: string[]; /** * Keep track of widest row */ columnMaxLength: number; /** * Gets the label for a given column index, * returning _undefined_ if not found. * * Case-sensitive * @param label Label to seek * @returns Index of column, or _undefined_ if not found */ getColumnLabelIndex(label: string): number | undefined; /** * Gets the label for a given row index, * returning _undefined_ if not found. * * Case-sensitive * @param label Label to seek * @returns Index of row, or _undefined_ if not found */ getRowLabelIndex(label: string): number | undefined; /** * Dumps the values of the table to the console */ print(): void; /** * Return a copy of table as nested array * * ```js * const t = new Table(); * // add stuff * // ... * const m = t.asArray(); * for (const row of m) { * for (const colValue of row) { * // iterate over all column values for this row * } * } * ``` * * Alternative: get value at row Y and column X * ```js * const value = m[y][x]; * ``` * @returns */ asArray(): (V | undefined)[][]; /** * Return the number of rows */ get rowCount(): number; /** * Return the maximum number of columns in any row */ get columnCount(): number; /** * Iterates over the table row-wise, in object format. * @see {@link rowsWithLabelsArray} to get rows in array format */ rowsWithLabelsObject(): Generator; /** * Iterates over each row, including the labels if available * @see {@link rowsWithLabelsObject} to get rows in object format */ rowsWithLabelsArray(): Generator<[label: string | undefined, value: V | undefined][] | undefined, void, unknown>; /** * Assign labels to columns * @param labels */ labelColumns(...labels: string[]): void; /** * Assign label to a specific column * First column has an index of 0 * @param columnIndex * @param label */ labelColumn(columnIndex: number, label: string): void; /** * Label rows * @param labels Labels */ labelRows(...labels: string[]): void; /** * Assign label to a specific row * First row has an index of 0 * @param rowIndex * @param label */ labelRow(rowIndex: number, label: string): void; /** * Adds a new row * @param data Columns */ appendRow(...data: TableValue[]): TableRow; /** * Gets a row along with labels, as an array * @param rowIndex * @returns */ getRowWithLabelsArray(rowIndex: number): [label: string | undefined, value: V | undefined][] | undefined; /** * Return a row of objects. Keys use the column labels. * * ```js * const row = table.getRowWithLabelsObject(10); * // eg: * // [{ colour: red, size: 10}, { colour: blue, size: 20 }] * ``` * @param rowIndex * @returns */ getRowWithLabelsObject(rowIndex: number): object | undefined; /** * Gets a copy of values at given row, specified by index or label * @param row * @returns Returns row or throws an error if label or index not found */ row(row: number | string): readonly (V | undefined)[] | undefined; /** * Set the value of row,columm. * Row is created if it doesn't exist, with the other column values being _undefined_ * @param row Index or label * @param column Column * @param value Value to set at row,column */ set(row: number | string, column: number | string, value: V | undefined): void; /** * Gets the value at a specified row and column. * Throws an error if coordinates are out of range or missing. * @param row Row index or label * @param column Column index or label * @returns */ get(row: number | string, column: number | string): TableValue; /** * Set all the columns of a row to a specified value. * * By default, sets the number of columns corresponding to * the table's maximum column length. To set an arbitrary * length of the row, use `length` * @param row Index or label of row * @param length How wide the row is. If unset, uses the current maximum width of rows. * @param value Value to set */ setRow(row: number | string, value: V | undefined, length?: number): TableRow; } //#endregion //#region src/graph/directed-graph-data.d.ts /** * Applies many changes to a graph at once, copying the underlying data at most once. * * Normally each change (eg. {@link connect}) copies the whole vertex map, which is O(V). * Building a graph edge-by-edge is therefore O(V·E). Inside `withMutations` each change is O(1). * * The callback gets a _draft_ graph and must return the final graph. * Use the normal graph functions on the draft and keep the graph each one returns. * * ```js * const g2 = withMutations(g, draft => { * for (const [from, to] of pairs) { * draft = connect(draft, { from, to }); * } * return draft; * }); * ``` * * Caveats: * Inside the callback, intermediate graphs share storage, so an earlier reference * _will_ see later changes. Don't keep intermediate graphs around. * Using the draft after `withMutations` returns throws an error. * `graph` itself is never modified. * If nothing is changed, `graph` is returned. * Calling `withMutations` on a draft (ie. nested) runs `fn` directly on that draft. * @param graph Starting graph * @param fn Callback that changes and returns the draft * @returns New, immutable graph */ declare function withMutations(graph: DirectedGraph, fn: (draft: DirectedGraph) => DirectedGraph): DirectedGraph; /** * Plain-data form of an {@link Edge} */ type EdgeJson = { id: string; weight?: number; }; /** * Plain-data form of a {@link DirectedGraph}. * Safe to use with `JSON.stringify`, `structuredClone` and `postMessage`. */ type DirectedGraphJson = { vertices: Array<{ id: string; out: EdgeJson[]; }>; }; /** * Returns the graph as plain data, suitable for `JSON.stringify`, * `structuredClone` or `postMessage`. Use {@link fromJson} to get a graph back. * * Vertex order is preserved. `weight` is omitted when not set. * * ```js * const text = JSON.stringify(toJson(g)); * const g2 = fromJson(JSON.parse(text)); * ``` * @param graph Graph */ declare function toJson(graph: DirectedGraph): DirectedGraphJson; /** * Creates a graph from the plain-data form produced by {@link toJson}. * * Input is validated, since it typically comes from `JSON.parse` or `postMessage`. * Throws if a vertex id appears twice, or ids/weights are of the wrong type * Edges to ids that aren't listed as vertices create those vertices (as {@link connect} does) * Duplicate edges between the same pair of vertices are collapsed, keeping the first * @param json Plain-data graph */ declare function fromJson(json: DirectedGraphJson): DirectedGraph; //#endregion //#region src/graph/directed-graph-reach.d.ts /** * Iterates over vertices which have an edge to `idOrVertex`. * * This scans every vertex, so it is O(V+E). * If you need incoming edges for many vertices, use {@link transpose} once instead. * * ```js * const g = graph({ from: `a`, to: `c` }, { from: `b`, to: `c` }); * [...incoming(g, `c`)].map(v => v.id); // [`a`, `b`] * ``` * @param graph Graph * @param idOrVertex Vertex to find incoming edges for. Throws if id is not found. */ declare function incoming(graph: DirectedGraph, idOrVertex: string | Vertex$1): Generator; /** * Returns the number of edges pointing at `idOrVertex`. O(V+E) * @param graph Graph * @param idOrVertex Vertex. Throws if id is not found. */ declare function inDegree(graph: DirectedGraph, idOrVertex: string | Vertex$1): number; /** * Iterates over every vertex reachable from `idOrVertex` by following edges forwards. * * The start vertex is only included if it is on a cycle (ie. it can reach itself). * Vertices are yielded in breadth-first order. * @param graph Graph * @param idOrVertex Start vertex. Throws if id is not found. */ declare function descendants(graph: DirectedGraph, idOrVertex: string | Vertex$1): Generator; /** * Iterates over every vertex that can reach `idOrVertex` by following edges. * * The vertex itself is only included if it is on a cycle (ie. it can reach itself). * Vertices are yielded in breadth-first order, nearest first. * * Builds a reverse index once, so it is O(V+E). * @param graph Graph * @param idOrVertex Target vertex. Throws if id is not found. */ declare function ancestors(graph: DirectedGraph, idOrVertex: string | Vertex$1): Generator; /** * Returns _true_ if `to` can be reached from `from` by following edges. * * A vertex always has a (zero-length) path to itself, so `hasPath(g, a, a)` is _true_. * A useful consequence: adding the edge `from -> to` creates a cycle exactly when `hasPath(g, to, from)`. * * ```js * if (hasPath(g, to, from)) { * // connecting from->to would make a cycle * } * ``` * @param graph Graph * @param from Start vertex. Throws if not found. * @param to Destination vertex. Throws if not found. */ declare function hasPath(graph: DirectedGraph, from: string | Vertex$1, to: string | Vertex$1): boolean; /** * Returns a new graph with every edge reversed. Weights are kept. * All vertices are kept, including those without edges. * * ```js * const g = graph({ from: `a`, to: `b` }); * const t = transpose(g); // b -> a * ``` * @param graph Graph */ declare function transpose(graph: DirectedGraph): DirectedGraph; declare namespace directed_graph_d_exports { export { ConnectOptions$1 as ConnectOptions, DirectedGraph, DirectedGraphJson, DistanceCompute, Edge$1 as Edge, EdgeJson, Vertex$1 as Vertex, adjacentVertices$1 as adjacentVertices, ancestors, areAdjacent, bfs, clone, connect$1 as connect, connectTo$1 as connectTo, connectWithEdges$1 as connectWithEdges, createVertex$1 as createVertex, descendants, dfs, disconnect, distance, distanceDefault, dumpGraph$1 as dumpGraph, edges, fromJson, get, getCycles, getOrCreate$1 as getOrCreate, getOrFail, graph$2 as graph, graphFromVertices, hasKey, hasNoOuts, hasOnlyOuts, hasOut, hasPath, inDegree, incoming, isAcyclic, pathDijkstra, removeVertex, toAdjacencyMatrix$1 as toAdjacencyMatrix, toJson, topologicalSort, topologicalSortTry, transitiveReduction, transpose, updateGraphVertex$1 as updateGraphVertex, vertexHasOut, vertices, withMutations }; } type DistanceCompute = (graph: DirectedGraph, edge: Edge$1) => number; /** * Vertex. These are the _nodes_ of the graph. Immutable. * * They keep track of all of their outgoing edges, and * a unique id. * * Ids are used for accessing/updating vertices as well as in the * {@link Edge} type. They must be unique. */ type Vertex$1 = Readonly<{ out: readonly Edge$1[]; id: string; }>; /** * Edge. Immutable. * * Only encodes the destination vertex. The from * is known since edges are stored on the from vertex. */ type Edge$1 = Readonly<{ /** * Vertex id edge connects to (ie. destination) */ id: string; /** * Optional weight of edge */ weight?: number; }>; /** * Create a vertex with given id * @param id * @returns */ declare function createVertex$1(id: string): Vertex$1; /** * Options for connecting vertices */ type ConnectOptions$1 = Readonly<{ /** * From, or source of connection */ from: string; /** * To, or destination of connection. Can be multiple vertices for quick use */ to: string | string[]; /** * If true, edges in opposite direction are made as well */ bidi?: boolean; /** * Weight for this connection (optional) */ weight?: number; }>; /** * Directed graph. Immutable. * * Consists of {@link Vertex|vertices}, which all have zero or more outgoing {@link Edge|Edges}. */ type DirectedGraph = Readonly<{ vertices: IMapImmutable; }>; /** * Returns _true_ if graph contains `key`. * * ```js * // Same as * g.vertices.has(key) * ``` * @param graph * @param key * @returns */ declare function hasKey(graph: DirectedGraph, key: string): boolean; /** * Returns {@link Vertex} under `key`, or _undefined_ * if not found. * * ```js * // Same as * g.vertices.get(key) * ``` * @param graph * @param key * @returns */ declare function get(graph: DirectedGraph, key: string): Vertex$1 | undefined; /** * Returns the graph connections as an adjacency matrix * @param graph * @returns */ declare function toAdjacencyMatrix$1(graph: DirectedGraph): Table; /** * Return a string representation of the graph for debug inspection * @param graph * @returns */ declare function dumpGraph$1(graph: DirectedGraph | Iterable): string; /** * Returns the weight of an edge, or 1 if undefined. * @param graph * @param edge * @returns */ declare function distance(graph: DirectedGraph, edge: Edge$1): number; /** * Iterate over all the edges in the graph * @param graph */ declare function edges(graph: DirectedGraph): Generator, void, unknown>; /** * Iterate over all the vertices of the graph * @param graph */ declare function vertices(graph: DirectedGraph): Generator, void, unknown>; /** * Iterate over all the vertices connected to `context` vertex * @param graph Graph * @param context id or Vertex. * @returns */ declare function adjacentVertices$1(graph: DirectedGraph, context: Vertex$1 | string | undefined): Generator, void, unknown>; /** * Returns _true_ if `vertex` has an outgoing connection to * the supplied id or vertex. * * If `vertex` is undefined, _false_ is returned. * @param vertex From vertex * @param outIdOrVertex To vertex * @returns */ declare function vertexHasOut(vertex: Vertex$1, outIdOrVertex: string | Vertex$1): boolean; /** * Returns _true_ if `vertex` has no outgoing connections * @param graph * @param vertex * @returns */ declare function hasNoOuts(graph: DirectedGraph, vertex: string | Vertex$1): boolean; /** * Returns _true_ if `vertex` only has the given list of vertices. * Returns _false_ early if the length of the list does not match up with `vertex.out` * @param graph * @param vertex * @param outIdOrVertex * @returns */ declare function hasOnlyOuts(graph: DirectedGraph, vertex: string | Vertex$1, ...outIdOrVertex: Array): boolean; /** * Returns _true_ if `vertex` has an outgoing connection to the given vertex. * @param graph * @param vertex * @param outIdOrVertex * @returns */ declare function hasOut(graph: DirectedGraph, vertex: string | Vertex$1, outIdOrVertex: string | Vertex$1): boolean; /** * Gets a vertex by id, creating it if it does not exist. * @param graph * @param id * @returns */ declare function getOrCreate$1(graph: DirectedGraph, id: string): Readonly<{ graph: DirectedGraph; vertex: Vertex$1; }>; /** * Gets a vertex by id, throwing an error if it does not exist * @param graph * @param id * @returns */ declare function getOrFail(graph: DirectedGraph, id: string): Vertex$1; /** * Updates a vertex by returning a mutated graph * @param graph Graph * @param vertex Newly changed vertex * @returns */ declare function updateGraphVertex$1(graph: DirectedGraph, vertex: Vertex$1): DirectedGraph; /** * Default distance computer. Uses `weight` property of edge, or `1` if not found. * @param graph * @param edge * @returns */ declare function distanceDefault(graph: DirectedGraph, edge: Edge$1): number; /** * Returns a mutation of `graph`, with a given edge removed. * * If edge was not there, original graph is returned. * @param graph * @param from * @param to * @returns */ declare function disconnect(graph: DirectedGraph, from: string | Vertex$1, to: string | Vertex$1): DirectedGraph; /** * Returns a mutation of `graph` with a vertex removed, along with * every edge pointing at it. * * If the vertex is not in the graph, the original graph is returned. * ```js * g = removeVertex(g, `b`); * ``` * @param graph Graph * @param idOrVertex Id or vertex to remove * @returns */ declare function removeVertex(graph: DirectedGraph, idOrVertex: string | Vertex$1): DirectedGraph; /** * Make a connection between two vertices with a given weight. * It returns the new graph as wll as the created edge. * @param graph * @param from * @param to * @param weight * @returns */ declare function connectTo$1(graph: DirectedGraph, from: string, to: string, weight?: number): { graph: DirectedGraph; edge: Edge$1; }; /** * Connect from -> to. Same as {@link connectWithEdges}, but this version just returns the graph. * * By default unidirectional, meaning a connection is made only from->to. Use `bidi` option to set a bidirection connection, adding also to->from. * * Returns a result of `{ graph, edges }`, where `graph` is the new {@link DirectedGraph} and `edges` * is an array of {@link Edge Edges}. One for unidirectional, or two for bidirectional. * @param graph * @param options * @returns */ declare function connect$1(graph: DirectedGraph, options: ConnectOptions$1): DirectedGraph; /** * Connect from -> to. Same as {@link connect} except you get back the edges as well. * * By default unidirectional, meaning a connection is made only from->to. Use `bidi` option to set a bidirection connection, adding also to->from. * * Returns a result of `{ graph, edges }`, where `graph` is the new {@link DirectedGraph} and `edges` * is an array of {@link Edge Edges}. One for unidirectional, or two for bidirectional. * @param graph * @param options * @returns */ declare function connectWithEdges$1(graph: DirectedGraph, options: ConnectOptions$1): { graph: DirectedGraph; edges: Edge$1[]; }; /** * Returns _true_ if a->b or b->a * @param graph * @param a * @param b * @returns */ declare function areAdjacent(graph: DirectedGraph, a: Vertex$1, b: Vertex$1): true | undefined; /** * Iterates over vertices from a starting vertex in an bread-first-search * @param graph * @param startIdOrVertex * @param targetIdOrVertex * @returns */ declare function bfs(graph: DirectedGraph, startIdOrVertex: string | Vertex$1, targetIdOrVertex?: string | Vertex$1): Generator, void, unknown>; /** * Iterates over vertices from a starting vertex in an depth-first-search * @param graph * @param startIdOrVertex */ declare function dfs(graph: DirectedGraph, startIdOrVertex: string | Vertex$1): Generator, void, unknown>; /** * Compute shortest distance from the source vertex to the rest of the graph. * @param graph * @param sourceOrId * @returns */ declare function pathDijkstra(graph: DirectedGraph, sourceOrId: Vertex$1 | string): { distances: Map; previous: Map | null>; pathTo: (id: string) => Edge$1[]; }; /** * Clones the graph. Uses shallow clone, because it's all immutable * @param graph * @returns */ declare function clone(graph: DirectedGraph): DirectedGraph; /** * Create a graph * ```js * let g = graph(); * ``` * * Can optionally provide initial connections: * ```js * let g = graph( * { from: `a`, to: `b` }, * { from: `b`, to: `c` } * ) * ``` * @param initialConnections * @returns */ declare function graph$2(...initialConnections: ConnectOptions$1[]): DirectedGraph; /** * Returns _true_ if the graph contains is acyclic - that is, it has no loops * @param graph */ declare function isAcyclic(graph: DirectedGraph): boolean; /** * Topological sort using Kahn's algorithm. * Returns a new graph that is sorted. * * Throws an error if the graph contains cycles. * Use {@link topologicalSortTry} to get the cycles back instead of an error. * @param graph */ declare function topologicalSort(graph: DirectedGraph): DirectedGraph; /** * Topological sort using Kahn's algorithm, without throwing. * * On success, `value` is a new graph with vertices in topological order. * If the graph has cycles, `error` contains them (in the same form as {@link getCycles}). * * Useful when cycles are expected to be temporary, for example while * someone is rewiring a graph in an editor. * ```js * const r = topologicalSortTry(g); * if (r.success) { * // r.value is the sorted graph * } else { * // r.error is Vertex[][], one array per cycle * } * ``` * @param graph */ declare function topologicalSortTry(graph: DirectedGraph): Result$1; /** * Create a graph from an iterable of vertices * @param vertices * @returns */ declare function graphFromVertices(vertices: Iterable): DirectedGraph; /** * Get all the cycles ('strongly-connected-components') within the graph * [Read more](https://en.wikipedia.org/wiki/Strongly_connected_component) * @param graph * @returns */ declare function getCycles(graph: DirectedGraph): Vertex$1[][]; /** * Returns a new graph which is transitively reduced. * That is, redundant edges are removed * @param graph * @returns */ declare function transitiveReduction(graph: DirectedGraph): Readonly<{ vertices: IMapImmutable; }>; declare namespace undirected_graph_d_exports { export { ConnectOptions, Edge, Graph, Vertex, adjacentVertices, connect, connectTo, connectWithEdges, createVertex, dumpGraph, edgesForVertex, getConnection, getOrCreate, graph$1 as graph, hasConnection, toAdjacencyMatrix, updateGraphVertex }; } type Vertex = Readonly<{ id: string; }>; type Edge = Readonly<{ a: string; b: string; weight?: number; }>; type Graph = Readonly<{ edges: readonly Edge[]; vertices: IMapImmutable; }>; type ConnectOptions = Readonly<{ a: string; b: string | string[]; weight?: number; }>; declare function createVertex(id: string): Vertex; declare function updateGraphVertex(graph: Graph, vertex: Vertex): Graph; declare function getOrCreate(graph: Graph, id: string): Readonly<{ graph: Graph; vertex: Vertex; }>; /** * Returns _true/false_ if there is a connection between `a` and `b` in `graph`. * Use {@link getConnection} if you want to the edge. * @param graph Graph to search * @param a * @param b * @returns _true_ if edge exists */ declare function hasConnection(graph: Graph, a: string | Vertex, b: string | Vertex): boolean; /** * Gets the connection, if it exists between `a` and `b` in `graph`. * If it doesn't exist, _undefined_ is returned. * Use {@link hasConnection} for a simple true/false if edge exists. * @param graph Graph * @param a * @param b * @returns */ declare function getConnection(graph: Graph, a: string | Vertex, b: string | Vertex): Edge | undefined; /** * Connects A with B, returning the changed graph and created edge. * If the connection already exists, the original graph & edge is returned. * @param graph * @param a * @param b * @param weight * @returns */ declare function connectTo(graph: Graph, a: string, b: string, weight?: number): { graph: Graph; edge: Edge; }; /** * Makes a connection between `options.a` and one or more nodes in `options.b`. * Same as {@link connectWithEdges} but only the {@link Graph} is returned. * * ```js * let g = graph(); // Create an empty graph * // Make a connection between `red` and `orange` * g = connect(g, { a: `red`, b: `orange` }); * * // Make a connection between `red` and `orange as well as `red` and `yellow`. * g = connect(g, { a: `red`, b: [`orange`, `yellow`] }) * ``` * @param graph Initial graph * @param options Options */ declare function connect(graph: Graph, options: ConnectOptions): Graph; /** * Makes a connection between `options.a` and one or more nodes in `options.b`. * Same as {@link connect} but graph and edges are returned. * * ```js * let g = graph(); // Create an empty graph * * // Make a connection between `red` and `orange` * result = connectWithEdges(g, { a: `red`, b: `orange` }); * * // Make a connection between `red` and `orange as well as `red` and `yellow`. * result = connectWithEdges(g, { a: `red`, b: [`orange`, `yellow`] }) * ``` * @param graph Initial graph * @param options Options */ declare function connectWithEdges(graph: Graph, options: ConnectOptions): { graph: Graph; edges: Edge[]; }; declare function graph$1(...initialConnections: ConnectOptions[]): Graph; declare function toAdjacencyMatrix(graph: Graph): Table; /** * Return a string representation of the graph for debug inspection * @param graph * @returns */ declare function dumpGraph(graph: Graph): string; /** * Iterate over all the vertices connectd to `context` vertex * * If `context` is _undefined_, returns nothing * @param graph Graph * @param context id or Vertex * @returns */ declare function adjacentVertices(graph: Graph, context: Vertex | string | undefined): Generator, void, unknown>; /** * Get all the edges for a vertex. * * ```js * // Iterate all edges for vertex with id '0' * for (const edge of edgesForVertex(graph, '0')) { * } * ``` * * If the vertex has no edges, no values are returned. If the vertex was not found in the graph, an error is thrown. * @throws Throws an error if `context` was not found, if it's _undefined_ or `graph` is invalid. * @param graph * @param context * @returns */ declare function edgesForVertex(graph: Graph, context: Vertex | string | undefined): Generator, void, unknown>; declare namespace dependency_graph_d_exports { export { CalcResult, CalcState, DependencyGraph, Formula, addDependency, addNode, allDependents, allPrecedents, calc, calculationOrder, dependentsOf, getValue, graph, precedentsOf, recalculationOrder, removeDependency, rootsOf, setFormula, setPrecedents, setValue, wouldCycle }; } /** * Excel-style dependency tracking, built on {@link Directed.DirectedGraph}. * * Edge direction follows the flow of data: an edge `a -> b` means * "b depends on a" (a is a _precedent_ of b; b is a _dependent_ of a). * * Terminology: * _precedents_: nodes a node reads from (Excel: "trace precedents") * _dependents_: nodes that read from a node (Excel: "trace dependents") * _inputs_: nodes with no precedents (the constants of a spreadsheet) * * All functions are pure; they return new graphs/states rather than mutating. */ /** * A dependency graph is just a directed graph with data-flow edges. */ type DependencyGraph = DirectedGraph; /** * Create a dependency graph. * Initial entries are `[ node, [ ...precedents ] ]` * @example * ```js * // c = a + b * const g = Dependencies.graph([`c`, [`a`, `b`]]); * ``` */ declare function graph(...initial: ReadonlyArray): DependencyGraph; /** * Ensures a node exists, with no dependencies. */ declare const addNode: (g: DependencyGraph, id: string) => DependencyGraph; /** * Direct precedents of `id` (nodes it reads from), in graph order. * Returns an empty array for unknown nodes. */ declare function precedentsOf(g: DependencyGraph, id: string): string[]; /** * Direct dependents of `id` (nodes that read from it). * Returns an empty array for unknown nodes. */ declare function dependentsOf(g: DependencyGraph, id: string): string[]; /** * All nodes that transitively depend on `id` (Excel: trace dependents). * Does not include `id` itself. */ declare function allDependents(g: DependencyGraph, id: string): Set; /** * All nodes that `id` transitively depends on (Excel: trace precedents). * Does not include `id` itself. */ declare function allPrecedents(g: DependencyGraph, id: string): Set; /** * Returns the _inputs_ that a derived value ultimately rests on: the * precedents with no precedents of their own. This is where calculation * "starts" when tracing back a derived value. * * If `id` itself has no precedents, it is its own root. */ declare function rootsOf(g: DependencyGraph, id: string): string[]; /** * Returns true if making `node` depend on `precedent` would create a cycle * (ie. a circular reference). */ declare function wouldCycle(g: DependencyGraph, node: string, precedent: string): boolean; /** * Declares that `node` depends on `precedent`. * Throws if this would create a circular reference. */ declare function addDependency(g: DependencyGraph, node: string, precedent: string): DependencyGraph; /** * Removes the dependency of `node` on `precedent`. Nodes are retained. */ declare function removeDependency(g: DependencyGraph, node: string, precedent: string): DependencyGraph; /** * Replaces the precedents of `node` wholesale (as when a formula is edited). * Throws on circular references, leaving the original graph untouched. */ declare function setPrecedents(g: DependencyGraph, node: string, precedents: readonly string[]): DependencyGraph; /** * The order in which to recalculate after `changed` nodes have new values: * every transitive dependent, each after all its precedents. * Does not include `changed` themselves (they already have their values), * unless one changed node depends on another. */ declare function recalculationOrder(g: DependencyGraph, changed: readonly string[]): string[]; /** * The order in which to calculate `target`: all its transitive precedents * (inputs first), then `target` itself. Everything outside this is irrelevant to it. */ declare function calculationOrder(g: DependencyGraph, target: string): string[]; /** * Function computing a node's value. `get` reads the current value of a * precedent (which must have been declared as a precedent). */ type Formula = (get: (id: string) => V | undefined) => V; /** * Immutable calculation state: a graph, node formulas and cached values. * Nodes without a formula are inputs, whose values are set directly. */ type CalcState = Readonly<{ graph: DependencyGraph; formulas: ReadonlyMap>; values: ReadonlyMap; /** * Equality used for early cut-off: if a recomputed value equals * the old one, its dependents are not recomputed. Default `Object.is` */ equals: (a: V, b: V) => boolean; }>; /** * Result of a state change: the new state and which nodes were * actually recomputed (in order). Inputs set directly are not included. */ type CalcResult = Readonly<{ state: CalcState; recalculated: readonly string[]; }>; /** * Create an empty calculation state */ declare function calc(equals?: (a: V, b: V) => boolean): CalcState; /** * Read the cached value of a node */ declare const getValue: (state: CalcState, id: string) => V | undefined; /** * Set the value of an input node. Dependents recompute only if * the value differs from the previous one, and only down paths where * values actually change. * * Throws if `id` has a formula. */ declare function setValue(state: CalcState, id: string, value: V): CalcResult; /** * Define (or redefine) a node as derived: `formula` reads from `precedents`. * The node is calculated immediately, and dependents are updated as needed. * * Throws on circular references, leaving the original state valid. */ declare function setFormula(state: CalcState, id: string, precedents: readonly string[], formula: Formula): CalcResult; declare namespace index_d_exports$2 { export { dependency_graph_d_exports as Dependencies, directed_graph_d_exports as Directed, undirected_graph_d_exports as Undirected }; } /** * Traversable Tree. * * Creatable from: * {@link Trees.FromObject.asDynamicTraversable}: Create based on dynamic reading of an object * {@link Trees.TraversableTree}: Create based on an {@link Trees.TreeNode}, a {@link Trees.TraversableTree} or an object (same as calling asDynamicTraversable). * Use {@link Trees.isTraversable} to check if an object is this type. */ type TraversableTree = { /** * Direct children of node */ children: () => IterableIterator>; /** * Direct parent of node */ getParent: () => TraversableTree | undefined; /** * Value of node */ getValue: () => TValue; /** * Object reference that acts as the identity of the node */ getIdentity: () => any; }; //#region src/types.d.ts /** * A random source. * * Predefined sources: Math.random, {@link gaussianSource}, {@link weightedSource} */ type RandomSource = () => number; //#region src/colour/types.d.ts type HslBase = { /** * Hue */ h: number; /** * Saturation */ s: number; /** * Lightness */ l: number; /** * Opacity */ opacity?: number; space?: `hsl`; }; /** * [YCbCr format](https://en.wikipedia.org/wiki/YCbCr) */ type YCbCrBase = { /** * Luma */ y: number; /** * Blue difference */ cb: number; /** * Red difference */ cr: number; /** * Opacity */ opacity?: number; space?: `ycbcr`; }; /** * Scalar values use 0..1 for each field */ type YCbCrScalar = YCbCrBase & { unit: `scalar`; }; /** * Absolute colour use 0..255 for each field */ type YCbCr8bit = YCbCrBase & { unit: `8bit`; }; /** * [YCbCr format](https://en.wikipedia.org/wiki/YCbCr). * * By default assumes scalar coordinates (0..1) for each field. * Use '8bit' unit for 0..255 ranged values. */ type YCbCr = YCbCrScalar | YCbCr8bit; type ColourSpaces = `srgb` | `hsl` | `oklch` | `ycbcr`; /** * Scalar values use 0..1 for each field */ type HslScalar = HslBase & { unit: `scalar`; }; /** * Absolute values use hue:0..360, all other fields 0..100 */ type HslAbsolute = HslBase & { unit: `absolute`; }; /** * HSL value. * By default assumes scalar coordinates (0..1) for each field. * Use 'absolute' unit for hue:0...360, all other fields on 0..100 scale. */ type Hsl = HslScalar | HslAbsolute; /** * Rgb. * Units determine how to interperet rgb values. * 'scalar': 0..1 range for RGB & opacity * '8bit': 0..255 range for RGB & opacity */ type RgbBase = { r: number; g: number; b: number; opacity?: number; space?: `srgb`; }; type RgbScalar = RgbBase & { unit: `scalar`; }; /** * RGB in 0...255 range, including opacity. */ type Rgb8Bit = RgbBase & { unit: `8bit`; }; /** * Rgb. * Units determine how to interperet rgb values. * 'scalar': 0..1 range for RGB & opacity * '8bit': 0..255 range for RGB & opacity */ type Rgb = RgbScalar | Rgb8Bit; type LchBase = { /** * Lightness/perceived brightnes */ l: number; /** * Chroma ('amount of colour') */ c: number; /** * Hue */ h: number; /** * Opacity on 0..1 scale */ opacity?: number; space: `lch` | `oklch`; }; type ColourInterpolator = (amount: number) => T; type OkLchBase = LchBase & { space: `oklch`; }; /** * Oklch colour expressed in 0..1 scalar values for LCH & opacity */ type OkLchScalar = OkLchBase & { unit: `scalar`; }; /** * Oklch colour expressed with: * l: 0..1 * c: 0..4 * h: 0..360 degrees * opacity: 0..1 */ type OkLchAbsolute = OkLchBase & { unit: `absolute`; }; type OkLch = OkLchAbsolute | OkLchScalar; type Colour = { opacity?: number; } & (Hsl | OkLch | Rgb | YCbCr); /** * A representation of colour. Eg: `blue`, `rgb(255,0,0)`, `hsl(20,100%,50%)` */ type Colourish = Colour | string; /** * Options for interpolation */ type ColourInterpolationOpts = { direction: `longer` | `shorter`; /** * Space to do calculations in */ space: ColourSpaces; /** * Destination of calculated colour */ destination: ConvertDestinations; }; type ColourStepOpts = ColourInterpolationOpts & { /** * If set, determines total number of steps, including colour stops. * Use this _or_ `stepsBetween`. */ stepsTotal?: number; /** * If set, determines number of steps between colour stops. * Use this _or_ `stepsTotal`. */ stepsBetween?: number; }; type ParsingOptions = Partial<{ scalar: boolean; ensureSafe: boolean; /** * Value to use if input is invalid */ fallbackString: string; /** * Fallback colour to use if value cannot be parsed */ fallbackColour: T; }>; type ConvertDestinations = `hsl-scalar` | `hsl-absolute` | `oklch-scalar` | `oklch-absolute` | `srgb-8bit` | `srgb-scalar` | `ycbcr-scalar` | `ycbcr-8bit`; //#endregion //#region ../../node_modules/.pnpm/colorizr@4.0.1/node_modules/colorizr/dist/index.d.mts type ColorType = 'hex' | 'hsl' | 'oklab' | 'oklch' | 'rgb'; type HEX = `#${string}`; interface Analysis { brightnessDifference: number; colorDifference: number; compliant: number; contrast: number; largeAA: boolean; largeAAA: boolean; normalAA: boolean; normalAAA: boolean; } interface HSL { /** The alpha/opacity value (0-1). */ alpha?: number; h: number; l: number; s: number; } interface LAB { a: number; /** The alpha/opacity value (0-1). */ alpha?: number; b: number; l: number; } interface LCH { /** The alpha/opacity value (0-1). */ alpha?: number; c: number; h: number; l: number; } interface RGB { /** The alpha/opacity value (0-1). */ alpha?: number; b: number; g: number; r: number; } interface ColorizrOptions { /** * Output color format. * * If not specified, the output will use the same format as the input color. */ format?: ColorType; } declare class Colorizr { /** The alpha/opacity value (0-1). */ alpha: number; hex: HEX; hsl: HSL; oklab: LAB; oklch: LCH; rgb: RGB; type: ColorType; constructor(color: string | HSL | LAB | LCH | RGB, options?: ColorizrOptions); /** * Get CSS string */ get css(): string; /** * Get the red value */ get red(): number; /** * Get the green value */ get green(): number; /** * Get the blue value */ get blue(): number; /** * Get the hue value */ get hue(): number; /** * Get the saturation value */ get saturation(): number; /** * Get the lightness value */ get lightness(): number; /** * Get the luminance value */ get luminance(): number; /** * Get the chroma value */ get chroma(): number; get opacity(): number; /** * Get the most readable color (light or dark) for this color as a background. */ get readableColor(): string; private get currentColor(); /** * Get the brightness difference between this color and another. * * @param input - The color to compare against. * @returns The brightness difference value. */ brightnessDifference(input: string): number; /** * Get the color difference between this color and another. * * @param input - The color to compare against. * @returns The color difference value. */ colorDifference(input: string): number; /** * Test 2 colors for WCAG compliance. * * @param input - The color to compare against. * @returns Analysis object with compliance information. */ compare(input: string): Analysis; /** * Get the contrast ratio between this color and another. * * @param input - The color to compare against. * @returns The contrast ratio. */ contrast(input: string): number; /** * Format the color to a specific type. * * @param type - The color format to convert to. * @param precision - The decimal precision for the output. * @returns The formatted color string. */ format(type: ColorType, precision?: number): string; /** * Increase lightness. * * @param amount - A number between 0 and 100. * @returns The lightened color string. */ lighten(amount: number): string; /** * Decrease lightness. * * @param amount - A number between 0 and 100. * @returns The darkened color string. */ darken(amount: number): string; /** * Increase saturation. * * @param amount - A number between 0 and 100. * @returns The saturated color string. */ saturate(amount: number): string; /** * Decrease saturation. * * @param amount - A number between 0 and 100. * @returns The desaturated color string. */ desaturate(amount: number): string; /** * Convert to grayscale. * * @returns The grayscale color string. */ grayscale(): string; /** * Invert color. * * @returns The inverted color string. */ invert(): string; /** * Mix with another color. * * @param color - The color to mix with. * @param ratio - A number between 0 and 1 (0 = this color, 1 = input color). * @returns The mixed color string. */ mix(color: string, ratio?: number): string; /** * Add opacity to the color. * * @param alpha - A number between 0 and 1. * @returns The opacified color string. */ opacify(alpha?: number): string; /** * Rotate color hue. * * @param degrees - A number between -360 and 360. * @returns The rotated color string. */ rotate(degrees: number): string; /** * Make the color more transparent. * * @param alpha - A number between -1 and 1. * @returns The transparentized color string. */ transparentize(alpha?: number): string; } /** * Check 2 colors for WCAG compliance. * * @param left - The first color string. * @param right - The second color string. * @returns Analysis object with WCAG compliance information. */ //#endregion //#region src/colour/conversion.d.ts declare function convert(colour: Colourish, destination: T): T extends `oklch-absolute` ? OkLchAbsolute : T extends `oklch-scalar` ? OkLchScalar : T extends `srgb-8bit` ? Rgb8Bit : T extends `srgb-scalar` ? RgbScalar : T extends `hsl-scalar` ? HslScalar : T extends `hsl-absolute` ? HslAbsolute : never; /** * Like {@link convert}, but result is a CSS colour string * @param colour * @param destination */ declare function convertToString(colour: Colourish, destination: ConvertDestinations): string; /** * Converts some kind of colour into a scalar representation. Supports oklch, hsl and srgb. * @param colour Colour to convert * @param destination Destination colour format */ declare function convertScalar(colour: Colourish, destination: T): T extends `oklch` ? OkLchScalar : T extends `hsl` ? HslScalar : T extends `srgb` ? RgbScalar : never; declare function toCssColour(colour: Colourish | object): string; declare function toHexColour(colour: Colourish | object): string; declare function toLibraryColour(colour: Colourish): Colorizr; declare function guard$4(colour: Colour): void; declare function toColour(colourish: any): Colour; /** * Returns a CSS-ready string * representation. * ```js * element.style.backgroundColor = resolveToString(`red`); * ``` * * Tries each parameter in turn, returning the value * for the first that resolves. This can be useful for * having fallback values. * * ```js * // Try a CSS variable, a object property or finally fallback to red. * element.style.backgroundColor = toStringFirst('--some-var', opts.background, `red`); * ``` * @param colours Array of colours to resolve */ declare function toStringFirst(...colours: Array): string; declare function rgbToHsl(rgb: Rgb, scalarResult: true): HslScalar; declare function rgbToHsl(rgb: Rgb, scalarResult: false): HslAbsolute; //#endregion //#region src/colour/css-colours.d.ts /** * Converts from some kind of colour that is legal in CSS * into a structured Colour type. * * Handles: hex format, CSS variables, colour names * ```js * fromCssColour(`#ffffff`); * fromCssColour(`blue`); * fromCssColour(`--some-variable`); * fromCssColour(`hsl(50, 50%, 50%)`); * fromCssColour(`rgb(50, 100, 100)`); * ``` * @param colour * @returns */ declare const fromCssColour: (colour: string) => Colour; /** * Resolves a named colour to a colour string. * * ```js * resolveCss(`red`); * ``` * @param colour CSS named colour * @returns */ declare function resolveCss(colour: CssColourNames): string; type CssColourNames = keyof typeof cssDefinedHexColours; declare const cssDefinedHexColours: Record; //#endregion //#region src/colour/generate.d.ts /** * Returns a full HSL colour string (eg `hsl(20,50%,75%)`) based on a index. * It's useful for generating perceptually different shades as the index increments. * * ``` * el.style.backgroundColor = goldenAgeColour(10); * ``` * * Saturation and lightness can be specified, as numeric ranges of 0-1. * * @param saturation Saturation (0-1), defaults to 0.5 * @param lightness Lightness (0-1), defaults to 0.75 * @param alpha Opacity (0-1), defaults to 1.0 * @returns HSL colour string eg `hsl(20,50%,75%)` */ declare function goldenAngleColour(index: number, saturation?: number, lightness?: number, alpha?: number): string; /** * Returns a random hue component (0..359) * * ``` * // Generate hue * const h = randomHue(); // 0-359 * * // Generate hue and assign as part of a HSL string * el.style.backgroundColor = `hsl(${randomHue(), 50%, 75%})`; * ``` * @param rand * @returns Random hue in angle degrees */ declare const randomHue: (rand?: RandomSource) => number; //#endregion //#region src/colour/guards.d.ts declare function isHsl(v: any): v is Hsl; declare function isRgb(v: any): v is Rgb; /** * If the input object has r,g&b properties, it will return a fully- * formed Rgb type with `unit` and `space` properties. * * If it lacks these basic three properties or they are out of range, * _undefined_ is returned. * * If RGB values are less than 1 assumes unit:scalar. Otherwise unit:8bit. * If RGB values exceed 255, _undefined_ returned. * @param v * @returns Rgb object or _undefined_ if the input object is not a valid Rgb type. */ declare function tryParseObjectToRgb(v: any): Rgb | undefined; declare function tryParseObjectToOkLch(v: any): OkLch | undefined; /** * If the input object has h, s and l properties, it will return a fully- * formed Hsl type with `unit` and `space` properties. * * If it lacks these basic three properties or they are out of range, * _undefined_ is returned. * * If HSL values are less than 1 assumes unit:scalar. Otherwise unit:8bit. * If HSL values exceed 100, _undefined_ returned. * @param v * @returns Hsl object or _undefined_ if the input object is not a valid Hsl type. */ declare function tryParseObjectToHsl(v: any): Hsl | undefined; declare function isOkLch(v: any): v is OkLch; declare function isColourish(v: any): v is Colourish; declare namespace hsl_d_exports { export { absolute$1 as absolute, changeLightness$1 as changeLightness, fromCss$3 as fromCss, fromHexString$3 as fromHexString, generateScalar$1 as generateScalar, guard$3 as guard, interpolator$3 as interpolator, parseCssHslFunction, scalar$3 as scalar, toAbsolute$1 as toAbsolute, toCssString$2 as toCssString, toHexString$3 as toHexString, toLibraryRgb, toScalar$3 as toScalar, withOpacity$3 as withOpacity }; } /** * Scales the opacity value of an input HSL value * ```js * withOpacity() * ``` * @param value Colour * @param fn Function that calcules opacity based on input scalar value */ declare function withOpacity$3(value: T, fn: (opacityScalar: number, value: T) => number): T; /** * Increases or decreases lightness by this percentage, returning new colour * * Amount to change: * 'fixed': a fixed amount * 'delta': increase/decrease by this amount * 'pdelta': proportion of current value to change by ('percentage delta') * * ``` * const colour = { h: 0.5, s: 0.5, l: 0.5, space: `hsl`, unit: `scalar` }; * changeLightness(colour, { pdelta: 0.1 }); // l: 0.55 * changeLightness(colour, { delta: 0.1 }); // l: 0.6 * changeLightness(colour, { fixed: 0.5 }); // l: 0.5 * ``` * * Keep in mind the numerical value will depend on the unit of `value`. If it's scalar, * lightness is 0..1 scale, otherwise 0..100 scale. * * Use negative values to decrease (does not apply to 'fixed') * @param value Hsl colour * @param amount Amount to change */ declare function changeLightness$1(value: Hsl, amount: Partial<{ pdelta: number; delta: number; fixed: number; }>): Hsl; declare function fromHexString$3>(hexString: string, scalar: T): T extends { scalar: true; } ? HslScalar : HslAbsolute; declare function fromCss$3>(value: string, options?: T): T extends { scalar: true; } ? HslScalar : HslAbsolute; declare function toCssString$2(hsl: Hsl): string; declare function toHexString$3(hsl: Hsl): string; declare function toAbsolute$1(hslOrString: Hsl | Rgb | string): HslAbsolute; /** * Generates a {@link HslScalar} value. * * ```js * generateScaler(10); // 10deg, default to full saturation, half lightness and full opacity * * // Generate HSL value from radian angle and 50% saturation * generateScalar(`10rad`, 0.5); * * // Generate from numeric CSS variable * generateScalar(`--hue`); * ``` * @param absoluteHslOrVariable Hue angle or CSS variable * @param saturation * @param lightness * @param opacity */ declare function generateScalar$1(absoluteHslOrVariable: string | number | Angle, saturation?: number, lightness?: number, opacity?: number): HslScalar; /** * Converts a {@link Hsl} value to scalar units, or parses a colour string * and converts it. * * ```js * toScalar({ h: 100, s: 50, l: 100, unit: `absolute` }); * toScalar(`red`); * ``` * @param colour */ declare function toScalar$3(colour: Rgb | Hsl | string): HslScalar; declare function guard$3(hsl: Hsl): void; declare function interpolator$3(a: Hsl | string, b: Hsl | string, direction?: `longer` | `shorter`): (amount: number) => HslScalar; /** * Creates a HslScalar value from scalar (0..1) values * @param hue * @param sat * @param lightness * @param opacity */ declare function scalar$3(hue?: number, sat?: number, lightness?: number, opacity?: number): HslScalar; declare function absolute$1(hue?: number, sat?: number, lightness?: number, opacity?: number): HslAbsolute; /** * It seems Colorizr can't handle 'deg' units * @param value */ declare function parseCssHslFunction(value: string): Hsl; /** * Converts a Hsl structure (or CSS string) to Colorizr's RGB format * @param hsl HSL colour */ declare function toLibraryRgb(hsl: Hsl | string): RGB; //#endregion //#region src/colour/interpolate.d.ts /** * Returns a function to interpolate between colours, with results as a structured {@link Colour} object. * ```js * const i = interpolator([`orange`, `yellow`, `red`]); * * // Get a random colour on the above spectrum * i(Math.random()); * ``` * * Results will vary depending on the colour space used, play with the options. * When using a hue-based colour space, the `hue` option sets the logic for how hue values wrap. * * ```js * interpolator([`orange`, `yellow`, `red`], { space: `hsl`, hue: `longer }) * ``` * * Example: Draw the interpolation as a spectrum on a canvas, where each pixel is one step * ```js * let v = 0; * let incrementBy = 0.01; * while (v <= 1) { * // Get colour at this interpolation point 0..1 * const colour = fn(v); * // Convert to a CSS string * ctx.fillStyle = Colour.toCssColour(colour); * // Draw a 1px wide rect, and shuffle along to the next x position * ctx.fillRect(x, y, 1, h); * x += 1; * v += incrementBy; * } * ``` * @param colours Colours to interpolate between * @param opts Options for interpolation * @returns Function that interpolates based on an amount, returning a structured Colour */ declare function interpolator$2(colours: Colourish[], opts?: Partial): (amt: number) => Colour; /** * Returns a CSS `linear-gradient` with stops corresponding to the given list of `colours`. * ```js * element.style.background = Colour.cssLinearGradient(['red','green','blue']); * ``` * @param colours * @returns A 'linear-gradient' string for use in CSS, eg for background. */ declare function cssLinearGradient(colours: Colourish[]): string; /** * Returns a function that interpolates between two colours. Returns string colour values. * If you want the result as a structured colour, use {@link interpolatorDual} instead. * * By default takes a shorter direction and uses the OkLCH colourspace. * ```js * const i = interpolator(`blue`, `red`); * i(0.5); // Get the colour at 50%, as a string. * ``` * * To work with structured colour values, use one of the space's `interpolate` functions. * * If you want to create discrete steps, consider {@link createSteps} or {@link scale}. * * @param colourA First colour * @param colourB Second colour * @param options Interpolation options. By default uses shorter direction and OkLCH colour space. */ declare function interpolatorDualToString(colourA: Colourish, colourB: Colourish, options?: Partial): ((amount: number) => string); /** * Returns a function that interpolates between two colours. Returns structured colour values. * If you want the result as a ready-to-use CSS string, use {@link interpolatorDualToString} instead. * * By default takes a shorter direction and uses the OkLCH colourspace. * ```js * const i = interpolator(`blue`, `red`); * i(0.5); // Get the colour at 50%, as a Colour structure. * ``` * * If you want to create discrete steps, consider {@link createSteps} or {@link scale}. * @param colourA First colour * @param colourB Second colour * @param options Interpolation options. By default uses shorter direction and OkLCH colour space. * @returns Function that interpolates between two colours, returning a structured Colour */ declare function interpolatorDual(colourA: Colourish, colourB: Colourish, options?: Partial): (amount: number) => Colour; /** * Produces a stepped scale of colours. * * Builds off {@link createSteps} which can only step between two colours. * * ```js * // A scale of from red to green, with three colours in-between * const steps = Colour.scale([ `red`, `green` ], { stepsBetween: 3 }); * for (const step of steps) { * // A CSS colour string * } * ``` * * {@link cssLinearGradient} can produce a smooth gradient in CSS on the basis * of the stepped colours. * @param colours * @param opts * @returns Array of colours in string form */ declare function scale(colours: Colourish[], opts?: Partial): string[]; type CreateStepsOptions = Partial<{ space: ColourSpaces; steps: number; direction: `longer` | `shorter`; exclusive: boolean; }>; /** * Creates discrete colour steps between two colours. * * Use {@link scale} to create steps between any number of colours. * * Start and end colours are included (and counted as a step) unless `exclusive` is set to _true_ * * ```js * // Array of five HslScalar * createSteps(`red`,`blue`, { steps: 5 }); * ``` * * Defaults to the oklch colour space, 5 steps and non-exclusive. * @param a Start colour * @param b End colour * @param options * @returns Colour steps */ declare function createSteps(a: Colourish | string, b: Colourish, options: T): T extends { space: `oklch`; } ? OkLchScalar[] : T extends { space: `srgb`; } ? RgbScalar[] : T extends { space: `hsl`; } ? HslScalar[] : OkLchScalar[]; //#endregion //#region src/colour/math.d.ts declare function multiplyOpacity(colourish: T, amount: number): T extends string ? string : T extends Hsl ? Hsl : T extends OkLch ? OkLch : T extends Rgb ? Rgb : never; /** * Does a computation with the opacity of a colour, returning colour string * @param colourish Colour * @param fn Function that takes original opacity as input and returns output opacity */ /** * Does a computation with the opacity of a colour in a HSL structure * @param hsl Colour * @param fn Function that takes original opacity as input and returns output opacity */ /** * Does a computation with the opacity of a colour in a RGB structure * @param colourish Colour * @param fn Function that takes original opacity as input and returns output opacity */ declare function withOpacity$2(colourish: T, fn: (scalarOpacity: number) => number): T extends string ? string : T extends Hsl ? Hsl : T extends OkLch ? OkLch : T extends Rgb ? Rgb : never; declare function setOpacity(colourish: T, amount: number): T extends string ? string : T extends Hsl ? Hsl : T extends OkLch ? OkLch : T extends Rgb ? Rgb : never; declare namespace oklch_d_exports { export { OKLCH_CHROMA_MAX, absolute, fromCss$2 as fromCss, fromHexString$2 as fromHexString, fromLibrary, generateScalar, guard$2 as guard, interpolator$1 as interpolator, scalar$2 as scalar, toAbsolute, toCssString$1 as toCssString, toHexString$2 as toHexString, toScalar$2 as toScalar, withOpacity$1 as withOpacity }; } declare const OKLCH_CHROMA_MAX = .4; declare function guard$2(lch: OkLch): void; /** * Coverts from the Colorizr library * Tests ranges: * l: 0..1 * c: 0..1 * h: 0..360 * alpha: 0..1 * * Default option: { scalar: true } * @param lch LCH value * @param parsingOptions Options for parsing */ declare function fromLibrary>(lch: LCH, parsingOptions: T): T extends { scalar: true; } ? OkLchScalar : OkLchAbsolute; /** * Parse a HEX-formatted colour into OkLch structured format * @param hexString * @param options */ declare function fromHexString$2(hexString: string, options?: ParsingOptions): OkLch; /** * Converts from some CSS-representation of colour to a structured OkLch format. * * ```js * fromCss(`yellow`); * fromCss(`rgb(100,200,90)`); * fromCss(`#ff00ff`); * ``` * * By default returns a {@link OkLchScalar} (relative) representation. Use the flag 'scalar:true' to get back * {@link OkLchAbsolute}. * @param value * @param options */ declare function fromCss$2>(value: string, options: T): T extends { scalar: true; } ? OkLchScalar : OkLchAbsolute; /** * Returns a string or {@link OkLch} value to absolute form. * * This means ranges are: * lightness: 0..1 * chroma: 0...CHROMA_MAX (0.4) * hue: 0..360 * @param lchOrString */ declare function toAbsolute(lchOrString: OkLch | string): OkLchAbsolute; declare function toScalar$2(lchOrString: OkLch | string): OkLchScalar; /** * Returns the colour as a CSS colour string: `oklch(l c h / opacity)`. * * @param lch Colour * @param precision Set precision of numbers, defaults to 3 * @returns CSS colour string */ declare function toCssString$1(lch: OkLch, precision?: number): string; declare function toHexString$2(lch: OkLch): string; declare function generateScalar(absoluteHslOrVariable: string | number | Angle, chroma?: number, lightness?: number, opacity?: number): OkLchScalar; /** * Scales the opacity value of an input Oklch value * ```js * withOpacity() * ``` * @param value * @param fn */ declare function withOpacity$1(value: T, fn: (opacityScalar: number, value: T) => number): T; declare function interpolator$1(a: OkLch | string, b: OkLch | string, direction?: `longer` | `shorter`): (amount: number) => OkLchScalar; declare function scalar$2(lightness?: number, chroma?: number, hue?: number, opacity?: number): OkLchScalar; /** * Create an LCH colour using absolute hue * @param l Lightness 0..1 * @param c Chroma 0..4 * @param h Hue 0..360 * @param opacity */ declare function absolute(l: number, c: number, h: number, opacity?: number): OkLchAbsolute; declare namespace srgb_d_exports { export { changeLightness, eightBit$1 as eightBit, fromCss$1 as fromCss, fromHexString$1 as fromHexString, guard$1 as guard, interpolator, lightness, parseCssRgbFunction, scalar$1 as scalar, to8bit$1 as to8bit, toCssString, toHexString$1 as toHexString, toLibraryHsl, toScalar$1 as toScalar, withOpacity }; } declare function withOpacity(value: T, fn: (opacityScalar: number, value: T) => number): T; declare function fromHexString$1(hexString: string, scalar: T): T extends true ? RgbScalar : Rgb8Bit; declare function fromCss$1>(value: string, options: T): T extends { scalar: true; } ? RgbScalar : Rgb8Bit; declare function toHexString$1(rgb: Rgb): string; declare function toCssString(rgb: Rgb): string; declare function to8bit$1(rgbOrString: Rgb | string): Rgb8Bit; declare function toScalar$1(rgbOrString: Rgb | Hsl | string): RgbScalar; declare function guard$1(rgb: Rgb): void; /** * Sets the lightness value. * * Amount to change: * 'fixed': a fixed amount * 'delta': increase/decrease by this amount * 'pdelta': proportion of current value to change by ('percentage delta') * * Use negative values to decrease * @param rgb Colour * @param amount Amount to change */ declare function changeLightness(rgb: Rgb, amount: Partial<{ pdelta: number; delta: number; fixed: number; }>): Rgb; /** * Returns a lightness value (0..1) for an RGB input * * Calculates lightness by converting to Oklab and using the 'L' value * @param rgb */ declare function lightness(rgb: Rgb): number; /** * Creates a Rgb8Bit value from 8bit (0..255) values * @param red * @param green * @param blue * @param opacity */ declare function eightBit$1(red?: number, green?: number, blue?: number, opacity?: number): Rgb8Bit; /** * Creates a RgbScalar value from scalar (0..1) values * @param red * @param green * @param blue * @param opacity */ declare function scalar$1(red?: number, green?: number, blue?: number, opacity?: number): RgbScalar; /** * It seems Colorizr can't handle % values properly :'( * @param value */ declare function parseCssRgbFunction(value: string): Rgb; /** * Interpolates colours in Srgb space. Probably * really ugly, use OkLch space isntead. * * ```js * const i = interpolator(`red`, `blue`); * i(0.5); // Get 50% between these colours * ``` * @param colourA * @param colourB */ declare function interpolator(colourA: Rgb | string, colourB: Rgb | string): (amount: number) => RgbScalar; /** * Converts a Rgb structure (or CSS string) to Colorizr's HSL format * @param rgb */ declare function toLibraryHsl(rgb: Rgb | string): HSL; //#endregion //#region src/colour/to-integer.d.ts /** * Encode 8-bit RGB values into a 24-bit value (0...16_777_215) * * Assumes RGB values are within 0..255 range * @param rgb * @returns */ declare function encodeRgbTo24Bit(rgb: Rgb8Bit | RgbBase): number; /** * Decode a 24-bit number (0...16_777_215) into 8-bit RGB * @param colour * @returns */ declare function decodeRgbFrom24Bit(colour: number): Rgb8Bit; /** * Encodes 8-bit RGB value into 16-bit RGB565 (0..65_535) * 5-bit are used for R & B channels, 6 bits for G * * Read more: https://rgbcolorpicker.com/565 * @param rgb * @returns */ declare function encodeRgbTo16Bit565(rgb: Rgb8Bit | RgbBase): number; /** * Decodes 8-bit RGB value from a 16-bit RGB565 value (0...65_535) * Read more: https://rgbcolorpicker.com/565 * @param colour * @returns */ declare function decodeRgbFrom16Bit565(colour: number): Rgb8Bit; declare namespace ycbcr_d_exports { export { eightBit, fromCss, fromHexString, fromSrgTo8bit, guard, scalar, to8bit, toHexString, toScalar, toSrgb8bit }; } /** * Creates a YCbCr8bit value from 8bit (0..255) values * @param y Luma 0..255 * @param cb Chroma blue 0..255 * @param cr Chroma red 0..255 * @param opacity 0..255 * @returns YCbCr8bit */ declare function eightBit(y?: number, cb?: number, cr?: number, opacity?: number): YCbCr8bit; /** * Creates a YCbCr8bit value from scalar (0..1) values * @param y Luma 0..1 * @param cb Chroma blue 0..1 * @param cr Chroma red 0..1 * @param opacity 0..1 * @returns YCbCrScalar */ declare function scalar(y?: number, cb?: number, cr?: number, opacity?: number): YCbCrScalar; /** * Converts from scalar or 8bit RGB to YCbCr8bit * @param rgb * @returns */ declare function fromSrgTo8bit(rgb: Rgb): YCbCr8bit; declare function toSrgb8bit(ycbcr: YCbCr): Rgb8Bit; /** * Returns a YCbCr8bit format from either scalar or 8bit. * If the input is already 8bit, it is returned as-is. * @param ycbcr 8bit or scalar YCbCr value * @returns YCbCr8bit */ declare function to8bit(ycbcr: YCbCr): YCbCr8bit; declare function fromHexString>(hexString: string, scalar: T): T extends { scalar: true; } ? YCbCrScalar : YCbCr8bit; declare function fromCss>(value: string, options: T): T extends { scalar: true; } ? YCbCrScalar : YCbCr8bit; declare function toScalar(colour: YCbCr | Rgb | string): YCbCrScalar; declare function guard(rgb: YCbCr): void; /** * Converts a YCbCr colour to a RGB hex string. * @param ycbcr * @returns */ declare function toHexString(ycbcr: YCbCr): string; declare namespace index_d_exports$1 { export { Colour, ColourInterpolationOpts, ColourInterpolator, ColourSpaces, ColourStepOpts, Colourish, ConvertDestinations, CreateStepsOptions, CssColourNames, Hsl, HslAbsolute, HslBase, HslScalar, hsl_d_exports as HslSpace, LchBase, OkLch, OkLchAbsolute, OkLchBase, OkLchScalar, oklch_d_exports as OklchSpace, ParsingOptions, Rgb, Rgb8Bit, RgbBase, RgbScalar, srgb_d_exports as SrgbSpace, YCbCr, YCbCr8bit, YCbCrBase, YCbCrScalar, ycbcr_d_exports as YCbCrSpace, convert, convertScalar, convertToString, createSteps, cssDefinedHexColours, cssLinearGradient, decodeRgbFrom16Bit565, decodeRgbFrom24Bit, encodeRgbTo16Bit565, encodeRgbTo24Bit, fromCssColour, goldenAngleColour, guard$4 as guard, interpolator$2 as interpolator, interpolatorDual, interpolatorDualToString, isColourish, isHsl, isOkLch, isRgb, multiplyOpacity, randomHue, resolveCss, rgbToHsl, scale, setOpacity, toColour, toCssColour, toHexColour, toLibraryColour, toStringFirst, tryParseObjectToHsl, tryParseObjectToOkLch, tryParseObjectToRgb, withOpacity$2 as withOpacity }; } declare abstract class LabelledInputBase extends LitElement { label: string; min: number; max: number; value: number; step: number; precision: number; dragSensitivity: number; miniWidthThreshold: number; miniHeightThreshold: number; displayTextLogic: `hidden` | `show` | `override` | `transient`; protected _isMini: boolean; protected _isDragging: boolean; protected _formatter?: (value: string) => string; private _debounceTimer; private _resizeObserver?; abstract readonly inputSelector: string; get formatter(): (value: string) => string; set formatter(value: ((value: string) => string) | undefined); protected get hasCustomFormatter(): boolean; connectedCallback(): void; disconnectedCallback(): void; protected _handleResize(entries: ResizeObserverEntry[]): void; protected _handleNumberChange: (e: CustomEvent<{ value: string; }>) => void; protected _handleInputChange: (e: CustomEvent<{ value: number; }>) => void; protected _handleSliderInput: (e: CustomEvent<{ value: number; }>) => void; protected _syncValue(v: number): void; protected _renderEditableNumber(): typeof nothing | import("lit").TemplateResult<1>; updated(changedProperties: Map): void; } export declare class LabelledRangeInput extends LabelledInputBase { readonly inputSelector = "ixfx-range-input"; orientation: `horizontal` | `vertical`; tooltip: boolean; noTooltip: boolean; tooltipOrientation: `top` | `right`; /** Pass-through: enables wheel-on-hover for the inner slider and editable-number. */ lighttouch: boolean; switchHeight: number; protected _renderEditableNumber(): import("lit").TemplateResult<1>; render(): import("lit").TemplateResult<1>; static styles: CSSResultGroup; } declare global { interface HTMLElementTagNameMap { 'ixfx-labelled-range-input': LabelledRangeInput; } } export declare class ColourPicker extends LitElement { l: number; c: number; h: number; a: number; hidePreview: boolean; hideH: boolean; hideL: boolean; hideC: boolean; showA: boolean; horizontal: boolean; slidersVertical: boolean; hideTooltips: boolean; private _valueAttr; rangeLAttr: string | null; rangeCAttr: string | null; rangeHAttr: string | null; rangeAAttr: string | null; private _ranges; _sliderL: HTMLElement; _sliderC: HTMLElement; _sliderH: HTMLElement; _sliderA: HTMLElement; _previewEl: HTMLElement; private _defaultL; private _defaultC; private _defaultH; private _defaultA; private readonly _userInitiated; get value(): string; set value(colourString: string); /** * Set the colour from any ixfx-compatible format (CSS string, OkLch object, * HSL object, etc.). Also updates the double-click reset defaults for all * sliders. */ setColour(colour: index_d_exports$1.Colourish): void; get rangeL(): Range; set rangeL(range: RangeInput$1); get rangeC(): Range; set rangeC(range: RangeInput$1); get rangeH(): Range; set rangeH(range: RangeInput$1); get rangeA(): Range; set rangeA(range: RangeInput$1); setRangeL(range: RangeInput$1): void; setRangeC(range: RangeInput$1): void; setRangeH(range: RangeInput$1): void; setRangeA(range: RangeInput$1): void; willUpdate(changedProperties: PropertyValues): void; private _applyRangeInput; private _coerceRangeInput; private _setRangeFromAttribute; private _setRange; private _getRange; private _parseRangeString; private _normalizeRange; private _clampToRange; render(): import("lit").TemplateResult<1>; firstUpdated(changedProperties: PropertyValues): void; updated(changedProperties: PropertyValues): void; _updateGradients(): void; _onInput: (e: Event, channel: `l` | `c` | `h` | `a`) => void; _onChange: (e: Event, channel: `l` | `c` | `h` | `a`) => void; _dispatchInput(): void; _dispatchChange(): void; static styles: CSSResultGroup; } declare global { interface HTMLElementTagNameMap { 'ixfx-colour-picker': ColourPicker; } } declare const PICKER_SIZES: { readonly small: { readonly width: 130; readonly height: 100; }; readonly medium: { readonly width: 100; readonly height: 155; }; readonly large: { readonly width: 200; readonly height: 180; }; readonly huge: { readonly width: 290; readonly height: 240; }; }; type PickerSize = keyof typeof PICKER_SIZES; export declare class ColourPickerPopup extends LitElement { mode: `fluid` | `confirm`; l: number; c: number; h: number; a: number; showPreview: boolean; hideH: boolean; hideL: boolean; hideC: boolean; showA: boolean; horizontal: boolean; size: PickerSize; private _isOpen; private _everOpened; private _hasAction; _popupEl: HTMLElement; _pickerEl: ColourPicker; private readonly _uid; private readonly _anchorName; private readonly _popupId; private _pendingL; private _pendingC; private _pendingH; private _pendingA; private _savedL; private _savedC; private _savedH; private _savedA; private _pendingConfirmed; constructor(); get value(): string; set value(colour: index_d_exports$1.Colourish); private get _innerHidePreview(); private get _pickerDimensions(); setColour(colour: index_d_exports$1.Colourish): void; firstUpdated(changedProperties: PropertyValues): void; updated(changedProperties: PropertyValues): void; private _applyAnchorPositioning; private _updateSwatchBackground; private _onPopoverToggle; private _onPickerInput; private _onPickerChange; private _onConfirm; private _onActionSlotChange; close(): void; private _onSwatchClick; private _dispatchInput; private _dispatchChange; render(): import("lit").TemplateResult<1>; static styles: CSSResultGroup; } declare global { interface HTMLElementTagNameMap { 'ixfx-colour-picker-popup': ColourPickerPopup; } } export type DataControllerOptions = { /** * Clear accumulated items immediately when request() is called. * When false, stale items remain visible while the new request is in-flight * (useful for re-query-on-keystroke patterns — avoids a blank flash). * Default: true. */ clearOnRequest?: boolean; /** * Called when the provider throws or rejects. Useful for logging without * coupling the error to render logic. */ onError?: (err: unknown) => void; }; /** * Lit ReactiveController that manages one active data provider request at a time. * * Handles all three provider return modes (sync, async one-shot, streaming), * tracks progress, and cancels in-flight requests when a new one starts. * Calls host.requestUpdate() on every state change so the component re-renders * automatically. * * @typeParam TQuery - The query/scope type passed to the provider. * @typeParam TItem - The item type produced by the provider. * * @example * ```ts * class MyList extends LitElement { * #data = new DataController(this, myProvider); * * protected override render() { * return html` * ${this.#data.loading ? html`Loading…` : nothing} * ${this.#data.items.map(item => html`
${item.label}
`)} * `; * } * } * ``` */ export declare class DataController implements ReactiveController { #private; constructor(host: ReactiveControllerHost, provider?: IDataProvider, options?: DataControllerOptions); hostConnected(): void; hostDisconnected(): void; get provider(): IDataProvider | undefined; set provider(value: IDataProvider | undefined); /** The currently accumulated items. */ get items(): readonly TItem[]; /** True while a provider call is pending or a stream is still open. */ get loading(): boolean; /** Number of items accumulated so far in the current request. */ get loaded(): number; /** * Provider's latest estimate of the total number of items expected. * Undefined when the provider has not reported a total. */ get total(): number | undefined; /** * Progress as a 0–1 value, or undefined when total is unknown. * Derived from loaded / total. */ get progress(): number | undefined; /** The last error thrown by the provider, or undefined if the last request succeeded. */ get error(): unknown; /** * Cancel any in-flight request and start a new one. * Clears items immediately unless clearOnRequest was set to false. */ request(query: TQuery): void; /** Abort any in-flight request without issuing a new one. */ cancel(): void; } interface ListDragEntry { readonly key: string; readonly index: number; readonly item: T | Element; /** * Available rendered presentation for the entry, for use only during the * synchronous drag-preview operation. * * - Element-backed lists: the consumer/source element. * - Data-backed virtual lists: the currently rendered row or cell that * presents the item. * - `undefined` when no presentation is currently rendered (e.g. a * virtualized-off-screen selection). * * Do not retain the element afterwards: virtualization may recycle or * disconnect it. */ readonly element?: Element; } type ListDragSource = `grid-list` | `detail-list` | `vertical-list` | `data-grid` | `tree-list`; interface ListDragPreviewContext { readonly source: ListDragSource; readonly origin: ListDragEntry; readonly selected: ReadonlyArray>; readonly metrics: { readonly itemSize?: number; readonly captionStyle?: string; readonly captionHeight?: number; readonly rowHeight?: number; }; readonly hostStyle: CSSStyleDeclaration; readonly resolveDragPreviewSource?: ListDragPreviewSourceResolver; } interface ListDragPreview { readonly element: HTMLElement; readonly hotspot?: Readonly<{ x: number; y: number; }>; readonly canvas?: HTMLCanvasElement; readonly dispose?: () => void; } /** * Writes an application payload onto the drag's `DataTransfer` at `dragstart`. * Every list component exposes this as a public `writeDataTransfer` property; * `ListNativeDragController` invokes it after any built-in payload writer. */ type ListDragDataTransferWriter = (dataTransfer: DataTransfer, detail: ListNativeDragStartDetail) => void; type ListDragPreviewRenderer = (context: ListDragPreviewContext) => ListDragPreview; type ListDragPreviewSourceResolver = (entry: ListDragEntry) => CanvasImageSource | undefined; interface ListNativeDragStartDetail { readonly key: string; readonly index: number; readonly item: T | Element; readonly selectedKeys: readonly string[]; readonly selected: ReadonlyArray>; readonly preview?: ListDragPreview; } type ListNativeDragStartEvent = CustomEvent>; export type TreeItem = { /** Unique identifier within the tree. */ key: string; /** Visible label text. */ label: string; /** When true the node cannot have children and will not show an expand affordance. */ isLeaf?: boolean; /** Arbitrary application data associated with this node. */ data?: unknown; /** Icon name passed to an icon component, if icons are enabled. */ icon?: string; /** * CSS colour applied to the node's icon, overriding the inherited text * colour. Only meaningful when `icon` is set. Components that render the * icon from `icon` honour this; the rest ignore it. */ iconColor?: string; /** * CSS colour applied to the node's label. Inline, so it wins over the * selected/tickled text colours — keep it legible against both, or leave * it unset and let the component's theming handle selection contrast. */ textColor?: string; /** * Finder-style badge rendered alongside the label — e.g. a colour-tag chip * or a stack of them. Anything Lit can render (usually a `TemplateResult`), * or a DOM `Node` for the components that build their rows imperatively. * Placement is per-component: thumbnails-style lists put it before the * name, list-style views right-justify it on the same line. */ badge?: unknown; /** * Whether the label may be renamed in place. Only `ixfx-flat-list` * (`beginEdit`) uses it; other components ignore it. */ editable?: boolean; /** * Set to `false` to make this node unselectable, regardless of * `selectionFilter`. In `ixfx-tree-list`'s `checked` mode no checkbox is * drawn for it (see `alignCheckboxes`). Unselectable branches can still be * expanded, and their selectable descendants can still be selected. * Default: selectable. */ selectable?: boolean; /** Tooltip text shown on hover. */ tooltip?: string; /** Optional string value, e.g. for use as a command/route. */ value?: string; /** * Optional relative importance/magnitude of this node. Unitless — consumers * normalize it against whatever population of nodes is currently relevant * to them (e.g. `ixfx-hyperbolictree-list` normalizes across the currently * visible node set). Components that don't support weighting ignore it. */ weight?: number; }; /** A node in the tree, potentially containing lazily-loaded children. */ export type TreeNode = { item: TreeItem; /** * Child nodes. * - `undefined` = children not yet loaded (component will call loadChildren if set) * - `[]` = confirmed leaf / empty branch * - non-empty array = loaded children */ children?: TreeNode[]; }; /** * Callback invoked when a node's children need to be loaded. * The AbortSignal is cancelled if the request is superseded (e.g. node collapsed before load completes). * May return children synchronously, as a promise, or as a streaming async iterable of batches. */ export type LoadChildrenCallback = IDataProvider<{ node: TreeNode; depth: number; }, TreeNode>; /** * Predicate used by search/filter controllers to determine whether a node should be visible. * Receives depth so column-scoped filtering (e.g. in ixfx-miller-list) is possible. * Tree implementations that do not need depth can simply ignore the parameter. */ export type TreeFilterPredicate = (node: TreeNode, depth: number) => boolean; /** * Controls how expanding a node affects its siblings. * - `'none'` — no constraint; any number of nodes may be expanded simultaneously * - `'depth'` — only one sibling at the same depth may be expanded at a time (accordion) * - `'global'` — only one node anywhere in the tree may be expanded at a time */ export type TreeExclusivity = `none` | `depth` | `global`; /** * Restricts which kinds of nodes may enter the selection. * Applied as a guard in all interaction modes. * - `'none'` — no node can be selected (read-only / display-only) * - `'leaf'` — only leaf nodes are selectable * - `'branch'` — only branch nodes (nodes with children) are selectable * - `'all'` — both leaf and branch nodes are selectable */ export type TreeSelectionFilter = `none` | `leaf` | `branch` | `all`; /** * Controls how pointer and keyboard gestures map to selection changes. * - `'implicit'` — single selection that follows the click; clicking always selects + toggles expand * - `'standard'` — single click selects+toggles; Ctrl/Cmd+click toggles item; Shift+click range-selects * - `'manual'` — component never auto-selects; use `select()`/`deselect()`/`clearSelection()` to drive state * - `'checked'` — checkboxes on every item; checkbox click toggles selection recursively; row click only expands/collapses * - `'vscode'` — like `standard` for clicks; Shift+arrow uses snapshot-based toggle-range */ export type TreeInteractionMode = `implicit` | `standard` | `manual` | `checked` | `vscode`; type InvalidateEvent = { type: `invalidate`; key: string; }; type RootEvent = { type: `root`; root: TreeNode; }; type ModelEvent = InvalidateEvent | RootEvent; type ModelSubscriber = (event: ModelEvent) => void; export type TreeDataModelOptions = { /** The initial root node. Required. */ root: TreeNode; /** * Optional callback for lazily loading children. * If omitted, nodes with `children === undefined` are treated as empty branches. */ loadChildren?: LoadChildrenCallback; }; /** * Manages tree data for tree-like components. * * Handles two concerns: * 1. **Lazy loading** — caches children fetched via `loadChildren` and can invalidate * specific branches so they are re-fetched on next expand. * 2. **Structural mutations** — convenience methods to add, remove, update, or move * nodes. Each mutation produces a new immutable root and notifies connected components. * * Assign an instance to a component's `model` property instead of setting `root`/`loadChildren` * directly. The same model instance can be shared across multiple components. * * @example * ```typescript * const model = new TreeDataModel({ * root: { item: { key: 'root', label: 'Root' }, children: [] }, * loadChildren: async (node, depth, signal) => fetchChildren(node.item.key), * }); * myTreeList.model = model; * myMillerList.model = model; * * // Later — invalidate a branch to force a re-fetch on next expand: * model.invalidate('some-key'); * ``` */ export declare class TreeDataModel { #private; constructor(options: TreeDataModelOptions); /** The current immutable root snapshot. */ get root(): TreeNode; /** * Replace the entire root with a new immutable snapshot. * All cached children are cleared. Connected components re-render. */ setRoot(root: TreeNode): void; /** * Returns children for the given node. * If children are cached, they are returned immediately (as a resolved Promise). * Otherwise the `loadChildren` callback is invoked and the result is cached. * If no `loadChildren` is set and no cache entry exists, returns `[]`. * * Called by components internally — not typically called by application code. */ getChildren(node: TreeNode, depth: number, signal: AbortSignal): Promise; /** * Clears the cached children for the node with the given key. * Connected components will collapse that node (if currently expanded), so that * the next expand triggers a fresh `loadChildren` call. */ invalidate(key: string): void; /** * Adds `node` as a child of the node identified by `parentKey`. * Returns the new root (connected components are notified automatically). */ addNode(parentKey: string, node: TreeNode): TreeNode; /** * Removes the node with the given key and all its descendants. * Returns the new root (connected components are notified automatically). */ removeNode(key: string): TreeNode; /** * Applies a partial update to the `item` of the node with the given key. * Returns the new root (connected components are notified automatically). */ updateItem(key: string, patch: Partial): TreeNode; /** * Moves the node with the given key to become a child of `newParentKey`. * When `index` is provided, inserts at that position; otherwise appends. * Returns the new root (connected components are notified automatically). */ moveNode(key: string, newParentKey: string, index?: number): TreeNode; /** * Moves the node with the given key to become a sibling of `referenceKey`, * positioned `before` or `after` it. A no-op (returns the unchanged root) when * `key` is `referenceKey`, an ancestor of it, or either is missing. * Returns the new root (connected components are notified automatically). */ moveNodeRelative(key: string, referenceKey: string, position: `before` | `after`): TreeNode; /** * Applies a resolved drop (from `ixfx-tree-list`'s `tree-drop` event or a * hand-built context) to the current root. No-op when the drop is invalid. * Returns the new root (connected components are notified automatically). */ applyDrop(ctx: TreeDropApplyContext): TreeNode; /** * Inserts `node` as a child of `parentKey` (or at the root level when `parentKey` is undefined). * When `index` is provided, inserts at that position; otherwise appends. * Returns the new root (connected components are notified automatically). */ insertNode(parentKey: string | undefined, node: TreeNode, index?: number): TreeNode; /** * Subscribe to model events. Returns an unsubscribe function. * Components call this when the `model` property is set, and unsubscribe when it is unset. * * @internal */ _subscribe(callback: ModelSubscriber): () => void; } /** * Shared view-state contract for list-like components. * * View state is everything about *how* a component is showing its data — * selection, expansion, scroll, column sizes — kept separate from the data * itself. It is plain JSON (arrays and records, never Sets or Maps) so a host * can `JSON.stringify` it straight into whatever storage it likes. Components * never persist it themselves; see `bindViewState()`. * * Every field is keyed by the stable item / column / group key, never by * index, so state can be re-applied to data that has been rebuilt, re-sorted * or streamed in over time. Keys the current data doesn't contain are kept * as pending and applied once a matching item appears. */ /** Current schema version. Bump on breaking shape changes. */ export declare const VIEW_STATE_VERSION = 1; /** Name of the debounced change event every view-stateful component fires. */ export declare const VIEW_STATE_CHANGE = "view-state-change"; /** * Where the viewport is scrolled to. `anchor` is the preferred form: the key * of the first visible item plus how far (px) the viewport top sits below * that item's start. It survives items being inserted above. `top` / `left` * are raw pixel offsets, used when there is no keyed item to anchor to. */ export type ScrollState = { readonly top: number; readonly left?: number; readonly anchor?: { readonly key: string; readonly offset: number; }; }; /** Fields shared by all view states. Components extend this with their own. */ export type ViewStateBase = { readonly v: typeof VIEW_STATE_VERSION; /** Component kind, e.g. `tree-list`. Mismatched states are ignored. */ readonly kind: string; /** Selected item keys. In `checked` interaction modes this is the checked set. */ readonly selected?: readonly string[]; /** Keyboard cursor (tickled / focused item) key. */ readonly focus?: string; readonly scroll?: ScrollState; /** * Explicit open/closed choices for expandable things (tree branches, groups), * keyed by item or group key. A missing key means "use the default". */ readonly expanded?: Readonly>; }; /** * What triggered a `view-state-change`: * - `user` — a direct interaction (click, key, drag, scroll) * - `data` — the data changed and the component adjusted (e.g. pruned focus) * - `restore` — pending state was applied to newly-arrived items, or `setViewState()` ran */ export type ViewStateChangeReason = `user` | `data` | `restore`; export type ViewStateChangeDetail = { readonly state: S; readonly reason: ViewStateChangeReason; }; export type ViewStateChangeEvent = CustomEvent>; export type GetViewStateOptions = { /** Only include these fields (plus `v` and `kind`). Default: all. */ readonly include?: ReadonlyArray>; /** * Include pending state for keys not (yet) present in the data. Default * `true` — leaving it out means a save made mid-rebuild overwrites the * stored state with a partial one. */ readonly includePending?: boolean; }; /** Implemented by every component that supports view-state snapshot / restore. */ export type ViewStateful = { /** Snapshot the current view state as plain JSON. */ getViewState: (options?: GetViewStateOptions) => S; /** * Apply a (possibly partial) view state. Only fields present are applied; * absent fields are left as they are. Keys not in the current data are kept * pending and applied when matching items appear. A state whose `kind` or * `v` doesn't match is ignored with a console warning. */ setViewState: (state: Partial) => void; /** Drop all pending (not-yet-matched) state. */ clearPendingViewState: () => void; }; export type TreeDndMode = `none` | `internal` | `external` | `both`; export type TreeDropPosition = `before` | `after` | `inside`; export interface TreeDropTarget { readonly parentKey: string | undefined; readonly index: number; readonly referenceKey: string; readonly position: TreeDropPosition; readonly depth: number; } export interface TreeDragContext { readonly nodes: readonly TreeNode[]; readonly keys: readonly string[]; } /** * The structural subset of {@link TreeDropContext} needed to apply a drop to a * tree root. Passed to `applyTreeDrop()` / `TreeDataModel.applyDrop()`. */ export interface TreeDropApplyContext { readonly source: `internal` | `external`; /** * For `internal` drops this is advisory — the nodes are re-resolved from the * live root by `draggedKeys`. For `external` drops it is the payload to insert. */ readonly dragged?: readonly TreeNode[]; readonly draggedKeys: readonly string[]; readonly target: TreeDropTarget; } export interface TreeDropContext extends TreeDropApplyContext { readonly dataTransfer: DataTransfer | null; } export interface TreeDropDetail extends TreeDropContext { readonly external?: readonly TreeNode[]; } export type TreeDragStartEvent = CustomEvent; export type TreeDragOverEvent = CustomEvent; export type TreeDropEvent = CustomEvent; export type TreeDragEndEvent = CustomEvent<{ dropped: boolean; }>; /** How `navigateTo` scrolls its target: edge-align it, or centre it when it is off screen. */ export type TreeRevealMode = `edge` | `center-if-hidden`; export type TreeNavigateOptions = { /** Scroll behaviour for the target (default `edge`). */ reveal?: TreeRevealMode; /** Suppress the `select` event this navigation would otherwise fire. */ silent?: boolean; /** * Whether to animate row enter/leave for this operation. * When omitted, uses the `animation` property value (`'auto'` by default). */ animate?: boolean; }; /** * Fired when the selection set changes by any means (click, keyboard, programmatic). * Event name: `select` */ export type TreeSelectDetail = { /** The new selection set. */ readonly selected: ReadonlySet; /** The previous selection set (empty set if there was no prior selection). */ readonly previous: ReadonlySet; /** * What caused the change: `programmatic` for `navigateTo` and friends, `user` * otherwise. Absent on components that do not distinguish the two. */ readonly origin?: `user` | `programmatic`; }; /** * Fired when an item enters cursor focus — either the pointer hovers over it, or * the keyboard navigation cursor moves to it. * Event name: `tickle` */ export type TreeTickleDetail = { readonly node: TreeNode; readonly depth: number; }; /** * Fired when the user explicitly activates an item (Enter key or double-click). * Event name: `activate` */ export type TreeActivateDetail = { readonly node: TreeNode; readonly depth: number; }; /** * Fired when the user clicks an item (raw pointer event, before any selection change). * Event name: `item-click` */ export type TreeItemClickDetail = { readonly node: TreeNode; readonly depth: number; }; /** * Fired when the user double-clicks an item. The second click of the pair is * swallowed, so a branch is never toggled open/closed by a double-click. * Event name: `item-dblclick` */ export type TreeItemDblClickDetail = { readonly node: TreeNode; readonly depth: number; }; /** * Fired when a node or column is expanded. * Event name: `expand` */ export type TreeExpandDetail = { readonly node: TreeNode; readonly depth: number; }; /** * Fired when a node or column is collapsed. * Event name: `collapse` */ export type TreeCollapseDetail = { readonly node: TreeNode; readonly depth: number; }; export type TreeSelectEvent = CustomEvent; export type TreeTickleEvent = CustomEvent; export type TreeActivateEvent = CustomEvent; export type TreeItemClickEvent = CustomEvent; export type TreeItemDblClickEvent = CustomEvent; export type TreeExpandEvent = CustomEvent; export type TreeCollapseEvent = CustomEvent; export interface TreeComponentEventMap { 'select': TreeSelectEvent; 'tickle': TreeTickleEvent; 'activate': TreeActivateEvent; 'item-click': TreeItemClickEvent; 'expand': TreeExpandEvent; 'collapse': TreeCollapseEvent; 'list-native-drag-start': CustomEvent>; 'tree-drag-start': TreeDragStartEvent; 'tree-drag-over': TreeDragOverEvent; 'tree-drop': TreeDropEvent; 'tree-drag-end': TreeDragEndEvent; } /** Options for `selectAll()` / `deselectAll()`. */ export type TreeSelectAllOptions = { /** Only act on rows that are showing (e.g. Ctrl+A), not those in collapsed branches. */ readonly visibleOnly?: boolean; }; /** * The common interface all tree-like components must implement. * * Use this interface when writing controllers or utilities that should work * across different tree component implementations. * * @example Writing a controller that works with any tree component: * ```typescript * function attachMyController(component: TreeComponent) { * component.addEventListener('select', e => console.log(e.detail.selected)); * } * ``` */ /** * Every tree component supports view-state snapshot / restore * (`getViewState` / `setViewState` / `clearPendingViewState`, see * `docs/infra-view-state.md`). Each narrows the state type with its own fields. */ export interface TreeComponent extends EventTarget, ViewStateful { /** * Root node of the tree. * Set this directly for static/fully-known trees. * Use `model` for lazy-loaded or programmatically mutated trees. */ root: TreeNode | undefined; /** * Optional data model providing lazy loading, caching, and mutation helpers. * When set, the component uses `model.getChildren()` instead of `loadChildren`, * and re-renders when the model notifies of root or invalidation changes. * `model` takes precedence over `loadChildren` when both are set. */ model: TreeDataModel | undefined; /** * Callback for lazily loading children of a node. * Superseded by `model` when both are set. * Kept for backwards compatibility and simple use-cases. */ loadChildren: LoadChildrenCallback | undefined; /** * The primary/most-recently selected node, or `undefined` if nothing is selected. * In multi-selection modes (e.g. `interactionMode='standard'` with Ctrl+click) this is the most recently added node. */ selectedNode: TreeNode | undefined; /** * The full selection set. Always in sync with `selectedNode`. * Empty set when nothing is selected. */ readonly selectedNodes: ReadonlySet; /** * Restricts which kinds of nodes may be selected. Applied as a guard in all interaction modes. * Reflected as the `selection-filter` attribute. * @default 'leaf' */ selectionFilter: TreeSelectionFilter; /** * Predicate used by search/filter controllers. * When set, nodes for which the predicate returns `false` (and which have no * matching descendants) are hidden from the rendered output. */ filterPredicate: TreeFilterPredicate | undefined; /** * Controls how expanding one node affects other expanded nodes. * Reflected as the `exclusivity` attribute. * @default 'none' */ exclusivity: TreeExclusivity; /** Select `node`, replacing any current selection. Respects `selectionFilter` — no-op if the node is not selectable. */ select: (node: TreeNode) => void; /** Remove `node` from the selection. */ deselect: (node: TreeNode) => void; /** Clear the entire selection. */ clearSelection: () => void; /** * Select every selectable item — in tree components, including those inside * collapsed branches (only filter matches while a filter is active). Pass * `{ visibleOnly: true }` to limit it to the items showing. */ selectAll: (options?: TreeSelectAllOptions) => void; /** Mirror of `selectAll`: deselect the items it would select. */ deselectAll: (options?: TreeSelectAllOptions) => void; /** * Expand ancestors and select the node reached by following `keys` from the root's children. * Returns `true` if the path was found and applied. */ navigateTo: (keys: readonly string[], options?: TreeNavigateOptions) => boolean; /** * Expand ancestors and select the first node for which `predicate` returns `true`. * Returns `true` if a matching node was found. * @param predicate - Function to find the target node * @param animate - Whether to animate row enter/leave. When omitted, uses the `animation` property value. */ navigateToNode: (predicate: (node: TreeNode) => boolean, animate?: boolean) => boolean; /** * Expand ancestors of the node with `key` and move the keyboard cursor to it, * scrolling it into view — **without** changing the selection. Returns `true` * if the node was found. Used by incremental-search "navigate" mode. * @param key - Key of the node to reveal * @param animate - Whether to animate row enter/leave. When omitted, uses the `animation` property value. */ revealKey: (key: string, animate?: boolean) => boolean; /** Replace the selection with `nodes` (subject to `selectionFilter`). Used by incremental-search "select" mode. */ selectMany: (nodes: Iterable) => void; /** * Returns all nodes currently visible in the rendered output, in render order, * with their depth (0-based, root's children are depth 0). */ getNodes: () => ReadonlyArray<{ node: TreeNode; depth: number; }>; } /** * Extended interface used by search/filter controllers. * Both TreeBaseElement and MillerBaseElement implement this. * * Replaces the previous separate `TreeSearchHost` / `MillerSearchHost` types * in `searchable.ts`. The unified `filterPredicate` signature (with `depth`) * allows a single search controller implementation to work with all tree components. */ export interface TreeSearchHost extends TreeComponent { readonly shadowRoot: ShadowRoot | null; readonly updateComplete: Promise; } /** * Drop keys whose ancestor is also being dragged — only the top-most selected * nodes move; their subtrees travel with them. Preserves input order. */ export declare function pruneDraggedDescendants(root: TreeNode, keys: readonly string[]): string[]; /** * Framework-agnostic drop application. Given the current immutable `root` and a * resolved drop context, returns a **new** root with the drop applied, or the * unchanged `root` when the drop is invalid (dragged node into its own subtree, * missing reference, empty payload). Never throws, never mutates. * * The insertion point is re-derived from `target.referenceKey` + `target.position` * against the post-removal tree, so same-parent reorders are off-by-one-safe and * multi-node drops land as siblings in drag order. `target.index` is honoured only * for `position: 'inside'` (0 = first child, large = append). */ export declare function applyTreeDrop(root: TreeNode, ctx: TreeDropApplyContext): TreeNode; /** Build a synthetic `TreeDropTarget` for programmatic moves (see `TreeDataModel`). */ export declare function dropTargetFor(referenceKey: string, position: TreeDropPosition, index?: number): TreeDropTarget; export type ViewStateBinding = { /** Return the previously saved state, or nothing. Called once, immediately. */ readonly load: () => Partial | null | undefined; /** Store the state. Called after debounced changes and on `pagehide`. */ readonly save: (state: S) => void; /** * Also save changes caused by restoring (pending state being applied). * Default `false` — they only echo what `load()` returned. */ readonly saveOnRestore?: boolean; }; /** Whether `el` implements the view-state API. */ export declare function isViewStateful(el: unknown): el is ViewStateful & EventTarget; /** * Wire a component's view state to storage the host controls. Loads and * applies once, then saves on every `view-state-change` and when the page is * hidden. Returns a function that stops saving. * * ```ts * const stop = bindViewState(tree, { * load: () => JSON.parse(localStorage.getItem(`files`) ?? `null`), * save: s => localStorage.setItem(`files`, JSON.stringify(s)), * }); * ``` */ export declare function bindViewState(el: ViewStateful & EventTarget, binding: ViewStateBinding): () => void; /** * Pure helpers for *pending* view state: keyed intent that is waiting for a * matching item to appear in the data. * * Pending sets / maps are insertion-ordered (oldest first) and capped so a * long-running app with churning data can't grow them without bound. */ /** Default cap on pending keys per facet. Oldest entries are dropped first. */ export declare const MAX_PENDING_KEYS = 2000; export type PendingKeys = ReadonlySet; export type PendingFlags = ReadonlyMap; export declare const EMPTY_KEYS: PendingKeys; export declare const EMPTY_FLAGS: PendingFlags; /** * Split `keys` into those `has` reports present (to apply now) and those * still missing (to keep pending). Returns the input set untouched as * `missing` when nothing matched, so callers can cheaply detect "no change". */ export declare function partitionKeys(keys: PendingKeys, has: (key: string) => boolean): { readonly present: readonly string[]; readonly missing: PendingKeys; }; /** As {@link partitionKeys}, for keyed boolean flags (e.g. expanded / collapsed). */ export declare function partitionFlags(flags: PendingFlags, has: (key: string) => boolean): { readonly present: ReadonlyArray; readonly missing: PendingFlags; }; /** Keep at most `max` keys, dropping the oldest. */ export declare function capKeys(keys: PendingKeys, max?: number): PendingKeys; /** Keep at most `max` flags, dropping the oldest. */ export declare function capFlags(flags: PendingFlags, max?: number): PendingFlags; /** `flags` without `key` (same instance when absent). */ export declare function withoutFlag(flags: PendingFlags, key: string): PendingFlags; /** JSON record → flags map. Non-boolean values are ignored. */ export declare function flagsFromRecord(record: Readonly> | undefined): PendingFlags; /** * Combine pending and live flags into one JSON record. Live entries win when * a key is in both (it shouldn't be — matched keys leave pending). */ export declare function flagsToRecord(...sources: Array>): Record; /** Pending keys followed by live keys, de-duplicated, as a JSON array. */ export declare function keysToArray(...sources: Array>): string[]; /** Map `keys` to `true` flags — for components that record a plain key set. */ export declare function keysAsFlags(keys: Iterable, value?: boolean): Iterable; /** * Scroll-position helpers. A raw `scrollTop` is wrong as soon as anything is * inserted above it, so view state records the first visible item's key plus * an offset into it, and falls back to pixels only when nothing is keyed. */ export type ScrollAxis = `vertical` | `horizontal`; /** * Capture a {@link ScrollState} for a DOM-rendered list. `items` must be in * visual order along `axis`; the first one whose far edge is below / right of * the viewport start is the anchor (found by binary search). */ export declare function captureElementScroll(viewport: HTMLElement, items: readonly Element[], getKey: (el: Element) => string | undefined, axis?: ScrollAxis): ScrollState; /** * Scroll `viewport` so `item` sits at the anchor's offset. Returns `false` * when the viewport can't scroll far enough yet (content still arriving), * so the caller can keep the anchor pending. */ export declare function restoreElementScroll(viewport: HTMLElement, item: Element, offset: number, axis?: ScrollAxis): boolean; /** * Set the scroll offset along `axis`. Returns `false` when `target` is beyond * the current scroll range (it is clamped and should be retried later). */ export declare function scrollToOffset(viewport: HTMLElement, target: number, axis?: ScrollAxis): boolean; /** * Anchor for a virtualised list with arithmetic row geometry: pass the first * visible index, the key at that index and that row's start offset. */ export declare function anchorFromRow(scrollOffset: number, key: string | undefined, rowStart: number, crossOffset?: number): ScrollState; /** * Call `onIntent` the first time the user does something that scrolls or * moves within `target` (wheel, touch, pointer on the scrollbar, navigation * key). Used to cancel a pending scroll restore — the user's own scroll wins. * Programmatic `scrollTop` writes do not trigger it. Returns a disposer. */ export declare function onUserScrollIntent(target: EventTarget, onIntent: () => void): () => void; export type ViewStateControllerOptions = { /** Component kind written into every state, e.g. `tree-list`. */ readonly kind: string; /** Build the full current state (pending included). Called when the change event fires. */ readonly capture: () => S; /** Trailing debounce for `view-state-change`, ms. Default 150. */ readonly debounceMs?: number; }; /** * Plumbing shared by every view-stateful component: * * - **change events** — `notify(reason)` coalesces changes into one debounced * `view-state-change` event (strongest reason wins: user > data > restore), * flushed immediately on disconnect so the last change is never lost. * - **restore marking** — changes made inside `restoring(fn)` are reported as * `restore`, so persistence code can skip writing back what it just loaded. * - **validation** — `accepts(state)` rejects a state for another kind / version. * - **pending scroll** — a scroll position waiting for its anchor item (or for * enough content). Cancelled by the user's own scroll intent on the target * given to `observeScrollTarget()`. * * The component owns its facets (selection, expansion, columns) and decides * what's pending; this controller only carries the cross-cutting parts. */ export declare class ViewStateController implements ReactiveController { #private; constructor(host: ReactiveControllerHost & EventTarget, options: ViewStateControllerOptions); get kind(): string; hostConnected(): void; hostDisconnected(): void; /** Record a change. Inside `restoring()` the reason is forced to `restore`. */ notify(reason?: ViewStateChangeReason): void; /** Fire any pending change event now. */ flush(): void; /** Run `fn` with every `notify()` inside it reported as `restore`. */ restoring(fn: () => T): T; /** True while inside `restoring()`. */ get isRestoring(): boolean; /** Whether `state` is for this component kind and schema version. Warns when not. */ accepts(state: Partial | null | undefined): state is Partial; /** * Stamp `v` / `kind` onto `fields` and apply `include`. Components build * their full field set and pass it through here from `getViewState()`. */ shape(fields: Omit, options?: GetViewStateOptions): S; /** * Watch `target` for user scroll intent (wheel / touch / pointer / nav key); * any intent drops the pending scroll. Call again if the scroll container * is replaced. */ observeScrollTarget(target: EventTarget): void; get pendingScroll(): ScrollState | undefined; set pendingScroll(scroll: ScrollState | undefined); /** * Try the pending scroll with `apply`; it returns `true` once the position * was fully reached (anchor present, content long enough), which clears it. * Call after each render that may have added items. */ applyPendingScroll(apply: (scroll: ScrollState) => boolean): void; /** * Call from the viewport's `scroll` listener. Ignored while a scroll restore * is still pending; the event caused by a restore's own write is reported * as `restore`, anything else as `user`. */ notifyScroll(): void; } /** Tree layout/display configuration (tree-specific, not shared). */ export type TreeConfig = { indent: number; }; /** * Pure view-state helpers for `ixfx-crumb-navigation` (also used by * `ixfx-flat-list`, whose location is the same kind of key path). * See docs/infra-view-state.md. */ /** * `ixfx-crumb-navigation` view state. The location *is* the selection (one * node), so it is stored once, as the key path that reaches it — a path, not * a lone key, so a saved location deep in a lazy tree can be loaded down to. */ type CrumbNavigationViewState = ViewStateBase & { /** Keys from the root (excluded) down to the current location. `[]` = the root. */ readonly path?: readonly string[]; }; export type NarrowedTextItem = Readonly<{ value: string; label?: string; description?: string; iconName?: string; selected?: boolean; }>; export type NarrowedTextChangeDetail = { readonly item: NarrowedTextItem | undefined; readonly query: string; readonly selected: readonly NarrowedTextItem[]; }; export type NarrowedTextChangeEvent = CustomEvent; export type SelectionMode = `single` | `multi`; export type Orientation = `horizontal` | `vertical`; export type FuzzySearchResult = { item: NarrowedTextItem; positions: ReadonlySet; score: number; }; export declare class NarrowedTextElement extends LitElement { #private; selectionMode: SelectionMode; requiredSelection: boolean; orientation: Orientation; nowrap: boolean; separator: string; width: string | undefined; height: string | undefined; preserveFilter: boolean; value: string; registry: CommandRegistry | undefined; /** * The options, as data. When set, it replaces the `` children (which cost a DOM element * per option: ~100 bytes of JS plus ~1 KB of DOM each at 100k). Not read from attributes. */ items: readonly NarrowedTextItem[] | undefined; private _query; private _computedItems; private _filteredItems; /** How many of `_filteredItems` are in the DOM; the rest render as the end of the list scrolls into view. */ private _renderLimit; private _isFocused; private _slot; private _selectedValues; private _ownedRegistry; private _search; private _searchState; private _unsubSearch; private tickled; get selected(): string | string[]; set selected(value: string | string[]); selectAll(): void; deselectAll(): void; connectedCallback(): void; disconnectedCallback(): void; protected firstUpdated(): void; protected willUpdate(changedProperties: PropertyValues): void; protected updated(changedProperties: PropertyValues): void; private _updateComputedItems; private _updateSelectedFromValue; private _updateFilteredItems; private _applyHighlights; focus(): void; blur(): void; setContents(contents: NarrowedTextItem[]): void; deleteItem(value: string): boolean; private _selectItem; private _updateValueFromSelected; protected render(): import("lit").TemplateResult<1>; private _getContainerStyle; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-narrowed-text': NarrowedTextElement; } } /** @deprecated Use TreeSelectDetail from src/common/tree-component.ts */ export type CrumbNavigationChangeDetail = { readonly selected: TreeNode; readonly previous: TreeNode | undefined; }; export type CrumbNavigationChangeEvent = CustomEvent; export type CrumbNavigationItemClickDetail = { node: TreeNode; depth: number; }; export type CrumbNavigationItemClickEvent = CustomEvent; export type CrumbNavigationExpandDetail = { node: TreeNode; depth: number; }; export type CrumbNavigationExpandEvent = CustomEvent; /** * Breadcrumb navigation with lazy-loading support. * * Uses the same `TreeNode` / `TreeItem` data model as `ixfx-tree-list`, * so the two components can be swapped with minimal code changes. * * Events * - `navigate`: fired when user clicks a breadcrumb label. detail: `{ node: TreeNode }` * - `change`: fired when selected node changes. detail: `{ selected: TreeNode, previous: TreeNode | undefined }` * - `expand`: fired when user clicks a caret whose node has no children yet. * detail: `{ node: TreeNode, depth: number, signal: AbortSignal }` * Populate `node.children` then call `requestUpdate()` on the element. * * CSS variables * --crumb-item-bg: var(--item-bg, transparent); // item background * --crumb-item-bg-tickled: var(--item-bg-tickled); // item background on hover * --crumb-item-text-tickled: var(--item-text-tickled); // text color on hover * --crumb-item-border: var(--item-border); // item border * --crumb-item-border-tickled: var(--item-border-tickled); // border color on hover * --crumb-item-padding: var(--item-padding, var(--space-xs)); // item padding * --crumb-item-border-radius: var(--item-border-radius); // item border radius * --crumb-item-gap: var(--item-gap, var(--space-xs)); // gap between items * --crumb-separator: var(--surface-muted-text); // separator/caret color * --crumb-truncate-min-width: 5ch; // minimum width for truncatable segments */ export declare class CrumbNavigationElement extends LitElement implements TreeComponent { #private; root: TreeNode | undefined; model: TreeDataModel | undefined; selectedNode: TreeNode | undefined; private _selectedNodes; get selectedNodes(): ReadonlySet; /** Callback to lazily load children for a node. When set, replaces event-based lazy loading. */ loadChildren: LoadChildrenCallback | undefined; filterPredicate: TreeFilterPredicate | undefined; exclusivity: TreeExclusivity; selectionFilter: TreeSelectionFilter; private _openIdx; private _isFocused; private _menuOpen; /** Which segment menu is open (`:s` sibling menu, `:c` child menu): only that one has items in the DOM. */ private _menuKey; /** How many of the open menu's items are rendered. */ private _menuLimit; private _focusOnNarrowedText; inputMode: string; noTruncate: boolean; showSuggestions: boolean; leadingCaret: boolean; caretEmbedded: boolean; hideRoot: boolean; padEnding: boolean; withUp: boolean; /** * Whether restoring view state may call `loadChildren` to reach a saved * location through unloaded branches (one load at a time). Default `true`. */ restoreLoads: boolean; private tickled; select(node: TreeNode): void; deselect(_node: TreeNode): void; clearSelection(): void; /** Not implemented on crumb-navigation. */ selectAll(): void; /** Not implemented on crumb-navigation. */ deselectAll(): void; getNodes(): ReadonlyArray<{ node: TreeNode; depth: number; }>; /** Snapshot the location as a key path. Includes a saved location not reached yet. */ getViewState(options?: GetViewStateOptions): CrumbNavigationViewState; /** * Go to a saved location. Keys not loaded yet are reached as they appear — * via `loadChildren` when `restoreLoads` — moving through each loaded ancestor. */ setViewState(state: Partial): void; clearPendingViewState(): void; willUpdate(changedProps: PropertyValues): void; updated(changedProps: PropertyValues): void; connectedCallback(): void; disconnectedCallback(): void; firstUpdated(): void; /** Navigate to a node by key path. Returns false if any key is not found in already-loaded children. */ navigateTo(keys: readonly string[]): boolean; /** Navigate to the first node matching the predicate. Returns false if not found. */ navigateToNode(predicate: (node: TreeNode) => boolean): boolean; /** `TreeComponent` parity — a crumb path always follows the selection, so this just navigates to `key`. */ revealKey(key: string): boolean; /** `TreeComponent` parity — a crumb path is a single selection, so only the last node is kept. */ selectMany(nodes: Iterable): void; render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { "ixfx-crumb-navigation": CrumbNavigationElement; } } export interface CrumbNavigationElementEventMap extends TreeComponentEventMap { 'item-click': TreeItemClickEvent; 'expand': TreeExpandEvent; 'select': TreeSelectEvent; 'tickle': TreeTickleEvent; 'activate': TreeActivateEvent; } export interface CrumbNavigationElement { addEventListener: ((type: K, listener: (this: CrumbNavigationElement, event: CrumbNavigationElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } /** * A structured path segment. `label` is the displayed text and may contain any * character, including the display separator. `value` is an optional opaque * identity the host can round-trip (e.g. an id) — reported back via the * `segments` field on `navigate` / `change` events. */ export type CrumbPathSegment = { label: string; value?: string; }; export type CrumbSegment = { label: string; /** Carried onto the matching `CrumbPathSegment` when this sibling is chosen. */ value?: string; icon?: string; isLeaf?: boolean; }; export type CrumbSiblingLookupFn = (pathSegments: string[], index: number, signal: AbortSignal) => Promise; export type SegmentIconLookupFn = (pathSegments: string[], index: number) => string | undefined; export type CrumbNavNavigateDetail = { index: number; label: string; parentPath: string; fullPath: string; /** The new structured path (excluding `pathRoot`). Present when the `segments` property is in use. */ segments?: CrumbPathSegment[]; }; export type CrumbNavNavigateEvent = CustomEvent; export type CrumbNavChangeDetail = { label: string; parentPath: string; fullPath: string; /** The new structured path (excluding `pathRoot`). Present when the `segments` property is in use. */ segments?: CrumbPathSegment[]; }; export type CrumbNavChangeEvent = CustomEvent; export type CrumbNavExpandDetail = { index: number; segments: string[]; path: string; signal: AbortSignal; }; export type CrumbNavExpandEvent = CustomEvent; /** A MIME-typed payload written to the drag's `DataTransfer` when a segment drag starts. */ export type CrumbSegmentDragData = { /** MIME type, e.g. `text/plain` or an application-specific type. */ type: string; /** Payload string for `type`. */ data: string; }; /** * Consulted per segment with the full cumulative path (including any * `pathRoot` prefix). Returning drag data marks the segment `draggable`; * returning `undefined` leaves it alone. Called at render time (to mark the * segment) and again during `dragstart` (for fresh payload data). */ export type CrumbSegmentDragLookupFn = (pathSegments: string[], index: number) => CrumbSegmentDragData | readonly CrumbSegmentDragData[] | undefined; /** * Interprets a drop landing on a segment. Return `undefined` for drops the * app does not handle — no `crumb-drop` event fires for them. Only * `dataTransfer.types` is reliably readable during `dragover`; full data is * readable at `drop`. */ export type CrumbExternalDropParser = (dataTransfer: DataTransfer) => unknown; export type CrumbDragStartDetail = { /** Index of the dragged segment within `pathSegments`. */ index: number; label: string; /** Full cumulative path segments, including any `pathRoot` prefix. */ pathSegments: string[]; parentPath: string; fullPath: string; /** Null in stubbed environments; normally present during a real `dragstart`. */ dataTransfer: DataTransfer | null; }; export type CrumbDragStartEvent = CustomEvent; export type CrumbDropDetail = { /** Index of the drop segment within `pathSegments`. */ index: number; label: string; /** Full cumulative path segments, including any `pathRoot` prefix. */ pathSegments: string[]; parentPath: string; fullPath: string; /** Result of `parseExternalDrop` — always defined; unparsed drops emit nothing. */ data: unknown; dataTransfer: DataTransfer; }; export type CrumbDropEvent = CustomEvent; export declare class CrumbPathElement extends LitElement { #private; /** * Text path, split on `separator`. Use `segments` instead when a label may * contain the separator. When `segments` is set it takes precedence and this * property holds the derived display text (labels joined by `separator`). */ path: string; /** * Structured path (excluding `pathRoot`). Labels may contain any character, * including `separator`. Takes precedence over `path`, which is derived from * it. Set to `undefined` to go back to the text `path`. */ segments: CrumbPathSegment[] | undefined; separator: string; pathRoot: string; siblingLookup: CrumbSiblingLookupFn | undefined; segmentIconLookup: SegmentIconLookupFn | undefined; /** Marks segments draggable and supplies their drag payloads. */ segmentDragLookup: CrumbSegmentDragLookupFn | undefined; /** Interprets drops landing on segments; enables drop targeting when set. */ parseExternalDrop: CrumbExternalDropParser | undefined; /** * When enabled, navigating up (clicking an earlier real segment) keeps * rendering the segments beyond it as translucent, non-interactive-drag, * click-to-restore "virtual" segments — for as long as the current path * stays a prefix of the deepest path visited. See `#recordHintOnShorten`. */ hintPrevious: boolean; private _openIdx; private _editing; private _cachedSiblings; private _leafSegmentIndex; private _confirmedLeafIndices; private _dropdownActiveIndex; private _editingCancelled; private _editStartIndex; private _openCumPath; /** Cumulative path of the segment currently being dragged out (`.dragging`). */ private _dragCumPath; /** Cumulative path of the segment currently hovered by an external drag (`.drop-into`). */ private _dropCumPath; /** Deepest relative-segment path visited, kept so it can be restored via virtual segments. */ private _hintSegments; protected updated(changedProperties: PropertyValues): void; protected willUpdate(changed: PropertyValues): void; /** Structured segments, or the text path parsed into value-less segments. */ getSegments(): CrumbPathSegment[]; setPath(newPath: string): void; /** Drop cached dropdown siblings (and leaf detection) so they are looked up again. */ invalidateSiblings(): void; getPath(): string; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-crumb-path': CrumbPathElement; } } export interface CrumbPathElementEventMap { "navigate": CrumbNavNavigateEvent; "change": CrumbNavChangeEvent; "expand": CrumbNavExpandEvent; 'crumb-drag-start': CrumbDragStartEvent; 'crumb-drop': CrumbDropEvent; } export interface CrumbPathElement { addEventListener: ((type: K, listener: (this: CrumbPathElement, event: CrumbPathElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } export type SortCompareFn = (a: CrumbSegment, b: CrumbSegment) => number; export type CrumbPathControllerOptions = { separator?: string; paths?: string[]; onQuery?: (pathSegments: string[]) => Promise; sortCompare?: SortCompareFn | null; }; export declare class CrumbPathController { #private; constructor(options?: CrumbPathControllerOptions); get separator(): string; addPath(path: string): void; addPaths(paths: string[]): void; addSegment(segment: CrumbSegment, path: string): void; addSegments(entries: Array<{ path: string; segment: CrumbSegment; }>): void; getIcon(cumulativePath: string): string | undefined; getPath(): string; setPath(path: string): void; connect(element: CrumbPathElement): void; disconnect(): void; } export type RendererStyle = `led` | `plot` | `plot-xy` | `plot-heat` | `plot-histogram` | `time-elapsed` | `hide`; export type ConfigEntry = readonly [path: string, style: RendererStyle, options?: Record]; export type FormattingOptions = { readonly precision?: number; readonly roundNumbers?: number; }; export declare class DataDisplayComponent extends LitElement { #private; static styles: import("lit").CSSResult[]; automap: boolean; previousValue: Record | undefined; _container: HTMLElement; constructor(); connectedCallback(): void; configure(config: ConfigEntry[]): void; formatValue(v: unknown, options?: FormattingOptions): string; displayData(o: Record | unknown[]): void; updateData(value: Record): void; getOrCreate(path: string, init?: (parent: HTMLElement) => void): HTMLElement; } declare global { interface HTMLElementTagNameMap { 'ixfx-data-display': DataDisplayComponent; } } /** * Caller-assigned item tags, shared by every list-like component * (`ixfx-grid-list`, `ixfx-detail-list`, `ixfx-data-grid`, `ixfx-multicol-list`). * * What a tag *means* belongs to the caller. The component only * * 1. exposes it for styling: a `tag-` token in the item's `part`, and * `data-tags` (space-separated, so `[data-tags~="foo"]` matches); * 2. applies the generic interaction flags declared for it in `tagBehaviour`. * * Tokens are prefixed so a caller tag called `selected` cannot collide with * the built-in state token. */ /** Generic interaction flags a tag can switch off. Omitted flags keep the default (`true`). */ type ItemTagBehaviourFlags = { /** `false`: no selection or tickle, no `list-select-intent`; range and select-all skip the item. */ selectable?: boolean; /** `false`: keyboard cursor movement skips the item. */ focusable?: boolean; /** `false`: no drag starts from the item. */ draggable?: boolean; /** `false`: the item is left out of incremental search. */ searchable?: boolean; /** * `false`: the item can't be moved by drag-to-reorder (`items-reorderable`). It is left out of a * dragged block, so the rest of a multi-selection still moves. A gap next to it can still be targeted. */ reorderable?: boolean; }; /** Behaviour declarations keyed by tag name. */ type ItemTagBehaviour = Readonly>; /** Tag assignment by key set: tag name → keys that carry it. Like `partialKeys`, for tags kept apart from the data. */ type ItemTagKeys = ReadonlyMap>; /** The effective flags for an item: every flag is explicit. */ type ResolvedItemTagFlags = Required; export declare const DEFAULT_ITEM_TAG_FLAGS: ResolvedItemTagFlags; /** Prefix of a tag's `part` token. */ export declare const TAG_PART_PREFIX = "tag-"; /** * Merge the tags from the per-item hook and from `tagKeys`, de-duplicated, * in first-seen order. Empty and whitespace-containing names are dropped * (they could not be a single `part` token). */ export declare function collectTags(key: string | undefined, fromHook: readonly string[] | undefined, tagKeys: ItemTagKeys | undefined): readonly string[]; /** Most restrictive wins: any `false` among the item's tags beats the default and any `true`. */ export declare function resolveTagFlags(tags: readonly string[], behaviour: ItemTagBehaviour | undefined): ResolvedItemTagFlags; /** ` tag-foo tag-bar` — append to a `part` value. Empty string when there are no tags. */ export declare function tagPartTokens(tags: readonly string[]): string; /** Value for `data-tags` (`"foo bar"`), or `undefined` when there are no tags. */ export declare function tagsAttribute(tags: readonly string[]): string | undefined; /** Reflect tags onto an element (element mode / light DOM): `data-tags`, and `tag-*` tokens in `part` it didn't set. */ export declare function applyTagAttributes(el: Element, tags: readonly string[], basePart?: string): void; /** Whether two tag lists are identical (order matters; lists are tiny). */ export declare function sameTags(a: readonly string[], b: readonly string[]): boolean; /** Whether two `tagKeys` maps hold the same tags with the same keys. */ export declare function sameTagKeys(a: ItemTagKeys | undefined, b: ItemTagKeys | undefined): boolean; /** * Per-component holder for the two assignment forms and `tagBehaviour`. * Resolves an item's tags and flags; caches nothing (callers re-render on change). */ export declare class ItemTagResolver { tagKeys: ItemTagKeys | undefined; behaviour: ItemTagBehaviour | undefined; /** Tags for an item, merging the hook's result with `tagKeys`. */ tagsFor(key: string | undefined, fromHook?: readonly string[]): readonly string[]; flagsFor(tags: readonly string[]): ResolvedItemTagFlags; /** Convenience: flags for an item straight from its key and hook result. */ flagsForItem(key: string | undefined, fromHook?: readonly string[]): ResolvedItemTagFlags; } /** * Shared types for positional drops and drag-to-reorder on the list components * (`ixfx-grid-list`, `ixfx-data-grid`, `ixfx-detail-list`, `ixfx-vertical-list`, * `ixfx-flat-list`). */ /** * Which targets a drag can resolve to. * - `on`: onto an item. * - `between`: into the gap between two items. * - `both`: either — the outer quarters of an item (on the flow axis) mean `between`, the middle half means `on`. */ type ListDropPositions = `on` | `between` | `both`; /** * Why `between` targets are refused, because the visible order is not the item order. * `on` drops still work. */ type ListReorderBlocked = `sorted` | `grouped`; /** The gap a `between` target names. */ type ListDropBetween = { readonly kind: `between`; /** * The item the insertion goes **before** (the one after the gap), in the full, unfiltered * item order. `undefined` at the end of the list. */ readonly beforeKey: string | undefined; /** * The item the insertion goes **after** (the one before the gap), in the full, unfiltered * item order. `undefined` at the start of the list. */ readonly afterKey: string | undefined; /** Insertion index into the full (unfiltered) item order. */ readonly index: number; }; /** * What a drag is over. * * `between` is reported in **full item order** (the unfiltered items the host set), not * visible order. When a filter hides items between two visible neighbours, the drop goes * directly after the visible item before the gap: `afterKey` is that visible item and * `beforeKey` is whatever follows it in full order. */ type ListDropTarget = { readonly kind: `on`; readonly key: string; } | ListDropBetween | { readonly kind: `empty`; }; /** `list-drop` — an external drag was dropped. */ type ListTargetDropDetail = { readonly target: ListDropTarget; readonly dataTransfer: DataTransfer; /** `ixfx-vertical-list` only, kept for older hosts: the key of an `on` target. Use `target`. */ readonly key?: string | undefined; /** `ixfx-vertical-list` only, kept for older hosts: the element of an `on` target. Use `target`. */ readonly item?: Element | undefined; }; /** `list-reorder` — a drag that started in this list ended between its own items. Cancelable. */ type ListReorderDetail = { /** The dragged block, in display order. */ readonly keys: readonly string[]; readonly target: ListDropBetween; }; type ListTargetDropEvent = CustomEvent; type ListReorderEvent = CustomEvent; /** Gate on every `dragover`, given the resolved target. `false` ⇒ no indicator and no event. */ type ListCanDrop = (target: ListDropTarget, dataTransfer: DataTransfer) => boolean; /** Gate for internal moves (`false` ⇒ no indicator and no event). */ type ListCanReorder = (keys: readonly string[], target: ListDropBetween) => boolean; /** * Lets a host that cancels the browser drag (to start an OS drag in its place) still say which * keys a drag carries. Return `undefined` for a drag that is not the host's own. */ type ListResolveInternalDrag = (dataTransfer: DataTransfer) => readonly string[] | undefined; /** Read access to the full (unfiltered) item order. */ type ListFullOrder = { readonly count: number; keyAt: (index: number) => string | undefined; /** Index of `key` in the full order, or `-1`. */ indexOf: (key: string) => number; }; /** * Shared list viewport-change types. * * The push counterpart of the synchronous `renderedKeys()` / `visibleKeys()` * read APIs: dispatched by the list-flavoured components whenever their * rendered or visible key set changes (scroll, resize, content change), so * consumers can prioritise per-viewport work without polling. * * Each component uses its own public event name while sharing this detail * shape: `detail-list-viewport-change`, `vertical-list-viewport-change`, * `grid-list-viewport-change`, and `datagrid-viewport-change`. */ type ListViewportChangeDetail = { /** Keys of the rendered window (viewport + overscan where virtualized). */ readonly renderedKeys: readonly string[]; /** Keys strictly intersecting the viewport. */ readonly visibleKeys: readonly string[]; }; type ListViewportChangeEvent = CustomEvent; type ListSelectionMode = `none` | `single` | `multiple`; /** * Controls how pointer and keyboard gestures map to selection changes. * * - `implicit` — click always replaces selection (no modifier support) * - `standard` — click replaces; Ctrl/Cmd+click toggles; Shift+click range-selects (multiple only) * - `manual` — no auto-selection; drive state via select()/deselect()/clearSelection() * - `checked` — every click toggles; implies multiple selection regardless of selectionMode * - `sticky` — every tap/click toggles (no checkbox column); implies multiple selection, for touchscreens * - `vscode` — like standard for clicks; Shift+Arrow extends range from the keyboard anchor * * Switching interactionMode clears the current selection. */ type ListInteractionMode = `implicit` | `standard` | `manual` | `checked` | `sticky` | `vscode`; type ListSelectDetail = { readonly selected: ReadonlySet; readonly previous: ReadonlySet; /** * The selection as stable key strings (`data-key` / `data-value`). Empty * when items carry no key. Additive to `selected`. */ readonly selectedKeys: ReadonlySet; /** The previous selection as keys. Additive to `previous`. */ readonly previousKeys: ReadonlySet; }; /** * The key-based subset of `list-select` detail common to every list-like * component (including `ixfx-data-grid`), so one adapter can read any of them. */ type ListSelectKeysDetail = Pick; /** * What the user (or API) is trying to do to the selection. See * {@link ListSelectIntentDetail}. */ type ListSelectIntentKind = `replace` | `toggle` | `extend` | `all` | `marquee` | `match` | `clear`; /** * How a `marquee` combines the covered keys with the current selection: * `replace` (plain drag: the selection becomes the covered keys), `add` * (Shift-drag: covered keys are added), `toggle` (Cmd/Ctrl-drag: each covered * key flips, so a drag can deselect). */ type ListMarqueeMode = `replace` | `add` | `toggle`; type ListSelectIntentSource = `pointer` | `keyboard` | `touch` | `api`; /** * Detail of the cancelable `list-select-intent` event: fired *before* a * component changes its selection, in every interaction mode (including * `manual`). Calling `preventDefault()` means "the caller applies this * itself" — the component then changes nothing (cursor and range anchor still * move). Without `preventDefault()` behaviour is unchanged. * * Only gestures and `selectAll()` fire it. The imperative `select()` / * `selectKeys()` / `clearSelection()` family never does, so a handler can * apply its decision through them without re-entering itself. */ type ListSelectIntentDetail = { readonly kind: ListSelectIntentKind; /** Keys directly affected. Empty for `all` / `clear`. For `extend`, the range (a convenience: callers should use the endpoints). */ readonly keys: readonly string[]; /** Range anchor, for `extend`. */ readonly anchorKey?: string; /** Range end, for `extend`. */ readonly targetKey?: string; /** `marquee`: a modifier was held, i.e. `mode` is not `replace`. */ readonly additive?: boolean; /** `marquee`: how the covered `keys` combine with the selection. */ readonly mode?: ListMarqueeMode; /** `match`: the search text. `keys` holds the current matches (a convenience). */ readonly query?: string; /** * `all`: the group the select-all is confined to (grouped lists with * cross-group selection off). Absent when it is not confined to a group. */ readonly groupKey?: string | null; /** * `toggle` from a branch checkbox in a tree: the toggle applies to the node * and every loaded node under it (`keys` lists them), as a rule rather than * a key list. */ readonly descendants?: boolean; /** `toggle` with `descendants`: the state the branch is being set to (`true` = checked). */ readonly checked?: boolean; /** Multi-column lists (`ixfx-multicol-list`): the column the intent is for. Keys are that column's item keys. */ readonly columnId?: string; readonly source: ListSelectIntentSource; }; type ListTickleDetail = { readonly item: Element; }; type ListActivateDetail = { readonly item: Element; }; type ListItemClickDetail = { readonly item: Element; }; type ListSelectEvent = CustomEvent; type ListSelectIntentEvent = CustomEvent; type ListTickleEvent = CustomEvent; type ListActivateEvent = CustomEvent; type ListItemClickEvent = CustomEvent; interface ListElementEventMap { 'list-select': ListSelectEvent; 'list-select-intent': ListSelectIntentEvent; 'list-tickle': ListTickleEvent; 'list-activate': ListActivateEvent; 'list-item-click': ListItemClickEvent; } type DataGridSelectionMode = `none` | `single` | `multiple`; type DataGridInteractionMode = `standard` | `implicit` | `manual` | `checked` | `sticky` | `vscode`; type DataGridSortDirection = `asc` | `desc`; type DataGridSortState = { readonly key: string; readonly direction: DataGridSortDirection; } | null; type DataGridDataType = `text` | `number` | `boolean` | `custom`; type DataGridEditorType = `auto` | `select`; type DataGridEditorContext = { readonly row: R; readonly column: DataGridColumn; readonly rowIndex: number; readonly colIndex: number; readonly value: unknown; /** Write `nextValue`, fire `datagrid-cell-edit` and close the editor. */ commit: (nextValue: unknown) => void; /** Record `nextValue` without closing. A popup editor commits it when dismissed by clicking outside. */ update: (nextValue: unknown) => void; /** Close the editor, discarding anything passed to `update`. */ cancel: () => void; }; type DataGridEditorFactory = (ctx: DataGridEditorContext) => unknown; type DataGridColumn = { key: string; label: string; width?: number; minWidth?: number; maxWidth?: number; visible?: boolean; sortable?: boolean; sortFn?: (a: R, b: R) => number; resizable?: boolean; reorderable?: boolean; align?: `left` | `center` | `right`; renderer?: (row: R, col: DataGridColumn, rowIndex: number) => unknown; selectable?: boolean; groupable?: boolean; editable?: boolean; dataType?: DataGridDataType; editor?: DataGridEditorType | DataGridEditorFactory; editorOptions?: ReadonlyArray; /** * Render the `editor` factory's output in a popup anchored to the cell instead of in place. The cell keeps * showing its value (via `renderer` / `formatter`). Clicking outside commits the last `ctx.update` value; * `Escape` cancels. */ editorPopup?: boolean; /** What opens the editor in `user` mode: `default` is a slow double-click, `click` a single click. Popup editors always open on a single click in `immediate` mode. */ editTrigger?: `default` | `click`; formatter?: (value: unknown, row: R, col: DataGridColumn) => unknown; button?: false | true | { icon?: string; }; /** Heading for this column in the built-in column menu; columns sharing a group are listed in one submenu. Ungrouped columns stay at the top level. */ group?: string; /** Pixels added to the measured text width when auto-sizing (e.g. a thumbnail beside the text). Lets a `renderer` column be auto-sized. */ fixedExtraWidth?: number; /** Custom content-width measure (px) for one row, used when auto-sizing. Lets a `renderer` column be auto-sized. */ measure?: (row: R, col: DataGridColumn) => number; }; type GlobalFormatter = (value: unknown, columnName: string, row: unknown) => unknown; /** * Optional appearance fields a row may carry, honoured only in the column * nominated by the matching grid property (`textColorColumn`, `iconColumn`, * `badgeColumn`). Read off the *row*, not off the nominated column's own * value, so one row can tint just one of its cells: * * ```ts * grid.textColorColumn = 'status'; * grid.rows = [{ status: 'failed', statusTextColor: 'crimson' }]; * ``` */ type DataGridRowLook = { /** CSS colour applied to the cell nominated by `textColorColumn`. */ textColor?: string; /** Icon content for the cell nominated by `iconColumn` — anything Lit can render. */ icon?: unknown; /** CSS colour tinting the row's `icon`. */ iconColor?: string; /** Finder-style badge for the cell nominated by `badgeColumn` — anything Lit can render. */ badge?: unknown; }; type DataGridEditability = `disabled` | `manual` | `user` | `immediate`; /** * How cell text that's too long for its column width is handled. * - `ellipsis` (default): CSS truncates with an ellipsis. * - `pan-text`: the cell swaps to an `ixfx-pan-text` (looping pan) while its * row is selected or tickled (hovered / keyboard cursor). */ type DataGridCellOverflow = `ellipsis` | `pan-text`; type BuiltInFormatterName = `fixed` | `percentage` | `integer`; type BuiltInFormatterOptions = { digits?: number; }; /** One replacement for `updateRows()`: the new row object for the row currently at `key`. */ type DataGridRowUpdate = { readonly key: string; readonly row: R; }; type DataGridGetRowKey = (row: R, index: number) => string; type DataGridGroupBy = string | ((row: R) => string); type DataGridGroupLabel = (groupKey: string, rows: readonly unknown[]) => string; /** Whether the data-grid renders its built-in header column/group menu. */ type DataGridColumnMenu = `auto` | `none`; /** * Pure view-state helpers for `ixfx-data-grid`. The grid runs these whenever * its rows or columns change, so state keyed to rows / columns that left the * data goes pending and comes back when those keys reappear. */ /** Saved layout for one column, keyed by column key in {@link DataGridViewState.columns}. */ type DataGridColumnViewState = { readonly width?: number; readonly visible?: boolean; /** Rank among the saved columns (lower is further left). */ readonly order?: number; }; /** * `ixfx-data-grid` view state. `expanded` is keyed by group key; groups * default to open, so a collapsed group is `false`. */ type DataGridViewState = ViewStateBase & { readonly columns?: Readonly>; /** Sorted column + direction; `null` means unsorted. */ readonly sort?: DataGridSortState; /** Group-by column key (`null` = ungrouped). Only recorded when `allowGrouping` is on. */ readonly groupBy?: string | null; }; interface Slab { i16: Int16Array; i32: Int32Array; } type Int32 = Int32Array[0]; type Rune = Int32; interface Result { start: number; end: number; score: number; } type AlgoFn = (caseSensitive: boolean, normalize: boolean, forward: boolean, input: Rune[], pattern: Rune[], withPos: boolean, slab: Slab | null) => [Result, Set | null]; type Casing = "smart-case" | "case-sensitive" | "case-insensitive"; interface FzfResultItem extends Result { item: U; positions: Set; } type Selector = BaseOptions["selector"]; type Tiebreaker = (a: FzfResultItem, b: FzfResultItem, selector: Selector) => number; interface BaseOptions { /** * If `limit` is 32, top 32 items that matches your query will be returned. * By default all matched items are returned. * * @defaultValue `Infinity` */ limit: number; /** * For each item in the list, target a specific property of the item to search for. */ selector: (v: U) => string; /** * Defines what type of case sensitive search you want. * * @defaultValue `"smart-case"` */ casing: Casing; /** * If true, FZF will try to remove diacritics from list items. * This is useful if the list contains items with diacritics but * you want to query with plain A-Z letters. * * @example * Zoë → Zoe * blessèd → blessed * * @defaultValue `true` */ normalize: boolean; /** * Fuzzy algo to choose. Each algo has their own advantages, see here: * https://github.com/junegunn/fzf/blob/4c9cab3f8ae7b55f7124d7c3cf7ac6b4cc3db210/src/algo/algo.go#L5 * If asssigned `false`, an exact match will be made instead of a fuzzy one. * * @defaultValue `"v2"` */ fuzzy: "v1" | "v2" | false; /** * A list of functions that act as fallback and help to * sort result entries when the score between two entries is tied. * * Consider a tiebreaker to be a [JS array sort](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) * compare function with an added third argument which is `options.selector`. * * If multiple tiebreakers are given, they are evaluated left to right until * one breaks the tie. * * Note that tiebreakers cannot be used if `sort=false`. * * FZF ships with these tiebreakers: * - `byLengthAsc` * - `byStartAsc` * * @defaultValue `[]` * * @example * ```js * function byLengthAsc(a, b, selector) { * return selector(a.item).length - selector(b.item).length; * } * * const fzf = new Fzf(list, { tiebreakers: [byLengthAsc] }) * ``` * This will result in following result entries having same score sorted like this: * FROM TO * axaa axaa * bxbbbb bxbbbb * cxcccccccccc dxddddddd * dxddddddd cxcccccccccc */ tiebreakers: Tiebreaker[]; /** * If `true`, result items will be sorted in descending order by their score. * * If `false`, result items won't be sorted and tiebreakers won't affect the * sort order either. In this case, the items are returned in the same order * as they are in the input list. * * @defaultValue `true` */ sort: boolean; /** * If `false`, matching will be done from backwards. * * @defaultValue `true` * * @example * /breeds/pyrenees when queried with "re" * with forward=true : /b**re**eds/pyrenees * with forward=false : /breeds/py**re**nees * * Doing forward=false is useful, for example, if one needs to match a file * path and they prefer querying for the file name over directory names * present in the path. */ forward: boolean; } type SyncOptions = BaseOptions & { /** * A function that is responsible for matching list items with the query. * * We ship with two match functions - `basicMatch` and `extendedMatch`. * * If `extendedMatch` is used, you can add special patterns to narrow down your search. * To read about how they can be used, see [this section](https://github.com/junegunn/fzf/tree/7191ebb615f5d6ebbf51d598d8ec853a65e2274d#search-syntax). * For a quick glance, see [this piece](https://github.com/junegunn/fzf/blob/764316a53d0eb60b315f0bbcd513de58ed57a876/src/pattern.go#L12-L19). * * @defaultValue `basicMatch` */ match: (this: SyncFinder>, query: string) => FzfResultItem[]; }; type ArrayElement = ArrayType extends readonly (infer ElementType)[] ? ElementType : never; type SortAttrs = { sort?: true; tiebreakers?: Tiebreaker[]; } | { sort: false; }; type BaseOptsToUse = Omit>, "sort" | "tiebreakers"> & SortAttrs; type BaseOptionsTuple = U extends string ? [options?: BaseOptsToUse] : [options: BaseOptsToUse & { selector: Selector; }]; declare abstract class BaseFinder> { runesList: Rune[][]; items: L; readonly opts: BaseOptions>; algoFn: AlgoFn; constructor(list: L, ...optionsTuple: BaseOptionsTuple>); } type SyncOptsToUse = BaseOptsToUse & Partial, "match">>; type SyncOptionsTuple = U extends string ? [options?: SyncOptsToUse] : [options: SyncOptsToUse & { selector: Selector; }]; declare class SyncFinder> extends BaseFinder { readonly opts: SyncOptions>; constructor(list: L, ...optionsTuple: SyncOptionsTuple>); find(query: string): FzfResultItem>[]; } type FzfOptions = U extends string ? SyncOptsToUse : SyncOptsToUse & { selector: SyncOptions["selector"]; }; type IncrSearchResult = { readonly item: T; readonly positions: ReadonlySet; readonly score: number; }; type IncrSearchState = { readonly query: string; readonly results: ReadonlyArray>; readonly positionsByItem: ReadonlyMap>; }; type IncrSearchChangeCallback = (state: IncrSearchState) => void; type IncrSearchOptions = { readonly items?: readonly T[]; readonly selector?: (item: T) => string; readonly fzf?: Partial>; readonly onChange?: IncrSearchChangeCallback; }; type IncrSearch = { readonly setItems: (items: readonly T[], signal?: AbortSignal) => Promise; readonly setQuery: (query: string, signal?: AbortSignal) => Promise>; readonly clearQuery: () => Promise; readonly state: IncrSearchState; readonly onChange: (cb: IncrSearchChangeCallback) => () => void; readonly dispose: () => void; }; type FuzzySearchOptions = { readonly selector?: (item: T) => string; readonly fzf?: Partial>; }; type FuzzySearch = { readonly find: (query: string) => ReadonlyArray>; readonly items: readonly T[]; }; type HighlightTarget = { readonly element: Element; readonly text?: string; readonly positions: ReadonlySet; }; type HighlightOptions = { readonly key?: string; }; type ElementIncrSearchOptions = { readonly container: Element; readonly itemSelector: string; readonly getLabel?: (el: Element) => string; readonly getKey?: (el: Element) => string; readonly labelSelector?: string; readonly highlightKey?: string; readonly fzf?: Partial>; readonly onChange?: IncrSearchChangeCallback<{ key: string; label: string; }>; }; /** * Creates an ixfx-ac-text-compatible `completionProvider` function from a * static item list. Uses synchronous fuzzy search wrapped in a Promise so it * fits the async provider signature. * * Each returned item has `positions` populated with matched character indices, * which `ixfx-ac-text` uses to render CSS Custom Highlights on the label. * * Empty query returns all items in original order (no positions). * `limit` caps how many (best-first) results are returned and built; without * it every match is, which at 100k items and a short query is the whole list. * A cancelled signal causes the returned promise to reject with an AbortError. */ export declare function createAcCompletionProvider(items: readonly T[], options?: Pick, `selector`> & { readonly limit?: number; }): (query: string, signal: AbortSignal) => Promise; }>>; type IncrSearchTreeOptions = { selector: (item: { node: TreeNode; depth: number; }) => string; /** * CSS selector for the label elements inside the shadow root. * Defaults to `.tree-label` (suitable for ixfx-tree-list). * Use `.label` for ixfx-miller-list. */ labelSelector?: string; highlightKey?: string; input?: HTMLInputElement; fzf?: Partial>; }; /** * External-input filter-search controller for `TreeSearchHost` components. * * @deprecated `ixfx-tree-list` / `ixfx-miller-list` now have a built-in * incremental-search popover with navigate / select / filter modes — invoke * `el.registry.invoke('list.search.filter')` (see `docs/infra-incremental.md`) * instead of wiring an external ``. This class remains for existing * consumers and covers filter mode only. * * @example Using with ixfx-tree-list: * ```typescript * const ctrl = new IncrSearchTreeController(myTreeList, { * selector: item => item.node.item.label, * }); * ctrl.connect(); * ``` * * @example Using with ixfx-miller-list (different label selector): * ```typescript * const ctrl = new IncrSearchTreeController(myMillerList, { * selector: item => item.node.item.label, * labelSelector: '.label', * }); * ctrl.connect(); * ``` */ export declare class IncrSearchTreeController { #private; constructor(el: TreeSearchHost, opts: IncrSearchTreeOptions); connect(): void; disconnect(): void; setQuery(query: string): Promise; clearQuery(): Promise; } /** * The three things incremental search can do to a list / tree component. See * `docs/infra-incremental.md`. * * - `navigate` — move the cursor to the best match; ↑/↓ cycle between matches; * Enter activates the current match and closes. * - `select` — (re)select every item whose label matches, live as you type. * - `filter` — hide items that don't match; restored when the popover closes * (unless `stickyFilter` keeps it on Enter). */ type ListSearchMode = `navigate` | `select` | `filter`; /** Canonical order — used for the switch-row and to normalise a requested set. */ export declare const LIST_SEARCH_MODES: readonly ListSearchMode[]; type SearchItem = { readonly key: string; readonly label: string; }; /** * Everything {@link ListSearchController} needs to drive a specific host. One is * supplied per component; `createElementListSearchAdapter` and * `createTreeListSearchAdapter` cover the common shapes. */ interface ListSearchAdapter { /** All searchable items, in display order. */ getItems: () => readonly TItem[]; /** Text matched against the query. */ getLabel: (item: TItem) => string; /** Stable identity for an item. */ getKey: (item: TItem) => string; /** `navigate`: move the cursor to `item` and reveal it. `undefined` = no-op. */ focusItem: (item: TItem | undefined) => void; /** `navigate` + Enter: activate `item` (falls back to `focusItem`). */ activateItem?: (item: TItem) => void; /** `select` / "Select matches": replace the selection with `items`. */ selectItems: (items: readonly TItem[]) => void; /** `filter`: hide items whose key is not in `matchedKeys`; `undefined` clears the filter. */ applyFilter: (matchedKeys: ReadonlySet | undefined) => void; /** Where matched-character highlights are painted (usually the shadow root). */ highlightRoot?: () => ShadowRoot | Element | null | undefined; /** CSS selector for the label elements inside {@link highlightRoot}. */ highlightSelector?: string; /** Given a label element, the key of the item it belongs to. */ highlightKeyOf?: (labelEl: Element) => string | undefined; /** Text of a label element as fzf saw it (defaults to `el.textContent`). */ highlightText?: (labelEl: Element) => string; /** `CSS.highlights` registry key. Defaults to `incr-search-highlight`. */ highlightKey?: string; /** Element whose child-list mutations should trigger a `refresh()`. */ container?: () => Element | null | undefined; } interface ListSearchControllerOptions { adapter: ListSearchAdapter; /** * Modes this instance offers, as entry points and as in-popover switch * targets. The controller intersects this with {@link LIST_SEARCH_MODES}, so * pass the intersection of the component's own capability and any * consumer-set `search-modes`. Empty ⇒ search disabled. Default: all three. */ modes?: readonly ListSearchMode[]; fzf?: Partial>; placeholder?: string; /** Initial {@link ListSearchController.stickyFilter}. Default false. */ stickyFilter?: boolean; } type ListSearchHost = ReactiveControllerHost & HTMLElement & { renderRoot?: DocumentFragment | HTMLElement; }; /** * Shared brain for the three-mode incremental-search popover. A Lit * `ReactiveController`: the host adds `listSearchStyles` to `static styles`, * drops `${controller.renderField()}` into `render()`, and registers the * commands with {@link registerListSearchCommands}. See `docs/infra-incremental.md`. */ export declare class ListSearchController implements ReactiveController { #private; /** * When true, Enter in `filter` mode closes the popover but keeps the filter, * shown as a "Filtered: …" chip. Clear it with the chip's ×, Escape on the * host, or {@link clearFilter}; click the chip to edit the query. */ stickyFilter: boolean; constructor(host: ListSearchHost, options: ListSearchControllerOptions); /** `false` when no modes are available — the host should register no commands and render no field. */ get enabled(): boolean; /** The modes actually offered (component capability ∩ consumer request). */ get registeredModes(): readonly ListSearchMode[]; /** * Replace the offered mode set (normalised to {@link LIST_SEARCH_MODES} * order). If the current mode is dropped the popover closes and falls back to * the first remaining mode. Callers should re-run * {@link registerListSearchCommands} afterwards. */ setModes(modes: readonly ListSearchMode[]): void; get isOpen(): boolean; get mode(): ListSearchMode; get query(): string; get matchCount(): number; get matchIndex(): number; /** The query of a filter kept applied after the popover closed (see {@link stickyFilter}). */ get keptFilter(): string | undefined; hostConnected(): void; hostDisconnected(): void; /** * Open the popover in `mode` (clamped to the available set). When it is * already open the query is kept: the mode switches if it differs and the * input is refocused with its text selected. */ open(mode: ListSearchMode): void; /** Close the popover, restoring any live filter. Selection / cursor stay put. */ close(): void; /** Remove a filter kept by {@link stickyFilter}. No-op when none is kept. */ clearFilter(): void; setQuery(query: string): void; /** Re-interpret the current query under a new mode (undoing the old mode's effect). */ switchMode(next: ListSearchMode): void; /** * Step through {@link registeredModes} (wrapping) and switch to the result. * Bound to Tab / Shift+Tab in the popover input. */ cycleMode(delta: 1 | -1): void; /** Refocus the popover input (text selected) without touching the query. No-op when closed. */ focus(): void; /** One-shot: turn the current match set into the selection, staying in the current mode. */ selectMatches(source?: ListSelectIntentSource): void; nextMatch(): void; prevMatch(): void; /** * Enter: in `navigate` activate the current match; then close. In `filter` * with {@link stickyFilter} and a query, close but keep the filter. */ commit(): void; /** * Rebuild the searchable item set from the adapter. Called on open and on container mutation. * While search is idle (popover closed, no filter held) nothing reads the index, so a mutation only marks it * stale: rebuilding it is O(items) (a `{ key, label }` and a fuzzy-index entry per item: ~25 ms and ~15 MB at 100k), * and it was paid on every insert, remove and update. */ refresh(): void; /** Re-paint highlights without rebuilding the item set. Use when the rendered window changes. */ repaintHighlights(): void; /** Popover markup. Pair with `listSearchStyles` in the host's `static styles`. */ renderField(): TemplateResult | typeof nothing; } /** One searchable item in data-backed mode. */ type DataListSearchItem = { key: string; index: number; }; interface DataListSearchAdapterOptions { /** Total number of items in the whole collection (search sees all of them). */ rawCount: () => number; /** Raw (unfiltered) index → key. */ rawKeyAt: (index: number) => string; /** Raw (unfiltered) index → text matched against the query. */ rawSearchTextAt: (index: number) => string; /** Raw index → whether the item takes part in search. Default: all do. */ isSearchable?: (index: number) => boolean; /** `filter` mode: the host hides items whose key is not in `matchedKeys` (`undefined` clears). */ onFilterChange?: (matchedKeys: ReadonlySet | undefined) => void; /** `navigate` + Enter: activate the item with this key. Falls back to `focusKey`. */ onActivate?: (key: string) => void; /** Where matched-character highlights are painted (usually the shadow root). */ getHighlightRoot?: () => ShadowRoot | Element | null | undefined; } /** * A {@link ListSearchAdapter} over a data-backed list. Unlike the element * adapter it never materialises an element per item — it reads keys and text * straight from the source by index. Highlights are painted on whatever * captions are currently rendered in the shadow window; offscreen matches paint * when scrolled into view. See `docs/infra-incremental.md`. */ export declare function createDataListSearchAdapter(host: { focusKey: (key: string) => void; selectKeys: (keys: Iterable) => void; }, options: DataListSearchAdapterOptions): ListSearchAdapter; /** * The slice of a list component the element adapter drives. `ixfx-grid-list`, * `ixfx-vertical-list` and `ixfx-detail-list` all satisfy it. */ interface ElementListSearchHost extends HTMLElement { focusKey: (key: string) => void; selectKeys: (keys: Iterable) => void; activateKey?: (key: string) => void; } interface ElementListSearchAdapterOptions { /** Selector for item elements, relative to the host. Default `:scope > *`. */ itemSelector?: string; getLabel?: (el: Element) => string; getKey?: (el: Element) => string; /** `CSS.highlights` registry key for matched-character highlights. */ highlightKey?: string; /** Full ordered item set, including rows not currently in the DOM (virtualised hosts). Defaults to querying `itemSelector`. */ getAllItems?: () => Element[]; /** Items for which this returns `false` take no part in search. Default: all do. */ isSearchable?: (el: Element) => boolean; /** Observe host child-list mutations to refresh the item set. Default true. */ observeContainer?: boolean; } /** * A {@link ListSearchAdapter} over the light-DOM item elements of a list * component. Filter mode toggles `hidden` (only on elements it hid itself, so a * consumer's own `hidden` items are left alone). Highlights are painted on the * item elements in the light DOM — the consuming page styles * `::highlight()`. See `docs/infra-incremental.md`. */ export declare function createElementListSearchAdapter(host: ElementListSearchHost, options?: ElementListSearchAdapterOptions): ListSearchAdapter; type ElementItem = { readonly key: string; readonly label: string; }; type ElementIncrSearch = { readonly setQuery: (query: string, signal?: AbortSignal) => Promise; readonly clearQuery: () => Promise; readonly refresh: () => void; readonly onChange: (cb: IncrSearchChangeCallback) => () => void; readonly dispose: () => void; }; /** * DOM filter-search over a container's item elements (sets `hidden` on * non-matches, applies highlights). * * @deprecated The list components (`ixfx-grid-list`, `ixfx-vertical-list`, * `ixfx-detail-list`, …) now have a built-in navigate / select / filter search * popover — see `docs/infra-incremental.md` and `ListSearchController`. Kept for * standalone / non-component use. */ export declare function createElementIncrSearch(opts: ElementIncrSearchOptions): ElementIncrSearch; export declare function createFuzzySearch(items: readonly T[], options?: FuzzySearchOptions): FuzzySearch; export declare function applyHighlights(targets: readonly HighlightTarget[], options?: HighlightOptions): void; export declare function clearHighlights(options?: HighlightOptions): void; export declare function buildHighlightTargets(root: ShadowRoot | Element, itemSelector: string, positionsByItem: ReadonlyMap>, getItem: (el: Element) => T | undefined, getText: (el: Element) => string): HighlightTarget[]; export declare function createIncrSearch(options?: IncrSearchOptions): IncrSearch; /** Command ids registered by {@link registerListSearchCommands}, keyed by mode. */ export declare const LIST_SEARCH_COMMAND_IDS: Readonly>; interface RegisterListSearchCommandsOptions { /** * Prefix for command ids, e.g. `grid-list` ⇒ `grid-list.search.filter`. When * omitted the shared ids from {@link LIST_SEARCH_COMMAND_IDS} are used so a * single dispatch (`ixfx-grouped-item-lister.dispatch('list.search.filter')`) * fans out to every list. */ idPrefix?: string; } /** * Register one command per mode the controller offers (see * `controller.registeredModes`). Each command opens the search popover in its * mode. Returns a function that unregisters them again — call it from * `disconnectedCallback`. See `docs/infra-incremental.md`. */ export declare function registerListSearchCommands(registry: CommandRegistry, controller: ListSearchController, options?: RegisterListSearchCommandsOptions): () => void; /** * Styles for the incremental-search popover rendered by * `ListSearchController.renderField()`. Add to a component's `static styles`; * the class names are the contract between this fragment and `renderField()`. * * The host must give the popover a positioned ancestor (a wrapper with * `position: relative`, or `:host { position: relative }`). Tunables: * `--list-search-inset` (default `8px`) offsets it from the top-right corner. * * See `docs/infra-incremental.md`. */ export declare const listSearchStyles: import("lit").CSSResult; type TreeSearchItem = { node: TreeNode; depth: number; }; interface TreeListSearchAdapterOptions { /** Label-element selector inside the shadow root. Default `.tree-label`; `ixfx-miller-list` uses `.label`. */ labelSelector?: string; /** `CSS.highlights` registry key for matched-character highlights. */ highlightKey?: string; getLabel?: (item: TreeSearchItem) => string; } /** * A {@link ListSearchAdapter} over any `TreeSearchHost` (`ixfx-tree-list`, * `ixfx-miller-list`, `ixfx-crumb-navigation`). Navigate reveals the match * (expands its ancestors, moves the cursor); select drives `selectMany`; filter * sets `filterPredicate`. The item set is the whole tree — `getNodes()` returns * every node regardless of expansion or an active filter — so refining a query * can always re-surface a node. See `docs/infra-incremental.md`. */ export declare function createTreeListSearchAdapter(host: TreeSearchHost, options?: TreeListSearchAdapterOptions): ListSearchAdapter; declare class MenuBar extends LitElement { private _openTrigger; private _inputMode; connectedCallback(): void; disconnectedCallback(): void; private _setInputMode; private _handlePointerMove; private _handlePointerOver; private _getTriggers; private _handleTriggerOpen; private _handleTriggerClose; private _handleFocusIn; private _handleKeydown; static styles: import("lit").CSSResult; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-bar': MenuBar; } } declare class MenuCheckItem extends LitElement { command: string; commandArgs: string; label: string; checked: boolean; disabled: boolean; iconName: string; registry?: CommandRegistry; keyboardManager?: KeyboardManager; private handleClick; private _resolvedLabel; private _resolvedIcon; willUpdate(changedProperties: Map): void; updated(changedProperties: Map): void; private _getShortcut; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-check-item': MenuCheckItem; } } declare class MenuCommandController { private registry; private target; private boundHandler; constructor(options: { registry: CommandRegistry; target?: EventTarget; }); start(): void; stop(): void; private handleCommand; } declare class MenuSubTrigger extends LitElement { command: string; commandArgs: string; label: string; disabled: boolean; iconName: string; registry?: CommandRegistry; keyboardManager?: KeyboardManager; private _hasSubmenu; private _slot; private _submenuPopover; private _itemEl; private static _count; private _anchorName; private _hoverTimeout; private _hideTimeout; connectedCallback(): void; firstUpdated(): void; disconnectedCallback(): void; private _propagateContext; updated(changedProperties: Map): void; willUpdate(changedProperties: Map): void; private _resolvedIcon; private _handleSlotChange; private _showSubmenu; private _hideSubmenu; private _cancelHide; private _scheduleHide; private _handleMouseEnter; private _handleMouseLeave; private _handleSubmenuMouseEnter; private _handleSubmenuMouseLeave; private _handleClick; private _handleKeydown; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-sub-trigger': MenuSubTrigger; } } declare class MenuSeparator extends LitElement { static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-separator': MenuSeparator; } } declare class MenuHeader extends LitElement { label: string; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-header': MenuHeader; } } type MenuFromTreeOptions = { onCommand?: (detail: MenuTriggerCommandDetail) => void; registry?: CommandRegistry; keyboardManager?: KeyboardManager; }; declare function menuFromTree(nodes: TreeNode[], options?: MenuFromTreeOptions): TemplateResult; declare function menuFromTreeToElements(nodes: TreeNode[], options?: MenuFromTreeOptions): HTMLElement[]; declare class MenuRadioItem extends LitElement { value: string; label: string; disabled: boolean; groupValue: string; iconName: string; private handleClick; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-radio-item': MenuRadioItem; } } declare class MenuRadioGroup extends LitElement { name: string; value: string; private slottedElements; private handleSlotChange; private updateSlottedValues; private handleRadioSelect; updated(changedProperties: Map): void; static styles: import("lit").CSSResult; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-menu-radio-group': MenuRadioGroup; } } declare namespace index_d_exports { export { MenuBar, MenuCheckItem, MenuCommandController, MenuContainer, MenuFromTreeOptions, MenuHeader, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSubTrigger, MenuTrigger, menuFromTree, menuFromTreeToElements }; } export type PanTextMode = `hover` | `loop`; export declare class PanTextElement extends LitElement { direction: `start` | `end`; disabled: boolean; /** * Interaction mode. * - `hover` (default): pans once while hovered. * - `loop`: pans repeatedly — dwell 2s at the end, reset to the start, * and pan again — until `stopLoop()` is called. Auto-starts when set. */ mode: PanTextMode; private _isOverflowing; private _isHovering; private _loopActive; private _loopAtEnd; private _textEl; private _overflow; private _resizeObserver; private _loopTimer; connectedCallback(): void; disconnectedCallback(): void; firstUpdated(): void; protected updated(changed: PropertyValues): void; /** * Whether a loop pan is currently active (between `startLoop()` and `stopLoop()`). */ get looping(): boolean; /** * Begin looping: pan to the end, dwell there for 2 seconds, reset to the * start and pan again, repeating until `stopLoop()` is called. A no-op when * `disabled`, when there is nothing to reveal, or under reduced-motion. */ startLoop(): void; /** * Stop a loop started with `startLoop()` and snap back to the rest position. */ stopLoop(): void; private _prefersReducedMotion; private _panDuration; private _clearLoopTimer; private _scheduleLoopPan; private _onMouseEnter; private _onMouseLeave; /** * Measures how far the slotted text overflows its container. The measurement * is taken on the inner `.text` span (which clips with an ellipsis), not on * the host — the host never overflows, so measuring it always yielded zero * and the hover interaction never activated. * * Skipped while hovering, because the hover styles switch `.text` to * `overflow: visible` and the measurement would collapse to zero mid-pan. */ private _measure; private _textStyle; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-pan-text': PanTextElement; } } export type DataGridSortDetail = { readonly sort: DataGridSortState; readonly previous: DataGridSortState; }; export type DataGridSortEvent = CustomEvent; export type DataGridSelectDetail = { readonly selectedKeys: ReadonlySet; readonly previous: ReadonlySet; }; export type DataGridSelectEvent = CustomEvent; /** `list-select`: the same event name and key-based detail as the other list-like components. */ export type DataGridListSelectDetail = ListSelectKeysDetail & { readonly previous: ReadonlySet; }; export type DataGridListSelectEvent = CustomEvent; export type DataGridSelectIntentEvent = CustomEvent; export type DataGridColumnReorderDetail = { readonly from: number; readonly to: number; readonly columns: readonly DataGridColumn[]; }; export type DataGridColumnReorderEvent = CustomEvent; export type DataGridColumnResizeDetail = { readonly key: string; readonly width: number; }; export type DataGridColumnResizeEvent = CustomEvent; export type DataGridColumnVisibilityDetail = { readonly key: string; readonly visible: boolean; }; export type DataGridColumnVisibilityEvent = CustomEvent; export type DataGridCellClickDetail = { readonly rowKey: string; readonly colKey: string; readonly rowIndex: number; readonly colIndex: number; }; export type DataGridCellClickEvent = CustomEvent; export type DataGridCellEditDetail = { readonly rowKey: string; readonly colKey: string; readonly oldValue: unknown; readonly newValue: unknown; }; export type DataGridCellEditEvent = CustomEvent; export type DataGridGroupChangeDetail = { readonly groupBy: DataGridGroupBy | null; }; export type DataGridGroupChangeEvent = CustomEvent; export type DataGridRowActivateDetail = { readonly rowKey: string; readonly row: unknown; readonly rowIndex: number; }; export type DataGridRowActivateEvent = CustomEvent; /** Same shape as the list components' shared `ListViewportChangeDetail`. */ export type DataGridViewportChangeDetail = ListViewportChangeDetail; export type DataGridViewportChangeEvent = ListViewportChangeEvent; export interface DataGridElementEventMap { 'datagrid-sort': DataGridSortEvent; 'datagrid-select': DataGridSelectEvent; 'list-select': DataGridListSelectEvent; 'list-select-intent': DataGridSelectIntentEvent; 'datagrid-column-reorder': DataGridColumnReorderEvent; 'datagrid-column-resize': DataGridColumnResizeEvent; 'datagrid-column-visibility': DataGridColumnVisibilityEvent; 'datagrid-cell-click': DataGridCellClickEvent; 'datagrid-cell-edit': DataGridCellEditEvent; 'datagrid-group-change': DataGridGroupChangeEvent; 'datagrid-row-activate': DataGridRowActivateEvent; 'datagrid-viewport-change': DataGridViewportChangeEvent; 'list-native-drag-start': ListNativeDragStartEvent; 'list-drop': ListTargetDropEvent; 'list-reorder': ListReorderEvent; } export declare class DataGridElement extends LitElement { #private; static styles: import("lit").CSSResult[]; columns: DataGridColumn[]; rows: unknown[]; selectionMode: DataGridSelectionMode; interactionMode: DataGridInteractionMode; sortState: DataGridSortState; rowHeight: number; getRowKey: DataGridGetRowKey; checkboxRenderer?: (checked: boolean) => unknown; editable: boolean | ((row: unknown, col: DataGridColumn) => boolean); editability: DataGridEditability; cellOverflow: DataGridCellOverflow; zebraStripes: boolean; /** * Rows rendered beyond the viewport on each side. See `overscanMax` for letting the * window also run ahead of a fast scroll. */ overscan: number; /** * Cap on the rows rendered beyond the viewport. When above `overscan`, the window * runs ahead in the scroll direction in proportion to scroll velocity (up to this cap), * so a fling that outruns the main thread still finds rows rendered. Default `0`: off — * in a headless Chrome fling at 1500 px/frame the lead cost ~1.4 ms render + ~0.7 ms script * per frame and saved nothing while frames weren't being dropped. */ overscanMax: number; /** Turn off the vertical edge-fade mask on the scroller (a masked scroller is re-rasterised as it scrolls). */ noScrollFade: boolean; groupBy: DataGridGroupBy | null; allowGrouping: boolean; groupLabel: DataGridGroupLabel | undefined; /** Columns keys that can be grouped by; undefined = all groupable columns */ groupableColumns: string[] | undefined; crossGroupSelection: boolean; /** * `none` (default): don't render the built-in header column/group menu — hosts can * supply their own column UI via `column.visible` + `datagrid-column-visibility`. * `auto`: opt in to the built-in menu. */ columnMenu: DataGridColumnMenu; globalFormatter?: GlobalFormatter; /** * Key of the column whose cell text takes the row's `textColor` — e.g. a * status column that renders a red "Failed" only on some rows. */ textColorColumn: string; /** * Key of the column that renders the row's `icon` (tinted by `iconColor`). */ iconColumn: string; /** * Key of the column that renders the row's `badge`, right-justified in the * cell after the cell's own value. */ badgeColumn: string; /** * Predicate used by incremental filter-search (and callable directly). Rows * for which it returns `false` are dropped from the flat list — hidden from * view and navigation. */ filterPredicate?: (row: unknown) => boolean; /** * Text a row is matched against by incremental search. Overrides * `searchColumn`; matches against it aren't highlighted, since they can't be * mapped onto a cell. */ rowSearchText?: (row: unknown) => string; /** * Key of the column incremental search matches against, using the cell's * displayed (formatted) text. Default: the first visible column. */ searchColumn: string; /** * Space-separated subset of `navigate select filter` — limits which * incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search * disabled. See `docs/infra-incremental.md`. */ searchModes: string | undefined; /** * Enable native browser drag-and-drop for selectable rows. When true, * selectable rows become draggable and the grid emits * `list-native-drag-start` when a drag begins. */ itemsDraggable: boolean; /** * Rows and the empty space below them accept native drops: `list-drop` fires with the resolved * `ListDropTarget`. (Column reordering is separate: see `DataGridColumn.reorderable`.) */ itemsDroppable: boolean; /** * Which targets a drag can resolve to: onto a row (`on`), into the gap between two rows (`between`), * or both (`both`: the top and bottom quarter of a row mean `between`, the middle half means `on`). */ dropPositions: ListDropPositions; /** * A drag that starts in this grid and ends between its own rows is a **reorder** (`list-reorder`), * not a drop. Implies `items-draggable`, and `between` targets for internal drags. The grid never * reorders `rows` itself — the host owns the order (see `applyListReorder`). Refused while a sort * column is active or rows are grouped (see {@link reorderBlocked}). */ itemsReorderable: boolean; /** Sync gate on every `dragover`, given the resolved target. `false` ⇒ no indicator and no event. */ canDrop: ListCanDrop | undefined; /** Sync gate for internal moves (e.g. nothing may go above a pinned row). */ canReorder: ListCanReorder | undefined; /** * For a host that cancels the browser drag in `list-native-drag-start` and starts an OS drag in its * place: say which row keys a drag carries, so a drop inside the grid is still a `list-reorder`. */ resolveInternalDrag: ListResolveInternalDrag | undefined; /** Why `between` drops are refused (`sorted` / `grouped`), or `undefined` when they work. `on` drops still work. */ get reorderBlocked(): ListReorderBlocked | undefined; /** * Custom drag preview renderer (synchronous). Defaults to the shared * built-in HTML+canvas preview. */ dragPreviewRenderer: ListDragPreviewRenderer | undefined; /** * Write an application payload onto the drag's `DataTransfer` (e.g. a custom * MIME type). Called once per drag, synchronously inside `dragstart`, after a * non-cancelled `list-native-drag-start`. */ writeDataTransfer: ListDragDataTransferWriter | undefined; dragPreviewSource: ListDragPreviewSourceResolver | undefined; /** * Default icon name for column header buttons. Defaults to `ellipsis`. * Individual columns can override with `button: { icon: '...' }`. */ columnButtonIcon: string; private _columnFormatters; private _resizingColKey; private _animatingColKeys; private _selectedKeys; /** Not reactive: `_onScroll` only re-renders when the row window actually moves. */ private _scrollTop; /** Not reactive: columns aren't virtualised, so render never reads it. */ private _scrollLeft; private _viewportH; private _viewportW; private _collapsedGroups; private _editing; private _editingRow; private _lastClick; private _lastClickedCell; private _editValue; private _viewportEl; private _headerRowEl; private _tickled; private _sortedRows; private _flat; private _flatKeys; /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */ readonly search: ListSearchController; /** Command registry carrying this grid's `list.search.*` commands. */ get registry(): CommandRegistry | undefined; private _visibleColumns; private _colOffsets; private _colWidthSum; private _raf; private _drag; connectedCallback(): void; disconnectedCallback(): void; /** * Dispatch a command to this grid — routes through the command registry so * `list.search.*` (and any other registered commands) work. */ dispatch(commandId: CommandId, args?: Record): void; private _onFocusOut; protected firstUpdated(): void; /** * Force a fresh re-measure of the viewport and re-render. Normally * unnecessary — a `ResizeObserver` tracks the viewport automatically — but * gives a consumer an escape hatch to recover if an ancestor's * layout/visibility changes without the observer noticing (matches * `ixfx-grid-list`'s `refreshLayout()`). */ refreshLayout(): void; protected updated(changed: Map): void; protected willUpdate(changed: Map): void; private _getGroupKey; private _rebuildFlat; private _toggleGroup; private _applySort; private _onScroll; private _onHeaderClick; private _onHeaderPointerUp; private _onColButtonClick; private _onRowClick; private _onCheckboxClick; private _onVisibilityToggle; private _beginHeaderDrag; private _onReorderDrag; private _anchorKey; private _scrollRowIntoView; private _getRowForKey; /** The selected row keys (read-only). */ get selectedKeys(): ReadonlySet; private _partialKeys; /** * Rows shown as *partially* selected (a part of the resource is selected): * `[data-partial]`, `.partial` and an accessible description. Independent of * `selectedKeys` — a key in both counts as selected. Replace-on-set; keys * without a row are kept for when the row appears. */ get partialKeys(): ReadonlySet; set partialKeys(keys: Iterable); /** * Caller-assigned tags for a row (`undefined` ⇒ none). Each tag is exposed on * the row as a `tag-` `part` token (`::part(item tag-foo)`) and in * `data-tags` (`[data-tags~="foo"]`); `tagBehaviour` can switch off selection, * focus, drag or search per tag. `index` is the row's position in the sorted * order. Re-read on every render; call {@link refreshTags} after mutating * data the hook reads. */ tags: ((row: unknown, index: number) => readonly string[] | undefined) | undefined; /** Tags by row key, apart from the row data (like {@link partialKeys}): tag name → keys. Merged with the `tags` hook. */ get tagKeys(): ItemTagKeys | undefined; set tagKeys(value: ItemTagKeys | undefined); /** * Interaction flags per tag name: `selectable`, `focusable`, `draggable`, * `searchable` (`false` switches one off; omitted keeps the default). With * several tags the most restrictive wins. Rows stay rendered and keep their * place in layout and scroll. */ get tagBehaviour(): ItemTagBehaviour | undefined; set tagBehaviour(value: ItemTagBehaviour | undefined); /** Re-evaluate tags and re-render (the `tags` hook is read live; this drops cached cursor state). */ refreshTags(): void; /** Replace the selection with these row keys (clamped to known rows). */ set selectedKeys(keys: Iterable); /** * Replace the selection with the given row keys. Unknown keys are dropped; * in a single-select mode only the last surviving key is kept; * `selectionMode="none"` clears. Fires `datagrid-select` with the previous * set when the selection actually changes. */ selectKeys(keys: Iterable): void; /** The row key under the cursor, or `undefined`. */ get tickledKey(): string | undefined; /** Move the cursor to this row key and scroll it into view. */ tickleRow(key: string): void; /** * Append rows without the full O(n log n) rebuild that reassigning `rows` * incurs. `rows` still gets a new array reference (reactivity is preserved), * but the derived arrays are extended over the appended slice only. When a * sort is active the new rows show unsorted for one frame, then a single * coalesced re-sort runs. Scroll position, selection and cursor are kept. */ appendRows(rows: readonly unknown[]): void; /** * Re-render the row with this key without touching `rows` — for a host that * mutated the row object in place (or changed something the cells read from * outside it). Only the rendered window is re-evaluated; a no-op for unknown * keys and for rows outside the window. Changing a sorted / grouped / * filtered value this way doesn't move the row: use {@link updateRows}. */ refreshRow(key: string): void; /** * Replace several rows by key — the batched counterpart of `grid-list`'s * `updateItems`. `entries` is `{ key, row }` pairs or a `Map`. * * Unknown keys and entries whose row is the object already there are * ignored. When a replacement leaves the row's key, position (sort), group * and filter result unchanged — the usual case for metadata arriving for a * row — the derived row model is patched in place, so nothing is re-sorted * or rebuilt. Otherwise the whole batch falls back to a normal `rows` reset. * Selection, cursor and scroll are untouched either way. */ updateRows(entries: Iterable | ReadonlyMap): void; private _replaceSelection; private _toggleSelection; private _rangeSelectTo; private _onKeyDown; private _isEditable; private _isTextEditor; private _isCellEditing; /** A popup editor is open for this cell. */ private _isPopupOpen; private _activateRow; private _startEdit; /** Programmatic: put a single cell in edit mode. Works in manual/user/immediate (no-op if disabled or not editable). */ startEdit(rowKey: string, colKey: string): void; /** Programmatic: put all editable cells of a row in edit mode. */ startRowEdit(rowKey: string): void; stopEdit(): void; setColumnFormatter(columnKey: string, formatter: ((value: unknown) => unknown) | BuiltInFormatterName | null, options?: BuiltInFormatterOptions): void; private _formatValue; /** * Resolve the per-row appearance for the cell at `colKey`, honouring the * nominated columns. Additive — `col.renderer` / `col.formatter` still own * the cell's value; this only decorates it. Returns all-`undefined` for * every cell when nothing is nominated (the common case). */ private _cellLook; private _handleCellSecondClick; private _commitEdit; private _suppressBlurCommit; private _tabToNext; private _commitImmediate; /** * Measure the width a column would need to show its header label and every * row's (formatted) value without truncation, clamped to `minWidth`/`maxWidth`. * Values are measured from their formatted string via canvas `measureText` - * accurate for plain text, an estimate for anything else. */ private _measureAutoWidth; private _autoSizeColumn; /** * Resize a single column, by key, to fit its contents (header label + every * row's formatted value), animating the width change smoothly. Only works * for plain columns, or `renderer` columns that supply `measure` or * `fixedExtraWidth` - otherwise a renderer's output can't be measured * reliably from the raw value, so it's left untouched. Returns `false` (and * does nothing) if the column doesn't exist, isn't resizable, or has an * unmeasurable `renderer`. */ autoSizeColumn(key: string): boolean; private _columnResizeAnimationMs; private _onResizePointerDown; /** * Snapshot selection, cursor, scroll, collapsed groups, column layout, sort * and (with `allowGrouping`) grouping as plain JSON, keyed by row / group / * column key. Includes pending state for keys not currently present. Rows * keyed by index (no `key` / `id` under the default `getRowKey`) are never * recorded. */ getViewState(options?: GetViewStateOptions): DataGridViewState; /** * Apply saved view state. Fields present replace the current ones; row and * column keys that aren't defined yet are applied as they appear (including * rows streamed in with `appendRows()`). */ setViewState(state: Partial): void; clearPendingViewState(): void; getVisibleRange(): { startRow: number; endRow: number; startCol: number; endCol: number; }; /** Row keys currently within the windowed/visible range, in display order. */ renderedKeys(): string[]; private _findFirstVisibleCol; private _findLastVisibleCol; protected render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-data-grid': DataGridElement; } } export interface DataGridElement { addEventListener: ((type: K, listener: (this: DataGridElement, event: DataGridElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); removeEventListener: ((type: K, listener: (this: DataGridElement, event: DataGridElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void); } export type DataTableEditability = `disabled` | `manual` | `user` | `immediate`; export type DataTableDataType = `text` | `number` | `boolean` | `custom`; export type DataTableEditorType = `auto` | `select`; export type DataTableRow = { label: string; value: string | number | boolean | Node | TemplateResult; fullWidth?: boolean; detail?: string | TemplateResult; id?: string; /** Per-row editability; see {@link DataTableElement.editable}. Only primitive values can be edited. */ editable?: boolean; /** Controls the auto-editor. Defaults to the type of the current value (`text` for strings). */ dataType?: DataTableDataType; /** `auto` infers the editor from `dataType`; `select` uses `editorOptions`; or a custom factory. */ editor?: DataTableEditorType | DataTableEditorFactory; editorOptions?: ReadonlyArray; /** * Render the `editor` factory's output in a popup anchored to the value instead of in place. * The value stays visible while the popup is open. Dismissing the popup (click outside) commits * whatever the editor last passed to `ctx.update` / `ctx.commit`; `Escape` cancels. */ editorPopup?: boolean; /** * What opens the editor in `user` mode. `default` is a slow double-click; `click` opens on a single * click. Popup editors always open on a single click in `immediate` mode. */ editTrigger?: `default` | `click`; /** Custom display of the (primitive) value, e.g. a colour swatch. Not used while an inline editor is open. */ renderer?: (value: DataTableRow[`value`], row: DataTableRow) => unknown; }; export type DataTableEditorContext = { readonly row: DataTableRow; readonly index: number; readonly rowKey: string; readonly value: unknown; /** Write `nextValue`, fire the edit event and close the editor. */ commit: (nextValue: unknown) => void; /** Record `nextValue` without closing. A popup editor commits it when dismissed by clicking outside. */ update: (nextValue: unknown) => void; /** Close the editor, discarding anything passed to `update`. */ cancel: () => void; }; export type DataTableEditorFactory = (ctx: DataTableEditorContext) => unknown; export type DataTableCellEditDetail = { readonly row: DataTableRow; readonly index: number; readonly rowKey: string; readonly oldValue: unknown; readonly newValue: unknown; }; export type DataTableCellEditEvent = CustomEvent; export type DataTableRowClickDetail = { readonly row: DataTableRow; readonly index: number; readonly selected: boolean; }; export type DataTableRowClickEvent = CustomEvent; export interface DataTableElementEventMap { 'data-table-row-click': DataTableRowClickEvent; 'data-table-cell-edit': DataTableCellEditEvent; } export declare class DataTableElement extends LitElement { #private; static styles: import("lit").CSSResult[]; rows: readonly DataTableRow[]; selectedIndex: number | undefined; /** * How long (ms) the pointer must rest on a hovered row before its detail * panel is revealed. The tickled highlight itself appears immediately on * hover; only the detail panel is debounced. Clicking a row reveals its * detail straight away, ignoring this delay. */ tickleDelay: number; /** * Table layout. * - `auto` (default): responsive — widens to multiple pair-columns on wide * containers, and stacks key above value once narrower than * {@link narrowBreakpoint}. * - `rows`: always stacked (key above value), regardless of width. * - `columns`: always a two-column key/value grid, regardless of width. */ layout: `auto` | `rows` | `columns`; /** * Inline width (px) at or below which the `auto` layout switches to its * stacked, key-above-value form. Ignored when {@link layout} is locked. */ narrowBreakpoint: number; /** `true`/`false` as a default for rows without their own `editable`, or a predicate per row. */ editable: boolean | ((row: DataTableRow, index: number) => boolean); /** * - `disabled`: no editing. * - `manual`: only via {@link startEdit}. * - `user` (default): slow double-click on a value, or `Enter` on the tickled row. * - `immediate`: editable values always render as editors. */ editability: DataTableEditability; private _editing; private _editValue; private _suppressBlurCommit; private _lastClick; private _tickled; /** Index of the row whose detail panel is currently revealed, if any. */ private _detailIndex; /** Whether the table is currently rendering in its stacked form. */ private _stacked; connectedCallback(): void; disconnectedCallback(): void; willUpdate(changed: PropertyValues): void; /** Programmatic: put a row's value in edit mode (by `id`, or by index). No-op if disabled or not editable. */ startEdit(rowKeyOrIndex: string | number): void; /** Cancel any open editor without committing. */ stopEdit(): void; updated(changed: PropertyValues): void; render(): ReturnType; } declare global { interface HTMLElementTagNameMap { 'ixfx-data-table': DataTableElement; } } export interface DataTableElement { addEventListener(type: K, listener: (this: DataTableElement, event: DataTableElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } export type DateInputType = `date` | `datetime-local`; export type DateInputChangeDetail = { /** The text value: `YYYY-MM-DD` or `YYYY-MM-DDTHH:mm`. Empty when cleared or incomplete. */ readonly value: string; /** The value as a local-time `Date`, or `null` when empty. */ readonly date: Date | null; }; export type DateInputChangeEvent = CustomEvent; /** * Parse a `date` / `datetime-local` string into a local-time `Date`. * Returns `null` for an empty or malformed value. */ export declare function parseDateInput(value: string): Date | null; /** Format a local-time `Date` for a `date` / `datetime-local` input. */ export declare function formatDateInput(date: Date, type: DateInputType): string; /** * Date or date-time input that follows the theme. * * Wraps the native picker (so keyboard entry, the calendar popup and * localisation come from the browser) and styles it like the other inputs. * * @fires {DateInputChangeEvent} change — when the user changes the value * * @example * ```html * * ``` */ export declare class DateInputElement extends LitElement { #private; /** `date` or `datetime-local`. */ type: DateInputType; /** `YYYY-MM-DD` or `YYYY-MM-DDTHH:mm`, matching `type`. Empty for none. */ value: string; min: string; max: string; disabled: boolean; name: string; /** The value as a local-time `Date`, or `null` when empty. */ get date(): Date | null; set date(date: Date | null); focus(options?: FocusOptions): void; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-date-input': DateInputElement; } } export interface DateInputElementEventMap { change: DateInputChangeEvent; } export interface DateInputElement { addEventListener: ((type: K, listener: (this: DateInputElement, event: DateInputElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } /** * Shared, DOM-free grouping helpers for list components * (`ixfx-grid-list`, `ixfx-detail-list`). Semantics mirror `ixfx-data-grid`: * groups appear in first-encounter order, keys are `String(value ?? '')`. */ /** * How to derive an item's group key: a property (or `data-*` attribute) name, * or a function of the item. */ type ListGroupBy = string | ((item: T, index: number) => string); /** Turns a group key and its items into the header label. */ type ListGroupLabel = (groupKey: string, items: readonly unknown[]) => string; /** Read-only description of one rendered group. */ type ListGroupInfo = { readonly key: string; readonly label: string; /** Visible (post-filter) items, including those hidden by collapse. */ readonly count: number; readonly collapsed: boolean; }; type ListGroupToggleDetail = { readonly groupKey: string; readonly collapsed: boolean; }; type ListGroupChangeDetail = { readonly groupBy: ListGroupBy | null; }; type ListGroupToggleEvent = CustomEvent; type ListGroupChangeEvent = CustomEvent; interface ListGroupEventMap { 'list-group-toggle': ListGroupToggleEvent; 'list-group-change': ListGroupChangeEvent; } /** One group produced by {@link partitionByGroup}. */ type ListGroupPartition = { readonly key: string; readonly label: string; readonly items: T[]; /** Index (in the input array) of the group's first item. */ readonly firstIndex: number; }; /** Label shown for the empty group key. */ export declare const EMPTY_GROUP_LABEL = "(none)"; /** Default header label: the key, or `(none)` for the empty key. */ export declare function defaultGroupLabel(key: string): string; /** Coerce a raw group value to a key, as data-grid does. */ export declare function toGroupKey(value: unknown): string; /** * Group key for `item`. A string `groupBy` is resolved through `readNamed` * (property or `data-*` lookup, supplied by the host); a function is called. */ export declare function resolveGroupKey(groupBy: ListGroupBy, item: T, index: number, readNamed: (item: T, name: string) => unknown): string; /** * Split `items` into groups in first-encounter order. Single pass, O(n). * Item order within a group is preserved. */ export declare function partitionByGroup(items: readonly T[], keyOf: (item: T, index: number) => string, labelOf?: ListGroupLabel): Array>; /** Immutable toggle of `key` in `set`. */ export declare function toggleInSet(set: ReadonlySet, key: string): Set; /** * Pure helpers behind `ixfx-detail-list`'s view state (see * `docs/infra-view-state.md`). The component keeps only the wiring. * * - `selected` — selected item keys (in `checked` mode, the checked set: * `data-checked` is derived from the selection, not stored separately). * - `expanded` — `{ [groupKey]: false }` for collapsed groups. Groups default * open, so only collapses are recorded; `true` re-opens. * - `focus` — keyboard-cursor key. * - `scroll` — horizontal: `left` plus an anchor on the top item of the first * visible column. */ type DetailListViewState = ViewStateBase; /** * Named entry / exit effect for a whole set of rows. * * - `none` — rows appear and disappear without a staged animation. * - `sweep` — rows enter from the right, staggered; on exit they continue off * to the left, staggered. * * The motion is plain CSS (`@keyframes` + `animation-delay`), selected by the * `data-item-phase` attribute. See {@link listItemEffectStyles}. */ type ListItemEffect = `none` | `sweep`; /** * Which way an effect travels. `forward`: rows enter from the right and leave to * the left (going "down" into something). `backward`: the mirror image (going * back "up"). */ type ListItemEffectDirection = `forward` | `backward`; /** Highest stagger step; later rows share it, so a long list doesn't take forever. */ export declare const LIST_ITEM_EFFECT_MAX_STEPS = 16; /** * Shadow-DOM CSS for the named effects, for a host whose rows are slotted * (`::slotted`). Tunable from outside with: * * - `--ixfx-item-effect-duration` (default `260ms`) * - `--ixfx-item-effect-stagger` (default `30ms`, delay added per row) * - `--ixfx-item-effect-easing` (entrance, default `ease-out`: arrives fast, settles) * - `--ixfx-item-effect-exit-easing` (exit, default `ease-in`: leaves slowly, then accelerates away) * * Under `prefers-reduced-motion: reduce` no animation runs. */ export declare const listItemEffectStyles: import("lit").CSSResult; /** * Play the host's `item-effect` on `rows` and resolve when every animation has * finished. Rows get `data-item-phase` (`in` | `out`) and a `--ixfx-item-step` * stagger index; the stylesheet does the rest. * * `in` clears its markers once finished. `out` leaves them (the rows are * detached by the caller next), so there is no flash back to full size. * Resolves at once when nothing animates (`none`, reduced motion, no CSS). */ export declare function runListItemEffect(rows: readonly HTMLElement[], phase: `in` | `out`): Promise; /** * `list-drag-over` / `list-drop`. `key` and `item` are `undefined` when the * drag is over empty list space rather than a row. */ type ListDropDetail = { readonly key: string | undefined; readonly item: Element | undefined; readonly dataTransfer: DataTransfer; /** What the drag is over — `on` a row, `between` two rows, or `empty` space. `key` / `item` describe an `on` target. */ readonly target?: ListDropTarget; }; type ListDragLeaveDetail = { readonly key: string | undefined; }; type ListContextMenuDetail = { readonly key: string | undefined; readonly item: Element; /** Viewport coordinates to open the menu at. */ readonly x: number; readonly y: number; /** The selection at the time of the request — a row that was not selected has been selected first. */ readonly selectedKeys: ReadonlySet; }; type ListEditCommitDetail = { readonly key: string | undefined; readonly value: string; }; type ListEditCancelDetail = { readonly key: string | undefined; }; type ListDragOverEvent = CustomEvent; /** `list-drop`: the same event, and detail, as every list component — see `ListTargetDropDetail`. */ type ListDropEvent = ListTargetDropEvent; type ListDragLeaveEvent = CustomEvent; type ListContextMenuEvent = CustomEvent; type ListEditCommitEvent = CustomEvent; type ListEditCancelEvent = CustomEvent; /** * Pure helpers behind `ixfx-vertical-list`'s view state. The component runs * them whenever its items change (light-DOM edits, `addItem` / `setItems` / * `clearItems`, adapter rebuilds, virtual registry changes), so state keyed to * rows that left the list goes pending and comes back when those keys reappear. */ /** * `ixfx-vertical-list` view state. All fields are the shared base fields: * `selected` (the checked set in `checked` mode), `focus` (keyboard cursor) * and `scroll`. Keys are each row's `data-key` / `data-value`. */ type VerticalListViewState = ViewStateBase; export type EditableMode = `label` | `editor`; export type EntryMode = `free` | `text` | `number` | `percent`; export type DisplayTextLogic = `hidden` | `show` | `override` | `transient`; export type EditableLabelChangeDetail = { readonly value: string; }; export type EditableLabelChangeEvent = CustomEvent; export declare class EditableLabel extends LitElement { mode: EditableMode; entryMode: EntryMode; value: string; disabled: boolean; placeholder: string; /** Override displayed text. Bypasses formatter and value. When editing, shows raw value. */ displayText?: string; /** * Controls when displayText is shown: * - 'hidden' (default): never use displayText * - 'show': show displayText instead of formatted value, but hide while editing; revert after disappearDelay * - 'override': always show displayText, even when editing * - 'transient': show displayText by default, switch to formatted value after appearDelay on hover/interaction; revert after disappearDelay */ displayTextLogic: DisplayTextLogic; /** Delay before showing value in transient mode (ms). Default: 50 */ appearDelay: number; /** Delay before reverting to displayText after editing ends (ms). Default: 1000 */ disappearDelay: number; /** Override commit validation. Return true to accept, false to reject (reverts). */ validator?: (value: string) => boolean; /** Transform the committed value for display. Does not affect the stored value. */ formatter?: (value: string) => string; protected _editing: boolean; protected get _contentEl(): HTMLElement | undefined; /** Snapshot of value taken when editing begins; restored on cancel. */ protected _prevValue: string; connectedCallback(): void; disconnectedCallback(): void; protected _hovering: boolean; protected _transientShowingValue: boolean; protected _transientTimer: number | undefined; protected _showModeWaitingToHide: boolean; protected _clearTransientTimer(): void; private _onMouseEnter; private _onMouseLeave; protected _startTransientRevertTimer(): void; protected _requestDisplayUpdate(): void; /** Called by subclasses when user interacts (drag, keyboard, etc) to temporarily show value in transient mode */ protected _onUserInteraction(): void; protected _handleClick: () => void; protected _handleFocus: () => void; protected _handleBlur: () => void; protected _handleKeydown: (e: KeyboardEvent) => void; protected _handleBeforeInput: (e: InputEvent) => void; protected _handleInput: () => void; protected _beginEdit(): void; protected _tryCommit(): void; protected _cancelEdit(): void; protected _getDisplayText(): string; protected _shouldUseDisplayText(): boolean; protected _isAllowedInput(char: string): boolean; private _defaultValidator; render(): import("lit").TemplateResult<1>; updated(changed: PropertyValues): void; static styles: CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-editable-label': EditableLabel; } } export interface CustomCheckboxOptions { renderer: (checked: boolean) => unknown; margin?: string; width?: string; } export interface AddItemOptions { /** * In `checked` interaction mode, adds the item without a checkbox column and * without the ability to be checked/selected. Equivalent to setting the * `not-checked` attribute on the item. Ignored outside `checked` mode. */ notChecked?: boolean; } export declare class VerticalListElement extends LitElement { #private; selectionMode: ListSelectionMode; interactionMode: ListInteractionMode; /** * Entry / exit effect for rows built from `items` (CSS animation). `sweep`: * the old rows leave to the left, staggered, then the new rows enter from the * right, staggered. Ignored while `virtualize` is active, and under * `prefers-reduced-motion`. */ itemEffect: ListItemEffect; /** * Which way `item-effect` travels. `forward` (default): enter from the right, * leave to the left. `backward`: enter from the left, leave to the right. * Set it before changing `items`. */ itemEffectDirection: ListItemEffectDirection; filterPredicate: ((el: Element) => boolean) | undefined; /** * Whether keyboard navigation wraps from last to first and vice versa. * - 'stop' (default): navigation stops at the boundary * - 'wrap': navigation wraps around */ itemWrap: `stop` | `wrap`; /** * Optional renderer for the checkbox shown in `checked` interactionMode. * Receives the current `checked` state and returns a Lit template result. * * When set, the per-row checkbox becomes a `` whose * contents are whatever this returns (rendered with `lit`'s `render()`). * When unset, a native `` is used. * * @example * list.checkboxRenderer = (checked) => checked * ? html` * * ` * : html``; */ checkboxRenderer: ((checked: boolean) => unknown) | CustomCheckboxOptions | undefined; /** * Space-separated subset of `navigate select filter` — limits which * incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search * disabled. See `docs/infra-incremental.md`. */ searchModes: string | undefined; /** * Enable native browser drag-and-drop for selectable items. When true, * selectable rows become draggable and the list emits * `list-native-drag-start` when a drag begins. */ itemsDraggable: boolean; /** * Custom drag preview renderer (synchronous). Defaults to the shared * built-in HTML+canvas preview. */ dragPreviewRenderer: ListDragPreviewRenderer | undefined; /** * Write an application payload onto the drag's `DataTransfer` (e.g. a custom * MIME type). Called once per drag, synchronously inside `dragstart`, after a * non-cancelled `list-native-drag-start`. */ writeDataTransfer: ListDragDataTransferWriter | undefined; dragPreviewSource: ListDragPreviewSourceResolver | undefined; /** * Object/adapter item mode (mirrors `ixfx-detail-list`). When set, the list * builds one `
  • ` per entry and owns its light-DOM children; `formatter` * renders each entry and `keyProperty` stamps `data-key` so `selectKeys` / * `focusKey` / `getItemByKey` keep working. * * Additive: `addItem(element)` / `setItems(elements)` keep working while * `items` is unset. While `items` is set, a rebuild (on `items` / * `formatter` / `keyProperty` change) discards hand-added children. */ items: readonly unknown[] | undefined; /** * Property name on each `items` entry used for stable identity — stamped * as `data-key` on the built row. Preserves selection across rebuilds. */ keyProperty: string; /** * Renders one adapter-mode entry. The result may be a `string` (row text), * a `Node` (appended into the row `
  • `), a full row `Element` (an `
  • ` * or a `[data-list-item]` custom element, used directly), or a Lit template * result (rendered into the row `
  • ` with `render()`). Without a * formatter, string entries become row text and `Node` entries are * appended. */ formatter: ((item: unknown, index: number) => unknown) | undefined; /** * Per-item icon for adapter (`items`) mode, prepended to the row — a DOM * `Node` or anything Lit can render (usually a `TemplateResult` wrapping an * `` or an inline SVG). Ignored when the `formatter` returns a * full row element (the formatter then owns the whole row, icon included). */ icon: ((item: unknown, index: number) => unknown) | undefined; /** * CSS colour tinting the per-item `icon`. Icons paint from `currentColor`, * so this recolours them. Inline, so it wins over selection styling. */ iconColor: ((item: unknown, index: number) => string | undefined) | undefined; /** * CSS colour for the row's text. Inline, so it wins over the selected / * tickled text colours — keep it legible against both. */ textColor: ((item: unknown, index: number) => string | undefined) | undefined; /** * Finder-style badge for the row, right-justified after the text — a * `TemplateResult`, a DOM `Node`, or anything Lit can render. The row is * flex, so the badge self-justifies to the trailing edge. */ badge: ((item: unknown, index: number) => unknown) | undefined; /** * Virtualize the list: only the overscanned viewport window exists in the * DOM; offscreen rows are recycled through an off-DOM pool as the list * scrolls. Works for hand-supplied elements AND adapter (`items`) rows — * both are detached/reattached by identity, so selection, cursor and * component state survive scrolling. * * Requires `item-height`: every row must be exactly that tall (use * `--list-item-height` to match). `data-key`s are required for the key * APIs (`selectKeys`, `focusKey`, `renderedKeys`); selection by reference * (click, `select()`) works regardless. * * Limitations while active: drag-select is disabled (the window shifts * under a drag), and incremental-search `filter` mode is excluded (it * collapses rows via `hidden`, corrupting the fixed-stride geometry). * Keyboard navigation stays within the rendered window — scroll first. */ virtualize: boolean; /** * Fixed row height in px. Required for `virtualize` — the window math is * pure stride arithmetic (no DOM measurement), mirroring * `ixfx-grid-list`'s `itemSize`. */ itemHeight: number; /** * Make rows (and the empty space around them) drop targets for native * drags — including OS drags carrying files. The list fires `list-drag-over` * (cancelable: `preventDefault()` accepts the drop), `list-drop` and * `list-drag-leave`, and highlights the row under the drag with * `data-drop-target` (`--list-drop-target-bg`, `--list-drop-target-outline`). */ itemsDroppable: boolean; /** * Which targets a drag can resolve to: onto a row (`on`, the default), into the gap between two rows * (`between`), or both (`both`: the top and bottom quarter of a row mean `between`, the middle half * means `on`). `list-drop` reports the resolved `ListDropTarget`. */ dropPositions: ListDropPositions; /** * A drag that starts in this list and ends between its own rows is a **reorder** (`list-reorder`), not * a drop. Implies `items-draggable`, and `between` targets for internal drags. The list never reorders * its own items — the host owns the order (see `applyListReorder`). */ itemsReorderable: boolean; /** Sync gate for internal moves (e.g. nothing may go above a pinned row). `false` ⇒ no indicator and no event. */ canReorder: ListCanReorder | undefined; /** * For a host that cancels the browser drag in `list-native-drag-start` and starts an OS drag in its * place: say which keys a drag carries, so a drop inside this list is still a `list-reorder`. */ resolveInternalDrag: ListResolveInternalDrag | undefined; /** Why `between` drops are refused, or `undefined` when they work. Always `undefined` here: a vertical list is never sorted or grouped. */ get reorderBlocked(): ListReorderBlocked | undefined; /** * Opt in to in-place rename (`beginEdit`). Called with the typed text and * the row's key when the user commits; return `false` to reject it (the * edit then ends as a cancel). Without it `beginEdit` does nothing and rows * stay plain text. */ editValidator: ((value: string, key: string | undefined) => boolean) | undefined; /** * Refuse a drop before any event fires or any highlight shows. Given the resolved target — `on` a * row, `between` two rows, or `empty` space — and the drag's `DataTransfer`. Only used while * `itemsDroppable` is set (or for the `on` targets of an internal drag). A `between` target of an * internal move is gated by {@link canReorder} instead. */ canDrop: ListCanDrop | undefined; private readonly selection; private tickled; private _syncNativeDraggable; /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */ readonly search: ListSearchController; /** Command registry carrying this list's `list.search.*` commands. */ get registry(): CommandRegistry | undefined; connectedCallback(): void; disconnectedCallback(): void; /** * The shadow scroll list only exists after the first render; start * watching it so resizes move the window (virtualized) and the visible * set (plain) too. */ protected firstUpdated(): void; updated(changed: PropertyValues): void; /** The most recently selected item, or `undefined` if nothing is selected. */ get selectedItem(): Element | undefined; /** The full current selection set (read-only). */ get selectedItems(): ReadonlySet; addItem(item: Element | string, options?: AddItemOptions): void; /** * Collapse + fade `item` out, then detach it. The rows below slide up to * close the gap. Resolves once the element has actually been removed. * Under `prefers-reduced-motion: reduce` it's removed immediately. * A pooled (offscreen) row under virtualization is removed immediately. */ removeItem(item: Element): Promise; /** {@link removeItem} for several items at once. */ removeItems(items: Iterable): Promise; clearItems(): void; /** * Replace the entire item list in one call. * Equivalent to `clearItems()` followed by `addItem()` for each element. * Preserves `interactionMode` checkbox wrapping. */ setItems(items: readonly Element[]): void; /** * Dispatch a command to this list — used by `ixfx-grouped-item-lister` to * forward commands to all sub-components. Routes through the command registry * (so `list.search.*` and any other registered commands work). */ dispatch(commandId: CommandId, args?: Record): void; select(item: Element): void; selectMany(items: Iterable): void; deselect(item: Element): void; clearSelection(): void; selectAll(): void; /** The selection as stable `data-key` / `data-value` strings. */ get selectedKeys(): ReadonlySet; /** * Tags assigned by key, apart from the item data (like {@link partialKeys}): * tag name → keys carrying it. Each tag is mirrored on the row as `data-tags` * (`li[data-tags~="foo"]`); `tagBehaviour` can switch off selection, focus, * drag or search per tag. */ get tagKeys(): ItemTagKeys | undefined; set tagKeys(value: ItemTagKeys | undefined); /** * Interaction flags per tag name: `selectable`, `focusable`, `draggable`, * `searchable` (`false` switches one off; omitted keeps the default). With * several tags the most restrictive wins. Rows stay rendered. */ get tagBehaviour(): ItemTagBehaviour | undefined; set tagBehaviour(value: ItemTagBehaviour | undefined); /** Re-apply `data-tags` to the rows and refresh drag state. Called automatically on change and after each update. */ refreshTags(): void; /** * Rows shown as *partially* selected (a part of the resource is selected): * `data-partial`, an indeterminate checkbox in `checked` mode, and an * accessible description. Independent of `selectedKeys` — a key in both * counts as selected. Replace-on-set; keys without a row are kept for when * the row appears. */ get partialKeys(): ReadonlySet; set partialKeys(keys: Iterable); /** The key of the item under the cursor, or `undefined`. */ get tickledKey(): string | undefined; /** Replace the selection with the items carrying these keys (unknown keys ignored). */ selectKeys(keys: Iterable): void; /** Add items by key to the selection (multi-select modes only). */ addSelectedKeys(keys: Iterable): void; /** Remove items by key from the selection. */ removeSelectedKeys(keys: Iterable): void; /** * Move the cursor to the item with this key and scroll it into view. * Under virtualization the key's index is scrolled into the rendered * window first (a no-op for unknown keys). */ focusKey(key: string): void; /** The item carrying this `data-key`, or `undefined`. */ getItemByKey(key: string): Element | undefined; /** * Snapshot selection (the checked set in `checked` mode), keyboard cursor * and scroll as plain JSON keyed by `data-key` / `data-value`. Includes * pending state for keys not currently in the list. */ getViewState(options?: GetViewStateOptions): VerticalListViewState; /** * Apply saved view state. Fields present replace the current ones; keys * not in the list yet are applied as matching rows appear. */ setViewState(state: Partial): void; clearPendingViewState(): void; /** * Keys of items currently intersecting the viewport — for prioritising * viewport-first work (e.g. metadata/thumbnail fetches). A rect-intersection * test against the scroll container over the already-created rows (the same * cheap trick as `ixfx-detail-list.visibleKeys()`); hidden (filtered-out) * and keyless items are omitted. */ visibleKeys(): string[]; /** * Keys of the currently rendered window (viewport + overscan) — the * priority set for prefetching, mirroring `ixfx-grid-list.renderedKeys()`. * Use {@link visibleKeys} for the strict viewport intersection. Keyless * rows are omitted. Without virtualization, every visible row's key. */ renderedKeys(): string[]; selectedFilter(kind: `selected` | `checked` | `either`): Generator; /** * Get the source object behind a row built from `items`. Returns * `undefined` for declarative / programmatic elements. */ getItemData(item: Element): unknown; /** * Adapter mode: re-render the row carrying `key` in place — scroll and * selection are untouched. Unknown keys, and keys on rows not built from * `items`, are ignored. A no-op unless `items` is set. * * Rows whose formatter returns a full row element are swapped for the fresh * element; `
  • ` rows are refilled. (A custom-element row with a * non-element formatter result cannot be re-rendered in place and is left * alone — have the formatter return a replacement element instead.) */ updateItem(key: string, data: unknown): void; getUpdateComplete(): Promise; private _getVisibleItems; private _isCheckable; private _syncItemStates; private _syncCheckboxes; /** * Native checkbox cell: a span that stretches to the row's full cross-axis * (so the entire column height is a click target) with a real `` * centred inside. The span owns the click; the input is purely visual and * has `pointer-events:none` so a single click produces one toggle. */ private _createNativeCheckboxCell; /** * Custom checkbox cell: same shape as the native cell (a stretching span) * so behaviour is identical. The renderer's content goes inside. */ private _createCustomCheckbox; private _findListItem; private _dispatch; private _dispatchCancelable; private _onPointerOver; private _onPointerLeave; private _onKeyDown; private _onClick; private _onDblClick; private _activateItem; activateKey(key: string): void; private _onContextMenu; /** The key of the row being edited, if any. */ get editingKey(): string | undefined; /** * Edit a row's label in place with an `ixfx-editable-label`. The editor * replaces the row's `[data-edit-label]` element (else the whole row) and * the original content returns when editing ends. Fires `list-edit-commit` * `{ key, value }` when the text changed, otherwise `list-edit-cancel` * `{ key }` (Escape, an unchanged value, or one the label rejects). The list * never rewrites the label itself — update your data in response. * * Returns false when `editValidator` is not set, or the row is unknown or * not currently rendered. */ beginEdit(key: string): boolean; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-vertical-list': VerticalListElement; } interface HTMLElementEventMap extends VerticalListElementEventMap {} } export interface VerticalListElementEventMap extends ListElementEventMap { 'vertical-list-viewport-change': ListViewportChangeEvent; 'list-native-drag-start': ListNativeDragStartEvent; 'list-drag-over': ListDragOverEvent; 'list-drop': ListTargetDropEvent; 'list-reorder': ListReorderEvent; 'list-drag-leave': ListDragLeaveEvent; 'list-context-menu': ListContextMenuEvent; 'list-edit-commit': ListEditCommitEvent; 'list-edit-cancel': ListEditCancelEvent; } /** Sort direction applied to the item columns. */ type DetailSortMode = `none` | `ascending` | `descending`; /** Per-item view of a row passed to `sortComparator`. */ type DetailSortItem = { readonly element: HTMLElement; readonly data: unknown; readonly label: string; }; /** Custom comparator — return negative when `a` sorts before `b`. */ type DetailSortComparator = (a: DetailSortItem, b: DetailSortItem) => number; /** Turns one object item into row content — a plain string or a DOM node. */ type DetailFormatter = (item: unknown, index: number) => string | Node; /** * How a detail list derives an item's group key: a property name (object * items) or `data-` attribute, or a function of the item's data (`undefined` * for declarative rows) and its `
  • ` element. */ type DetailGroupBy = string | ((data: unknown, el: Element) => string); /** * Collapsible group header used by `ixfx-grid-list` and `ixfx-detail-list`. * Look matches the group rows of `ixfx-data-grid`: caret, bold label, muted * count, and a hairline divider. The host list owns the click handling. */ export declare class ListGroupHeaderElement extends LitElement { static styles: import("lit").CSSResult; label: string; count: number; collapsed: boolean; orientation: `horizontal` | `vertical`; connectedCallback(): void; protected willUpdate(): void; protected render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-list-group-header': ListGroupHeaderElement; } } /** * A list that scales horizontally, not vertically. * * Items are laid out in equal-width columns; they flow top→bottom down a * column, then wrap to the top of the next column to the right. The * component has a fixed vertical extent and scrolls horizontally. * * Selection semantics match `ixfx-vertical-list` — same modes, same * `list-*` events, same keyboard gestures — but navigation is a 2-D grid * (Up/Down move within a column, Left/Right jump columns). * * Items come from any of three sources (later writes win): * 1. declarative `
  • ` children in light DOM, * 2. `addItem()` / `setItems()`, * 3. an `items` array of objects rendered via `displayProperty` / * `formatter`, optionally streamed in via a `provider`. */ export declare class DetailListElement extends LitElement { #private; selectionMode: ListSelectionMode; interactionMode: ListInteractionMode; sort: DetailSortMode; sortBy: string; sortComparator: DetailSortComparator | undefined; items: readonly unknown[]; provider: IDataProvider | undefined; displayProperty: string; formatter: DetailFormatter | undefined; /** * Text incremental search matches for an object item. Defaults to the * caption when it is a string (`displayProperty` or a string `formatter`), * else the row's whole text — set this when `formatter` returns a `Node` * carrying more than the name (sublines, sizes, dates). */ searchText: ((item: unknown, index: number) => string) | undefined; iconProperty: string; /** * Property on each `items` entry holding a CSS colour for the item's * ``. Only read when `iconProperty` also resolves an icon. */ iconColorProperty: string; /** * Property on each `items` entry holding a CSS colour for the item's caption * text. Inline, so it wins over the selected/tickled text colours. */ textColorProperty: string; /** * Property on each `items` entry holding a Finder-style badge — a * `TemplateResult`, a DOM `Node`, or anything Lit can render. Rendered * right-justified on the row, after the caption. */ badgeProperty: string; keyProperty: string; /** * Caller-assigned tags for an object item (`undefined` ⇒ none). Each tag is * mirrored on the row as `data-tags` (style with `li[data-tags~="foo"]`), and * `tagBehaviour` can switch off selection, focus, drag or search per tag. * Re-evaluated when `items`, `tags`, `tagKeys` or `tagBehaviour` change, or on * {@link refreshTags}. */ tags: ((item: unknown, index: number) => readonly string[] | undefined) | undefined; /** * Tags assigned by key, apart from the item data (like `partialKeys`): * tag name → keys carrying it. Merged with the `tags` hook; works for * declarative rows too. */ get tagKeys(): ItemTagKeys | undefined; set tagKeys(value: ItemTagKeys | undefined); /** * Interaction flags per tag name: `selectable`, `focusable`, `draggable`, * `searchable` (`false` switches one off; omitted keeps the default). With * several tags the most restrictive wins. Rows stay rendered and keep their * place in layout. */ get tagBehaviour(): ItemTagBehaviour | undefined; set tagBehaviour(value: ItemTagBehaviour | undefined); /** Re-evaluate every row's tags (call after mutating data the `tags` hook reads). */ refreshTags(): void; filterPredicate: ((el: Element) => boolean) | undefined; /** * Whether keyboard navigation wraps from last to first and vice versa. * - 'stop' (default): navigation stops at the boundary * - 'wrap': navigation wraps around */ itemWrap: `stop` | `wrap`; /** Optional renderer for the checkbox shown in `checked` interactionMode. */ checkboxRenderer: ((checked: boolean) => unknown) | CustomCheckboxOptions | undefined; /** * Space-separated subset of `navigate select filter` — limits which * incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search * disabled. See `docs/infra-incremental.md`. */ searchModes: string | undefined; /** * Enable native browser drag-and-drop for selectable items. When true, * selectable rows become draggable and the list emits * `list-native-drag-start` when a drag begins. */ itemsDraggable: boolean; /** * Items and the empty space around them accept native drops: `list-drop` fires with the resolved * `ListDropTarget`. A drag that starts in this list is a reorder instead (see `itemsReorderable`) * when it lands between items. */ itemsDroppable: boolean; /** * Which targets a drag can resolve to: onto an item (`on`), into the gap between two items * (`between`), or both (`both`: the top and bottom quarter of a row mean `between`, the middle half * means `on`). Items flow down a column, so the gap is drawn as a line within the column. */ dropPositions: ListDropPositions; /** * A drag that starts in this list and ends between its own items is a **reorder** (`list-reorder`), * not a drop. Implies `items-draggable`, and `between` targets for internal drags. The list never * reorders its own items — the host owns the order (see `applyListReorder`). Refused while the list * is sorted (`sort`) or grouped (`groupBy`): see {@link reorderBlocked}. */ itemsReorderable: boolean; /** Sync gate on every `dragover`, given the resolved target. `false` ⇒ no indicator and no event. */ canDrop: ListCanDrop | undefined; /** Sync gate for internal moves (e.g. nothing may go above a pinned item). */ canReorder: ListCanReorder | undefined; /** * For a host that cancels the browser drag in `list-native-drag-start` and starts an OS drag in its * place: say which keys a drag carries, so a drop inside this list is still a `list-reorder`. */ resolveInternalDrag: ListResolveInternalDrag | undefined; /** Why `between` drops are refused (`sorted` / `grouped`), or `undefined` when they work. `on` drops still work. */ get reorderBlocked(): ListReorderBlocked | undefined; /** * Custom drag preview renderer (synchronous). Defaults to the shared * built-in HTML+canvas preview. */ dragPreviewRenderer: ListDragPreviewRenderer | undefined; /** * Write an application payload onto the drag's `DataTransfer` (e.g. a custom * MIME type). Called once per drag, synchronously inside `dragstart`, after a * non-cancelled `list-native-drag-start`. */ writeDataTransfer: ListDragDataTransferWriter | undefined; dragPreviewSource: ListDragPreviewSourceResolver | undefined; /** * Group rows under collapsible headers that flow inline in the columns. A * string names an item property (object items) or a `data-` attribute; * a function derives the key from `(data, element)`. `null` = ungrouped. * Groups appear in first-encounter order (after sorting and filtering). */ groupBy: DetailGroupBy | null; /** Header label for a group. Defaults to the key (`(none)` for the empty key). */ groupLabel: ListGroupLabel | undefined; /** * Let selection span groups. When `false` (default) selecting in one group * clears the others and Shift-range / select-all stay inside one group. */ crossGroupSelection: boolean; private _collapsedGroups; private _listEl; private readonly selection; private tickled; private _syncNativeDraggable; /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */ readonly search: ListSearchController; /** Command registry carrying this list's `list.search.*` commands. */ get registry(): CommandRegistry | undefined; connectedCallback(): void; disconnectedCallback(): void; firstUpdated(): void; protected willUpdate(changed: PropertyValues): void; updated(changed: PropertyValues): void; /** The most recently selected item, or `undefined` if nothing is selected. */ get selectedItem(): Element | undefined; /** The full current selection set (read-only). */ get selectedItems(): ReadonlySet; /** * Force an immediate geometry recompute. Called automatically on resize, * DOM changes, sort/filter/search changes — only needed when layout is * changed by outside forces (e.g. an external font load). */ refreshLayout(): void; /** * Rebuild every object-item row, for when something the `formatter` (or * `searchText`) reads has changed but the items themselves haven't — * reassigning the same objects keeps their rows as they are. Assigning a new * `formatter` function has the same effect. */ reformat(): void; addItem(item: Element | string, options?: AddItemOptions): void; /** * Collapse + fade `item` out, then detach it; the rows after it slide up to * close the gap. Resolves once removed. Immediate under reduced motion. */ removeItem(item: Element): Promise; /** {@link removeItem} for several items at once. */ removeItems(items: Iterable): Promise; clearItems(): void; /** * Replace the entire item list in one call. * Equivalent to `clearItems()` followed by `addItem()` for each element. */ setItems(items: readonly Element[]): void; /** * Get the source object behind an `
  • ` built from an `items` array or * provider. Returns `undefined` for declarative / programmatic elements. */ getItemData(item: HTMLLIElement): unknown; /** * Keys of items currently intersecting the viewport — for prioritising * viewport-first work (e.g. metadata/thumbnail fetches). Items are laid * out as a fixed-height, horizontally-scrolling column grid, so this is a * horizontal intersection test against the scroll container; every row of * an intersecting column counts as visible. Hidden (filtered-out) and * keyless items are omitted. Mirrors `ixfx-grid-list.visibleKeys()` / * `ixfx-data-grid.getVisibleRange()`. */ visibleKeys(): string[]; /** * Dispatch a command to this list — used by `ixfx-grouped-item-lister` to * forward commands. Routes through the command registry (so `list.search.*` * and any other registered commands work). */ dispatch(commandId: CommandId, args?: Record): void; select(item: Element): void; selectMany(items: Iterable): void; deselect(item: Element): void; clearSelection(): void; selectAll(): void; /** The selection as stable `data-key` / `data-value` strings. */ get selectedKeys(): ReadonlySet; /** The key of the item under the cursor, or `undefined`. */ get tickledKey(): string | undefined; /** Replace the selection with the items carrying these keys (unknown keys ignored). */ selectKeys(keys: Iterable): void; /** Add items by key to the selection (multi-select modes only). */ addSelectedKeys(keys: Iterable): void; /** Remove items by key from the selection. */ removeSelectedKeys(keys: Iterable): void; /** Move the cursor to the item with this key and scroll it into view. */ focusKey(key: string): void; selectedFilter(kind: `selected` | `checked` | `either`): Generator; /** * Snapshot selection, collapsed groups, cursor and scroll as plain JSON, * keyed by item / group key. Includes pending state for keys not present. */ getViewState(options?: GetViewStateOptions): DetailListViewState; /** * Apply saved view state. Fields present replace the current ones; keys not * in the data are applied as matching items arrive (rebuilds, provider * batches, `addItem`, light-DOM appends). */ setViewState(state: Partial): void; clearPendingViewState(): void; /** Groups in display order (empty when ungrouped). */ get groups(): readonly ListGroupInfo[]; /** Collapse or expand one group. Fires `list-group-toggle` when the state changes. */ setGroupCollapsed(groupKey: string, collapsed: boolean): void; toggleGroup(groupKey: string): void; collapseAllGroups(): void; expandAllGroups(): void; /** * Visible items in DOM order. Cached — every per-hover / per-frame path * reads it — and validated on each call, so it is never stale. */ private _getVisibleItems; /** * Set the column width to fit the widest visible item. * * This is opt-in; detail lists continue to use `--detail-list-column-width` * (or its 220px fallback) until this method is called. The measured value is * set directly on this element, so it takes precedence over an inherited * value. Returns the applied width in pixels, or 0 when there are no items. */ fitColumnWidth(): Promise; private _isCheckable; /** Appends the caption span; returns it so callers can style it per item. */ private _setLabel; /** * Reflect cursor / selection / checked state onto the items. After the item * set changes (or the interaction mode does) every item is visited; otherwise * only the items whose state changed are touched, so hovering is O(1). */ private _syncItemStates; /** * Rows shown as *partially* selected (a part of the resource is selected): * `data-partial`, an indeterminate checkbox in `checked` mode, and an * accessible description. Independent of `selectedKeys` — a key in both * counts as selected. Replace-on-set. */ get partialKeys(): ReadonlySet; set partialKeys(keys: Iterable); private _syncCheckboxes; /** * Native checkbox cell: a span that stretches to the row's full cross-axis * (so the entire column height is a click target) with a real `` * centred inside. The span owns the click; the input is purely visual and * has `pointer-events:none` so a single click produces one toggle. */ private _createNativeCheckboxCell; /** Custom checkbox cell: same shape as the native cell; renderer content inside. */ private _createCustomCheckbox; private _findListItem; private _dispatch; private _dispatchCancelable; private _onPointerOver; private _onPointerLeave; /** Restores hover transitions once the pointer takes over from the keyboard. */ private _endKeyboardNav; private _onKeyDown; private _onClick; private _onDblClick; private _onWheel; private _activateItem; static styles: import("lit").CSSResult[]; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-detail-list': DetailListElement; } interface HTMLElementEventMap extends DetailListElementEventMap {} } export interface DetailListElementEventMap extends ListElementEventMap, ListGroupEventMap { 'list-drop': ListTargetDropEvent; 'list-reorder': ListReorderEvent; 'detail-list-viewport-change': ListViewportChangeEvent; 'list-native-drag-start': ListNativeDragStartEvent; 'view-state-change': ViewStateChangeEvent; } export type TitlebarOrientation = `horizontal` | `vertical`; export type TitlebarVariant = `titlebar` | `midline` | `tree`; export type TitlebarToggleInteraction = `implicit` | `explicit` | `disabled`; export interface TitlebarToggleDetail { readonly collapsed: boolean; } export type TitlebarToggleEvent = CustomEvent; export type TitlebarCloseEvent = CustomEvent; export interface TitlebarElementEventMap { toggle: TitlebarToggleEvent; close: TitlebarCloseEvent; } /** * Standalone titlebar chrome: title, icon, toolbar slot, close button and * optional collapse/expand caret. Extracted from `ixfx-panel`. * * Collapsing is opt-in via `collapsible`. When absent, no caret is shown and * `toggle-interaction` is inert. `close` is fired without removing the * element — the host decides what closing means. * * CSS variables * `--titlebar-background` – bar fill (default: `var(--surface-4)`). * Set to `transparent` for a translucent header over blurred content. */ export declare class TitlebarElement extends LitElement { title: string; iconName: string; orientation: TitlebarOrientation; variant: TitlebarVariant; closable: boolean; /** Show the collapse/expand caret and enable toggle behaviour. */ collapsible: boolean; collapsed: boolean; toggleInteraction: TitlebarToggleInteraction; private _onToggleClick; private _onCloseClick; private _getCaretIcon; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-titlebar': TitlebarElement; } } export interface TitlebarElement { addEventListener: ((type: K, listener: (this: TitlebarElement, event: TitlebarElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } /** Axis values used by `ixfx-split-layout` — stored verbatim in the model. */ export type DockAxis = `row` | `column`; export type DockLayout = { readonly version: 1; readonly root: DockNode; }; export type DockNode = DockSplitNode | DockStackNode; /** * `ixfx-dock-host` view state (`kind: 'dock-host'`). `layout` is the whole * dock tree — splits and their sizes, stacks with tab order, active tab and * collapse — keyed by panel id. Panels it names that the host doesn't hold * yet keep their place and slot in when they arrive. */ export type DockHostViewState = ViewStateBase & { readonly layout?: DockLayout; }; /** * N-ary split node, rendered as a single `ixfx-split-layout`. * `direction` uses the element's flexbox sense: `row` places children * side-by-side, `column` stacks them vertically. */ export interface DockSplitNode { kind: `split`; direction: DockAxis; /** Flex weights, parallel to `children`. Need not sum to 1. */ sizes: number[]; /** Two or more children (post-normalize). */ children: DockNode[]; } export interface DockStackNode { kind: `stack`; /** Panel-ids in tab order. */ panels: string[]; /** Active panel-id (empty when the stack is empty). */ active: string; /** * App-defined container name (e.g. `primary-sidebar`). Must be unique * within a layout; lookups resolve to the first match in tree order. * Survives serialization and `normalize()` (named empty stacks are kept). */ name?: string; /** * Hide tab labels in this leaf's strip (icon-only tabs). Passed down to * the leaf's `ixfx-tab-list` as `hide-labels`. */ hideLabels?: boolean; /** * Hide this leaf's tab strip while it holds exactly one panel. Overrides the * host's `hide-single-tab-strip`; leave unset to inherit it. The strip * appears as soon as a second panel arrives. */ hideSingleTabStrip?: boolean; /** Whole stack collapsed to its titlebar / strip. */ collapsed?: boolean; /** Size to restore into the parent split on expand. */ preCollapseSize?: string; } export type DockOperation = `tabs` | `split-horizontal` | `split-vertical`; export interface DockPanelDragStartDetail { readonly panelId: string; readonly pointerId: number; readonly clientX: number; readonly clientY: number; } export type DockPanelDragStartEvent = CustomEvent; export interface DockChangeDetail { readonly layout: DockLayout; } export type DockChangeEvent = CustomEvent; /** * `dock-panel-added`. `sourceHost` is the host the panel came from (null when * it is new, or arrives from another window); `targetHost` is the host it now * lives in. The event bubbles out of nested hosts, so compare `targetHost` * to the host you care about. */ export interface DockPanelAddedDetail { readonly panelId: string; readonly sourceHost: DockHostElement | null; readonly targetHost: DockHostElement; } export type DockPanelAddedEvent = CustomEvent; /** * `dock-panel-removed`. `sourceHost` is the host the panel left; `targetHost` * is the host it moved to, or null when it is gone (closed, detached or torn * out). */ export interface DockPanelRemovedDetail { readonly panelId: string; readonly sourceHost: DockHostElement; readonly targetHost: DockHostElement | null; } /** `dock-panel-moved`: a panel changed hosts. Fired on the target host after the drop completes. */ export interface DockPanelMovedDetail { readonly panelId: string; readonly sourceHost: DockHostElement; readonly targetHost: DockHostElement; } export type DockPanelMovedEvent = CustomEvent; /** * `dock-stack-empty`: a stack lost its last panel. `name` is the stack's * container name (null when unnamed). `hostEmpty` is true when the host now * holds no panels at all — the usual cue for an app to close the owning UI. */ export interface DockStackEmptyDetail { readonly name: string | null; readonly hostEmpty: boolean; } export type DockStackEmptyEvent = CustomEvent; /** `dock-tab-contextmenu`: right-click on a visible tab. Cancelable; `preventDefault()` suppresses the native menu. */ export interface DockTabContextMenuDetail { readonly panelId: string; readonly clientX: number; readonly clientY: number; } export type DockTabContextMenuEvent = CustomEvent; export type DockPanelRemovedEvent = CustomEvent; export interface DockPanelActivatedDetail { readonly panelId: string; } export type DockPanelActivatedEvent = CustomEvent; export interface DockPanelMaximizedDetail { /** The panel now filling the host, or `null` when the maximized panel was restored. */ readonly panelId: string | null; /** The panel that was maximized before this change, or `null`. */ readonly previousPanelId: string | null; } export type DockPanelMaximizedEvent = CustomEvent; export type DockPanelInit = { panelId: string; title?: string; iconName?: string; closable?: boolean; collapsible?: boolean; /** Content kind for leaf placement rules (default `'any'`). */ kind?: string; }; /** * Placement rules for one named leaf. A panel kind is accepted when it is * not denied and (when an allowlist is present) it is allowed. `'any'` is * the default panel kind and matches literally — it is not a wildcard. */ export interface DockLeafContentRules { /** Exclusive allowlist, or null when unrestricted. `[]` seals the leaf. */ readonly allow: readonly string[] | null; /** Denylist (empty when nothing is denied). */ readonly deny: readonly string[]; } /** * Placement policy for one named leaf, passed to * `host.setLeafPlacementPolicy(name, policy)`. A superset of the kind rules * ({@link DockLeafContentRules}) plus a gate on edge splits beside the leaf. * Every field is optional and merges into the stored policy — omit a field * to leave it unchanged; use `clearLeafPlacementPolicy(name)` to reset. */ export interface DockLeafPlacementPolicy { /** Exclusive allowlist of panel kinds — same as `setLeafExclusiveContents`. `[]` seals the leaf. */ readonly allowKinds?: readonly string[]; /** Denied panel kinds — same as `setLeafDenyContents`. */ readonly denyKinds?: readonly string[]; /** * Whether an edge drop may split a new sibling leaf beside this named leaf. * Default `true`. `false` enforces strict named-area containment: the edge * drop zones beside the leaf go inert for every placement route, so a panel * cannot escape the area by splitting next to it. A permitted split still * creates an *unnamed, unconstrained* leaf — the area policy is not * propagated to it. */ readonly allowEdgeSplit?: boolean; } /** Resolved placement policy for one named leaf, returned by `getLeafPlacementPolicy()`. */ export interface DockLeafPlacementPolicyResolved { /** Exclusive allowlist, or null when unrestricted. */ readonly allowKinds: readonly string[] | null; /** Denylist (empty when nothing is denied). */ readonly denyKinds: readonly string[]; /** Whether edge splits beside the leaf are offered. */ readonly allowEdgeSplit: boolean; } /** * Reference to a stack leaf: either its container `name` or its numeric * `path` in the layout tree (e.g. `[0, 1]`). Names resolve first-match in * tree order; paths are validated against the current model. */ export type DockLeafRef = string | readonly number[]; export type DockDirection = `up` | `down` | `left` | `right`; export type DockEdge = `top` | `bottom` | `left` | `right`; /** A neighbouring leaf: `name` is null for unnamed leaves. */ export interface DockLeafInfo { readonly name: string | null; /** Path of the leaf in the current model (positional — may shift after mutations). */ readonly path: number[]; } /** Geometric neighbours of a leaf, as flat lists (most-overlapping first). */ export interface DockNeighbours { readonly above: DockLeafInfo[]; readonly below: DockLeafInfo[]; readonly left: DockLeafInfo[]; readonly right: DockLeafInfo[]; } export type DockAddPanelTarget = { /** * Name of a named stack leaf (`DockStackNode.name`). Takes precedence over * `stack` when both are given. Unknown names fall back to the first stack. */ container?: string; /** A panel-id in the target stack (legacy lookup). */ stack?: string; index?: number; op?: DockOperation; }; /** * Plain, structured-clone-safe description of a panel. Enough to recreate an * `ixfx-dock-panel` in another document / process (e.g. a new Electron * `BrowserWindow`). `contentHTML` is a best-effort capture of the panel's * light-DOM markup at snapshot time — apps whose panels hold live state or * framework-managed DOM should rebuild the body from their own model instead * and ignore this field. */ export interface DockPanelSnapshot { panelId: string; title: string; iconName: string; closable: boolean; collapsible: boolean; /** Content kind for leaf placement rules (`'any'` when unset). */ kind: string; /** The panel's `accepts` restriction token string (may be empty). */ accepts: string; /** Best-effort `innerHTML` of the panel element at capture time. */ contentHTML: string; } /** * Serializable result of hit-testing a point against a host — what a drop * there would do. Returned by `queryDropTarget()` / `previewExternalDrop()` * so a coordinator (in-page or over IPC) can reason about the outcome without * a live `DockDropZone` (which carries element references). */ export interface DockDropTarget { operation: DockOperation; /** Path of the target stack in the host model; `[]` = the host root. */ targetPath: number[]; side: `before` | `after`; /** Tab insertion index for `tabs` drops. */ gapIndex?: number; } export interface DockPanelTearOutDetail { readonly panelId: string; /** Snapshot captured from the source panel at release. */ readonly snapshot: DockPanelSnapshot; /** Pointer position in the source window's viewport at release. */ readonly clientX: number; readonly clientY: number; /** Pointer position in screen coordinates at release — for window placement. */ readonly screenX: number; readonly screenY: number; } export type DockPanelTearOutEvent = CustomEvent; export interface DockDragBoundaryDetail { readonly panelId: string; readonly clientX: number; readonly clientY: number; readonly screenX: number; readonly screenY: number; } /** `dock-panel-drag-out` / `dock-panel-drag-in`. */ export type DockDragBoundaryEvent = CustomEvent; export interface DockPanelElementEventMap { 'dock-panel-drag-start': DockPanelDragStartEvent; 'toggle': TitlebarToggleEvent; 'close': TitlebarCloseEvent; } /** * Leaf content + metadata + drag handle. Renders `ixfx-titlebar` chrome when * standalone (`presentation="solo"`) and content only when docked * (`presentation="tabbed"` — the host's tab strip carries the title chrome). * Adds `panel-id` and the titlebar drag handle. Works standalone outside a * host (the drag-start event has no listener and is inert). */ export declare class DockPanelElement extends LitElement { /** Stable identity: model key, slot name suffix, serialization id. */ panelId: string; /** * Display text (tab label, titlebar). Stored in the `label` attribute — * deliberately not `title`, so browsers never tooltip it. */ title: string; iconName: string; closable: boolean; collapsible: boolean; /** * Content kind for the host's leaf placement rules * (`setLeafExclusiveContents` / `setLeafDenyContents`). Matched literally; * defaults to `'any'`. */ kind: string; /** * Per-panel restriction when this panel is itself a drop target (solo * leaf). Space-separated `tabs` / `horizontal` / `vertical` / `all`; * `none` rejects everything; default is unrestricted. */ accepts: string; /** * Host-controlled. Docked panels are always `tabbed` (content only — the * leaf's tab strip carries the title chrome). `solo` (full titlebar chrome) * applies to panels outside a host or not currently docked. */ presentation: `solo` | `tabbed`; /** Solo-mode collapse state, mirrored from the titlebar. */ private _collapsed; private _dragPointerId; private _dragStartX; private _dragStartY; private _dragStarted; connectedCallback(): void; disconnectedCallback(): void; private _onPointerDown; private _onPointerMove; private _onPointerUp; private _teardownDragListeners; /** Clicks that begin on the close / caret buttons or the toolbar are not drags. */ private _isDragHandle; private _dispatchDragStart; private _onTitlebarToggle; private _onTitlebarClose; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-dock-panel': DockPanelElement; } } export interface DockPanelElement { addEventListener: ((type: K, listener: (this: DockPanelElement, event: DockPanelElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } export type Axis = `row` | `column`; export type WhenSmall = `prevent` | `collapse` | `close`; export interface PanelNode { kind: `panel`; id: string; el: HTMLElement; weight: number; fixedPx: number | null; minPx: number; maxPx: number | null; whenSmall: WhenSmall; collapsed: boolean; restoreWeight: number; } export interface GroupNode { kind: `group`; id: string; el: HTMLElement | null; axis: Axis; children: LayoutNode[]; weight: number; fixedPx: number | null; } export type LayoutNode = PanelNode | GroupNode; export interface SnapshotNode { kind: `panel` | `group`; id: string; weight?: number; collapsed?: boolean; children?: SnapshotNode[]; } export interface LayoutSnapshot { version: 1; root: SnapshotNode; } /** * Saved size of one direct child of an `ixfx-split-layout`, keyed by the * child's `id` in {@link SplitLayoutViewState.layout}. */ export interface SplitPanelViewState { /** * Share (0..1) of the weighted flow. For a collapsed panel, the share it * returns to when expanded. */ readonly weight: number; /** Collapsed to the gutter. Absent ⇒ expanded. */ readonly collapsed?: boolean; } /** `ixfx-split-layout` view state (`kind: 'split-layout'`). */ export type SplitLayoutViewState = ViewStateBase & { /** Direct children with an author-given `id`, keyed by that id. */ readonly layout?: Readonly>; }; export interface PanelInfo { id: string; el: HTMLElement; index: number; path: string; weight: number; collapsed: boolean; min: number; max: number | null; whenSmall: WhenSmall; } export interface SplitResizeDetail { sizes: Record; groupId: string; } export type SplitResizeEvent = CustomEvent; export interface SplitCollapseDetail { id: string; index: number; } export type SplitCollapseEvent = CustomEvent; export interface SplitExpandDetail { id: string; index: number; } export type SplitExpandEvent = CustomEvent; export interface SplitCloseDetail { id: string; index: number; } export type SplitCloseEvent = CustomEvent; export interface SplitChangeDetail { layout: LayoutSnapshot; } export type SplitChangeEvent = CustomEvent; export interface SplitLayoutElementEventMap { 'ixfx-split-resize': SplitResizeEvent; 'ixfx-split-collapse': SplitCollapseEvent; 'ixfx-split-expand': SplitExpandEvent; 'ixfx-split-close': SplitCloseEvent; 'ixfx-split-change': SplitChangeEvent; } export declare class SplitPanelElement extends LitElement { id: string; size: string; weight: string; fixed: string; min: string; max: string; whenSmall: string; collapsed: boolean; snap: string; render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-split-panel': SplitPanelElement; } } export declare class SplitLayoutElement extends LitElement { #private; direction: Axis; sizes: string; gutterSize: string; snap: string; /** Hide the gutter grip (dimpled handle). Gutters remain draggable. */ hideGrip: boolean; /** * Forget the saved size of a child that leaves instead of re-applying it * when a child with that id returns. For hosts that drive child sizes * themselves (e.g. `ixfx-dock-host`, whose leaf ids are positional). */ forgetAbsent: boolean; private _model; private _resizing; private _groupEl?; private _observer; private _applyingOwnMutation; private _dragStructurallyChanged; private _dragMachine; connectedCallback(): void; disconnectedCallback(): void; firstUpdated(): void; private _setupObserver; private _rebuildModel; private _writeCollapsedAttributes; get panels(): PanelInfo[]; /** * Snapshot the size and collapse of every direct child with an `id`. * Includes saved entries for children not currently slotted. */ getViewState(options?: GetViewStateOptions): SplitLayoutViewState; /** * Apply saved sizes. Entries for children that aren't slotted yet are kept * and applied when a child with that id appears. Present children without * an entry keep their relative size. */ setViewState(state: Partial): void; clearPendingViewState(): void; getSizes(_groupId?: string): Record; setSizes(weights: number[] | Record, _groupId?: string): void; collapse(idOrEl: string | HTMLElement): void; expand(idOrEl: string | HTMLElement): void; toggle(idOrEl: string | HTMLElement): void; closePanel(idOrEl: string | HTMLElement): boolean; /** * Bounding rects of the gutter elements, in gutter index order. lets * callers (e.g. dock junction handles) hit-test gutters without reaching * into the shadow DOM. */ getGutterRects(): DOMRect[]; /** * Programmatically begin dragging the gutter at `gutterIndex`, as if the * user had pressed on it at (`clientX`, `clientY`). The drag then follows * the pointer `pointerId` until pointerup, exactly like a native gutter * drag. Returns false when the index is out of range or the layout isn't * ready. Intended for composite resize affordances — e.g. a junction handle * that starts this drag alongside perpendicular drags on other layouts. */ beginGutterDrag(gutterIndex: number, pointerId: number, clientX: number, clientY: number): boolean; private _setCollapsedState; private _reindexSlots; private _findPanel; private _setFlexibleWeight; private _snapPx; private _collapsedPx; private _handleDragStart; private _handleDragMove; private _handleDragEnd; private _snapshotTracks; private _reseedDragState; private _onGutterPointerDown; private _onPointerMove; private _onPointerUp; private _emitResize; private _emitChange; protected render(): typeof nothing | import("lit").TemplateResult<1>; private _getTrackSizes; private _resolveTracks; private _renderGutter; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-split-layout': SplitLayoutElement; } interface HTMLElementEventMap { 'ixfx-split-resize': CustomEvent; 'ixfx-split-collapse': CustomEvent; 'ixfx-split-expand': CustomEvent; 'ixfx-split-close': CustomEvent; 'ixfx-split-change': CustomEvent; } } /** * CSS vars (can be overridden per-instance): * --selected-colour: text colour when selected * --selected-border-width: border width * --ixfx-tab-padding: vertical padding for the tab content (default: var(--space-m)) * --ixfx-tab-padding-horizontal: horizontal padding (default: same as --ixfx-tab-padding) */ export declare class TabListItemElement extends LitElement { closeable: boolean; hideLabels: boolean; /** * Label does not stretch to fill the tab (`flex: 0 0 auto` instead of * `1 1 auto`), so status content sits next to the label instead of being * pushed to the far edge. Set on the item, or on `ixfx-tab-list` which * mirrors it onto every item. */ labelNogrow: boolean; iconName: string | undefined; description: string | undefined; commandActive: string | undefined; registry: CommandRegistry | undefined; private _compact; private _hasToolbarContent; private _hasStatusContent; private _commandCleanup?; private _onLabelMutation; connectedCallback(): void; disconnectedCallback(): void; updated(changed: PropertyValues): void; private _syncTooltipAttrs; private _syncCommandListener; private _onToolbarSlotChange; private _onStatusSlotChange; private _onLabelSlotChange; /** * Attach slotchange listeners. The shadow root is empty during the first * connectedCallback (the template only exists once rendered), so this is * called again from firstUpdated. addEventListener dedupes identical * listener registrations, so double-wiring is harmless. */ private _wireSlotListeners; private _unwireSlotListeners; /** * Mirror the default-slot text into `.label[data-label]` for the `::after` * width sizer. Slotted toolbar content is excluded. */ private _syncLabelSizer; private _updateToolbarContent; /** * Named slots only render once content has been detected, so reading * assignedElements() cannot bootstrap detection. Direct light-DOM children * are exactly what a slot assigns, so scan those instead. */ private _updateStatusContent; firstUpdated(): void; render(): import("lit").TemplateResult<1>; private _onCloseClick; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { "ixfx-tab-list-item": TabListItemElement; } } /** * Events * 'change' - new tab selected { previous:string, selected:string, for:string } * 'reorder' - tab moved within the list { id:string, fromIndex:number, toIndex:number } */ export type TabListChangeDetail = { readonly previous: string | undefined; readonly selected: string; readonly for: string; }; export type TabListChangeEvent = CustomEvent; export type TabListReorderDetail = { readonly id: string; readonly fromIndex: number; readonly toIndex: number; }; export type TabListReorderEvent = CustomEvent; export type TabListDragMode = `off` | `reorder`; export declare class TabListElement extends LitElement { #private; orientation: `horizontal` | `vertical-stack` | `vertical-side`; flip: boolean; scrollable: boolean; hideLabels: boolean; /** * Labels of the child items do not stretch to fill each tab * (`flex: 0 0 auto`), so status content sits next to the label text. * Mirrored onto every item as a `label-nogrow` attribute. */ labelNogrow: boolean; shrink: boolean; dragMode: TabListDragMode; render(): import("lit").TemplateResult<1>; firstUpdated(): void; updated(changedProperties: PropertyValues): void; connectedCallback(): void; getSelectedElement(): TabListItemElement | undefined; selectElement(el: HTMLElement): void; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { "ixfx-tab-list": TabListElement; } } export interface DockHostElementEventMap { 'dock-change': DockChangeEvent; 'dock-panel-added': DockPanelAddedEvent; 'dock-panel-removed': DockPanelRemovedEvent; /** Panel changed hosts; fired on the target host after the drop. */ 'dock-panel-moved': DockPanelMovedEvent; /** A stack lost its last panel (see `detail.hostEmpty`). */ 'dock-stack-empty': DockStackEmptyEvent; /** Right-click on a visible tab. Cancelable. */ 'dock-tab-contextmenu': DockTabContextMenuEvent; 'dock-panel-activated': DockPanelActivatedEvent; /** A panel was maximized to fill the host, or restored (`detail.panelId === null`). */ 'dock-panel-maximized': DockPanelMaximizedEvent; 'dock-panel-drag-start': DockPanelDragStartEvent; /** Panel released outside every host — request to move it to a new window. */ 'dock-panel-tear-out': DockPanelTearOutEvent; /** Drag pointer left every host's bounds during a drag. */ 'dock-panel-drag-out': DockDragBoundaryEvent; /** Drag pointer re-entered a host's bounds after being outside. */ 'dock-panel-drag-in': DockDragBoundaryEvent; } export declare class DockHostElement extends LitElement { #private; /** Initial layout as `DockLayout` JSON. Absent ⇒ all pooled panels go into one root stack. */ layout: string | null; /** * Space-separated drop operations this host allows: `tabs`, `horizontal`, * `vertical`, and convenience `all`. `""` / `none` ⇒ nothing may be dropped. */ accepts: string; /** * When true, panels can be freely reorganised within this host, but * cannot be dragged out to another host. */ isolated: boolean; /** * Hide a leaf's tab strip while it holds exactly one panel; it appears when * a second panel arrives. A stack's own `hideSingleTabStrip` overrides this. */ hideSingleTabStrip: boolean; /** * Hosts exchange panels by drag only when their `family` is equal (default * `""`). Give nested or unrelated docks different families so they ignore * each other's panels. */ family: string; /** * Panel kinds accepted from *other* hosts (space-separated in the * `accepts-kinds` attribute); `null` accepts any. Panels already in this * host are unaffected, so internal moves never break. */ acceptsKinds: readonly string[] | null; /** Finest-grained veto, consulted per candidate zone. */ canAccept: ((panelId: string, op: DockOperation) => boolean) | undefined; /** * Tab label for a placeholder (a panel a restored layout names that the host * doesn't hold yet). Defaults to the panel id. */ placeholderLabel: ((panelId: string) => string) | undefined; private _model; private _pool; private _dropZone; private _dragActive; /** Panel being dragged, when this host takes part in the drag (drives the single-tab drop hint). */ private _dragPanel; /** Non-empty stacks as of the last change, to detect stacks that emptied. */ private _liveStacks; private _junctions; /** panelId → toolbar nodes currently moved out into a tab item. */ private _toolbarsOut; /** * Placement policy per named leaf: `{ allow, deny }` kind sets plus an * `allowEdgeSplit` gate (default `true`). Host-level only — never serialized * into the layout, but kept across `setViewState()` calls. Existing panels are * grandfathered; rules govern future placements (drags, `addPanel`, * re-homing). See {@link setLeafPlacementPolicy}. */ private _leafContentRules; private _tabDragPending; /** Panel whose leaf currently fills the host; `null` when none. */ private _maximizedId; private _junctionsKey; private _junctionsRaf; private _hostResizeObserver; /** * Bumped on every layout restore (`setViewState()`). Stamped onto each rendered * `ixfx-split-layout` as `data-dock-gen`, so `_foldLiveWeights` can tell a * split that still carries the *previous* generation's live weights (its * async re-render hasn't landed yet) from one that's caught up — and skip * folding the stale one back over the just-loaded model. */ private _loadGeneration; /** `toolbar-` slot names currently provided as light-DOM children. */ private _toolbarSlots; private _toolbarObserver; /** Observers for panel element attribute changes, keyed by panelId. */ private _panelObservers; connectedCallback(): void; disconnectedCallback(): void; private _onDragStart; willUpdate(changed: Map): void; /** * A toolbar parked in a tab item would be destroyed with the strip, so * hand it back before a hidden strip stops rendering. */ private _returnToolbarsOfHiddenStrips; /** Whether `stack` currently renders without a tab strip. */ private _stripHidden; updated(changed: Map): void; private _buildInitialModel; /** Ensure every pooled panel element appears in the model (appended to the first stack). */ private _mergePoolIntoModel; private _scanPanels; /** Refresh the set of provided `toolbar-` slots; re-render on change. */ private _scanToolbarSlots; private _findPanelEl; private _firstStack; private _appendPanelToFirstStack; /** Normalized content kind of a panel (`'any'` when unknown/unset). */ private _panelKind; /** Whether `kind` may live in `stack` under the current leaf rules. */ private _stackAllowsKind; /** * Whether an edge drop may split a new sibling leaf beside `stack`. Unnamed * leaves and leaves with no policy always allow it; a named leaf whose * policy sets `allowEdgeSplit: false` does not (strict named-area * containment). */ private _leafAllowsEdgeSplit; /** First stack (tree order) whose rules admit `kind`, else the first stack. */ private _firstStackAllowing; private _onPoolSlotChange; private _observePanel; private _unobservePanel; private _syncPool; /** * Snapshot the layout (live split weights folded in from the DOM). With * `includePending` (default), panels the restored layout names but the * host doesn't hold yet are kept in place; without it they are left out. */ getViewState(options?: GetViewStateOptions): DockHostViewState; /** * Restore a layout. Panels it names that aren't in the host yet keep their * place (shown as a placeholder tab) and slot in when they arrive — as a * light-DOM child, or via `addPanel()` without a target. Pooled panels it * doesn't name are appended to the first stack admitting their kind. */ setViewState(state: Partial): void; /** * Drop every placeholder: panels the restored layout names that the host * doesn't hold. Call it once the app has added all the panels it has, so * ids for panels that no longer exist don't linger (and get saved again). */ clearPendingViewState(): void; /** @deprecated Since 0.16; use `getViewState().layout`. */ saveLayout(): DockLayout; /** @deprecated Since 0.16; use `setViewState({ layout })`. */ loadLayout(layout: DockLayout): void; /** The current layout, folding live split weights from the DOM. */ private _captureLayout; /** Whether `panelId` is in the model only as a placeholder from a restored layout. */ private _isPlaceholder; /** * Dock a panel. Returns false (without touching the DOM) when the * explicitly targeted container denies the panel's `kind`. */ addPanel(panel: DockPanelElement | DockPanelInit, target?: DockAddPanelTarget): boolean; /** Whether the stack at `stackPath` admits `kind` under the leaf rules. */ private _stackAllowsKindAt; /** Whether the stack at `stackPath` permits an edge split beside it. */ private _stackAllowsEdgeSplitAt; removePanel(panelId: string): boolean; activatePanel(panelId: string): boolean; /** The panel currently maximized to fill the host, or `null`. */ get maximizedPanelId(): string | null; /** * Make a panel's leaf fill the host (above its siblings and the dock * chrome of the rest of the layout) without moving the panel element. The * panel is activated in its stack. Another panel maximized earlier is * restored first. Returns `false` for an unknown panel. */ maximizePanel(panelId: string): boolean; /** Put the maximized panel back in the layout. Returns `false` when nothing was maximized. */ restoreMaximized(): boolean; private _emitMaximized; /** Bring leaf elements in line with `_maximizedId`; restores it if the panel is gone. */ private _syncMaximized; private _clearMaximizedLeaves; getPanelIds(): string[]; /** Names of every named stack leaf, in tree order. */ getContainerNames(): string[]; /** * Snapshot of a named container (`{ name, panels, active }`), or null when * no stack carries that name. First match wins when duplicated. */ getContainer(name: string): { name: string; panels: string[]; active: string; } | null; /** Panel-ids in a named container, in tab order (`[]` when unknown/empty). */ getContainerPanels(name: string): string[]; /** Panel elements in a named container, in tab order — for iterating children. */ getContainerElements(name: string): DockPanelElement[]; private _defaultLeafRule; /** A rule entry that constrains nothing — safe to drop from the map. */ private _isEmptyLeafRule; private _warnUnknownContainer; /** * Restrict a named container to only the given panel kinds — e.g. * `setLeafExclusiveContents('editor', ['document'])`. `tabs` drops, * `addPanel`, and re-homing into the leaf then refuse other kinds. Whether * edge splits beside the leaf are offered is governed separately by * {@link setLeafPlacementPolicy}'s `allowEdgeSplit` (default `true`). * Pass `[]` to seal the leaf (nothing admitted). Warns when no stack * currently carries `name`, but the rule is still stored and applies once * one appears. Rules are host policy: kept across `setViewState()`, never * serialized. */ setLeafExclusiveContents(name: string, kinds: readonly string[]): void; /** * Forbid the given panel kinds in a named container — e.g. * `setLeafDenyContents('footer', ['files', 'document'])`. Everything else * stays admitted. Pass `[]` to lift the denial. See * {@link setLeafExclusiveContents} for scope/ordering notes. */ setLeafDenyContents(name: string, kinds: readonly string[]): void; /** * Set (merge) the full placement policy for a named leaf: kind allow/deny * lists plus the `allowEdgeSplit` gate. Omitted fields are left unchanged * — pass `clearLeafPlacementPolicy(name)` to reset. `allowKinds` / * `denyKinds` are equivalent to {@link setLeafExclusiveContents} / * {@link setLeafDenyContents} and share the same storage. * * `allowEdgeSplit: false` enforces strict named-area containment: the edge * drop zones beside the leaf go inert for every placement route (pointer * preview and drop, `queryDropTarget` / `previewExternalDrop`, * `addPanel` with a split `op`), so a panel cannot escape the area by * splitting next to it. A permitted split still creates an *unnamed, * unconstrained* leaf — the policy is not propagated to it. * * Warns when no stack currently carries `name`; the policy is stored and * applies once one appears. Host policy: kept across `setViewState()`, never * serialized. */ setLeafPlacementPolicy(name: string, policy: DockLeafPlacementPolicy): void; /** Remove every content rule and reset the edge-split gate for a named container. */ clearLeafContentRestrictions(name: string): void; /** Alias of {@link clearLeafContentRestrictions} — clears kind rules and the edge-split gate. */ clearLeafPlacementPolicy(name: string): void; /** Copy of a container's kind rules, or null when unrestricted. */ getLeafContentRestrictions(name: string): DockLeafContentRules | null; /** Resolved placement policy for a container, or null when it has none. */ getLeafPlacementPolicy(name: string): DockLeafPlacementPolicyResolved | null; /** * Geometric neighbours of a leaf (`name` or numeric `path`) — what sits * above / below / left / right of it on screen. Each entry is * `{ name, path }` (`name` is null for unnamed leaves), ordered * most-overlapping first. Returns null when the leaf is unknown. */ getNeighbours(leaf: DockLeafRef): DockNeighbours | null; /** * Move a leaf one position in `direction`, swapping with the neighbour it * shares the longest edge with (both keep the remaining structure intact). * Returns false when the leaf is unknown or nothing adjoins that way. */ moveLeaf(leaf: DockLeafRef, direction: DockDirection): boolean; /** * Move a leaf to an edge of the overall layout (e.g. toggle a sidebar from * `left` to `right`). The rest of the layout stays intact as a single * subtree and the leaf keeps its absolute size along the target axis. * Returns false when the leaf is unknown or the layout holds one leaf. */ moveLeafToEdge(leaf: DockLeafRef, edge: DockEdge): boolean; /** * Capture a structured-clone-safe {@link DockPanelSnapshot} of a panel * (identity, chrome attributes, and a best-effort `innerHTML`). Returns * null when no such panel element is known to this host. */ getPanelSnapshot(panelId: string): DockPanelSnapshot | null; /** * {@link getPanelSnapshot} + {@link removePanel} in one step: take the * snapshot, then drop the panel (and its element) from this host. Call this * from a `dock-panel-tear-out` handler once the receiving window has * recreated the panel. */ detachPanel(panelId: string): DockPanelSnapshot | null; /** * Hit-test viewport coordinates against this host and return a plain, * serializable {@link DockDropTarget} (no element references) — or null when * the point is outside the host or the resulting zone is disallowed by * `accepts` / `canAccept`. Pure query: no model mutation, no overlay. * * `panelId` is passed to `canAccept`; use any stable id for an external * panel (defaults to `"__external__"`). `kind` covers leaf content rules * for panels unknown to this host (defaults to `'any'`). */ queryDropTarget(clientX: number, clientY: number, panelId?: string, kind?: string): DockDropTarget | null; /** * Like {@link queryDropTarget}, but also shows the drop overlay so an * external (cross-window) drag gets the same visual feedback as an in-page * one. Call on every pointer update from the outer coordinator, then * {@link endExternalDrop} when the drag leaves or ends. */ previewExternalDrop(clientX: number, clientY: number, panelId?: string, kind?: string): DockDropTarget | null; /** Clear any overlay left by {@link previewExternalDrop}. */ endExternalDrop(): void; /** * Recreate a panel from a {@link DockPanelSnapshot} (or a bare * {@link DockPanelInit}) and dock it. With `at` viewport coordinates the * panel lands where a drop there would put it (respecting `accepts` / * `canAccept` and leaf content rules); without them, or when the point * misses the host, it goes into the first stack admitting its kind. * Returns the created element, or null when a panel with that id is * already docked here or its kind is refused by `acceptsKinds`. */ acceptExternalPanel(snapshot: DockPanelSnapshot | DockPanelInit, at?: { clientX: number; clientY: number; }): DockPanelElement | null; /** * Hit-test a pointer position against this host's leaves and edges. Returns * a zone with rects relative to the host, or null when the pointer is * outside the host or the candidate zone is disallowed. */ computeDropZone(clientX: number, clientY: number, panelId: string, kind?: string): DockDropZone | null; private _zoneAllowed; /** * Apply a drop. `sourceHost` differs from `this` when the drag crossed * hosts; the panel element is adopted into this host first. */ handleDrop(panelId: string, zone: DockDropZone, sourceHost?: DockHostElement): void; /** * Move `panelId` (already present somewhere in the model) to the position * described by `zone`. Shared by in-page drops and external panel adoption. */ private _applyZone; /** * Move a panel element out of this host into `target`, dropping it from * this host's model. Used for cross-host drags. */ releasePanel(panelId: string, target: DockHostElement): void; /** * Adopt a panel element from another host (the one sanctioned reparent). * `sourceHost` is reported in `dock-panel-added`. */ adoptPanelElement(el: DockPanelElement, sourceHost?: DockHostElement | null): void; /** * `drag` names the panel in flight when this host may receive it; it drives * the drop hint over a leaf whose tab strip is hidden. */ setDragActive(active: boolean, drag?: { panelId: string; kind?: string; }): void; setDropZone(zone: DockDropZone | null): void; private _scheduleJunctions; /** * Find points where a parent split's gutter line meets a nested split's * gutter (T and + crossings). Each junction handle starts both gutter drags * at once, like a corner resize in VS Code. */ private _computeJunctions; private _onJunctionPointerDown; /** Fold live weights from each rendered `ixfx-split-layout` into the model. */ private _foldLiveWeights; private _onSplitWeightsChanged; /** * Splits inside the dock are an implementation detail: keep their own * `view-state-change` from escaping (retargeted, it would look like ours). * Events from panel content pass through untouched. */ private _onInnerViewState; private _onSplitCollapsed; private _onSplitClose; private _onTabChange; private _onStripPointerDown; /** * Start a panel drag from an app-supplied handle — the way to move a panel * whose tab strip is hidden. Call it from the handle's `pointerdown`. The * drag begins once the pointer moves a few pixels (a plain click is left * alone) and then behaves exactly like a tab-item drag. Returns false when * the panel is not docked here or the press is not a primary-button press. */ beginPanelDrag(panelId: string, event: PointerEvent): boolean; private _armPanelDrag; private _onStripContextMenu; private _onTabDragMove; private _onTabDragUp; private _teardownTabDragListeners; /** After a dock drag from a tab/titlebar, swallow the trailing click so it cannot re-select or toggle. */ private _suppressNextClick; private _removeFromModel; /** Normalize, re-render, and announce the structural change. */ private _commit; private _syncSlots; /** * Per-panel toolbar routing: docked panels render content-only, so the * active panel's toolbar nodes live in its generated tab item (shown * right-aligned while active). Node moves preserve element state. Panels * outside the model keep their toolbar in their own (solo) chrome. */ private _syncToolbars; private _returnToolbar; private _returnAllToolbars; /** Dispatch a bubbling, composed event; returns false when a cancelable one was cancelled. */ private _emit; private _emitAdded; private _emitRemoved; /** Announce `dock-stack-empty` for each stack that lost its last panel since the last change. */ private _announceEmptiedStacks; private _emitChange; protected render(): import("lit").TemplateResult<1>; private _renderNode; private _renderSplit; private _renderLeaf; /** * While a drag that this leaf would accept is in flight, overlay a compact * strip stand-in on the hidden strip's slot: it shows where the dropped tab * will land (the overlay takes no layout space, so nothing jumps). */ private _renderDropHint; private _renderTabItem; private _stripCaretRect; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-dock-host': DockHostElement; } } export interface DockHostElement { addEventListener: ((type: K, listener: (this: DockHostElement, event: DockHostElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } interface Rect$1 { readonly x: number; readonly y: number; readonly w: number; readonly h: number; } interface DockDropZone { /** Host whose model would receive the drop. */ readonly host: DockHostElement; readonly operation: DockOperation; /** Path of the target stack (`[]` = the host root). */ readonly targetPath: number[]; readonly side: `before` | `after`; /** Insert position for `tabs` drops (panel index in the target stack). */ readonly gapIndex?: number; /** Highlight rect, relative to the host. */ readonly rect: Rect$1; /** Optional insertion caret for strip gaps, relative to the host. */ readonly caretRect?: Rect$1; } /** True when the point lies within the bounding box of any registered host. */ export declare function pointerOverAnyHost(clientX: number, clientY: number): boolean; export declare function isDragging(): boolean; export declare function getActiveDragPanelId(): string | null; /** * The dock model is a plain mutable tree owned exclusively by the host * element. Mutators below change the tree in place; the host calls * `normalize(root)` then `requestUpdate()` after batching mutations. */ export declare function isSplit(node: DockNode): node is DockSplitNode; export declare function isStack(node: DockNode): node is DockStackNode; export declare function createEmptyStack(): DockStackNode; export declare function createEmptyLayout(): DockLayout; export declare function createStack(panels: string[], active?: string, name?: string): DockStackNode; export declare function createSplit(direction: DockAxis, children: DockNode[], sizes?: number[]): DockSplitNode; /** * Runs after every mutation: * - stack `active` fixed to a member of `panels` (or `''` when empty) * - empty *unnamed* stacks removed from their parent split (and their * `sizes` entry); named empty stacks are kept so the name stays addressable * - splits with ≤1 child replaced by that child (spliced into the parent) * - a child split whose direction equals its parent's is flattened into it, * spreading its sizes across the slot it vacated * - `sizes` kept parallel to `children` (padded with the mean weight) * - an empty root collapses to a single empty stack */ export declare function normalize(root: DockNode): DockNode; export declare function findNode(root: DockNode, path: number[]): DockNode | null; /** Parent split of the node at `path`; null when path is empty or malformed. */ export declare function findParentOf(root: DockNode, path: number[]): DockSplitNode | null; /** Path of the stack containing `panelId`, or null. */ export declare function findStackOf(root: DockNode, panelId: string): number[] | null; export declare function collectPanelIds(root: DockNode): string[]; /** * Path of the first stack (tree order) whose `name` matches, or null. * Names are expected to be unique per layout; duplicates resolve first-wins. */ export declare function findStackPathByName(root: DockNode, name: string): number[] | null; /** Names of every named stack leaf, in tree order. */ export declare function collectContainerNames(root: DockNode): string[]; /** * Paths of every stack leaf, in tree order. `[]` is the root itself when it * is a stack. */ export declare function collectStackPaths(root: DockNode): number[][]; export declare function addPanelToStack(stack: DockStackNode, panelId: string, index?: number): void; export declare function removePanelFromStack(stack: DockStackNode, panelId: string): void; export declare function setActive(stack: DockStackNode, panelId: string): boolean; /** * Insert `node` beside the child at `targetPath`, into the parent split when * its direction matches `direction`, otherwise wrap the target in a new split. * `side` selects before/after; the neighbour's weight is split 50/50. * Returns the path of the inserted node, or null. */ export declare function insertBeside(root: DockNode, targetPath: number[], direction: DockAxis, newNode: DockNode, side: `before` | `after`): number[] | null; /** * Wrap the whole root in a new split of `direction`, replacing it in place so * the caller's reference stays valid. Returns true on success. */ export declare function wrapRoot(root: DockNode, direction: DockAxis, newNode: DockNode, side: `before` | `after`): boolean; /** * Remove the stack at `stackPath` from the tree. Its panels are moved into * `fallbackStack` (if given and still attached) so they are not silently * lost; otherwise they are dropped from the model (elements return to the * pool). Returns the removed stack. */ export declare function extractStack(root: DockNode, stackPath: number[], fallbackStack?: DockStackNode): DockStackNode | null; export interface DockRect { x: number; y: number; w: number; h: number; } export interface LeafGeom { path: number[]; name: string | null; rect: DockRect; } /** * Resolve a {@link DockLeafRef} to a stack path. Strings match container * `name` first-wins; arrays must index an existing stack leaf. Returns null * when unresolvable. */ export declare function resolveLeafPath(root: DockNode, ref: DockLeafRef): number[] | null; /** Absolute (unit-square) rect of every stack leaf, in tree order. */ export declare function computeLeafGeoms(root: DockNode): LeafGeom[]; /** * Geometric neighbours of a leaf — what the user sees above / below / left / * right of it. Each list holds `{ name, path }` (name is null for unnamed * leaves), ordered most-overlapping first. Returns null when `ref` is * unresolvable. */ export declare function getLeafNeighbours(root: DockNode, ref: DockLeafRef): DockNeighbours | null; /** * Exchange two leaves' positions in the tree, each carrying its size slot so * the remaining structure and proportions are untouched. Returns false when * either path is not a stack leaf. */ export declare function swapLeaves(root: DockNode, pathA: number[], pathB: number[]): boolean; /** * Move a leaf one position in `direction`, swapping with the neighbour it * shares the longest edge with. Returns false when `ref` is unresolvable or * nothing adjoins in that direction. Run `normalize()` afterwards. */ export declare function moveLeafStep(root: DockNode, ref: DockLeafRef, direction: DockDirection): boolean; /** * Move a leaf to an edge of the overall layout, keeping the rest of the * tree intact as a single subtree and preserving the leaf's absolute size * along the target axis. Returns false when `ref` is unresolvable or the * layout holds a single leaf. Run `normalize()` afterwards (also safe to * call it twice — the host's commit does). */ export declare function moveLeafNodeToEdge(root: DockNode, ref: DockLeafRef, edge: DockEdge): boolean; export declare function serializeLayout(root: DockNode): DockLayout; /** * Parse layout JSON, validate loosely, and normalize. Returns null when the * JSON is malformed or the root is missing/invalid. */ export declare function parseLayout(json: string): DockLayout | null; /** What a non-empty stack looked like when last observed. */ export interface DockStackSnapshot { readonly name: string | undefined; /** Panel-ids joined in tab order — identifies a stack across node re-creation. */ readonly key: string; } /** Every stack holding at least one panel, keyed by node identity. */ export declare function snapshotNonEmptyStacks(root: DockNode): Map; /** * Stacks in `before` that no longer hold their panels in `after`. A stack * node that was re-created with the same panels (some leaf moves rebuild * nodes) does not count as emptied. */ export declare function findEmptiedStacks(before: ReadonlyMap, after: ReadonlyMap): DockStackSnapshot[]; /** * Pure helpers for `ixfx-drawer`: snap-point parsing/resolution, flick * velocity tracking, and the drag-vs-scroll arbitration used when a drawer's * body contains scrolling content. No DOM access, so it is unit-testable. */ /** Which edge of its container a drawer is anchored to. */ type DrawerEdge = `bottom` | `top` | `left` | `right`; export type DrawerResizeDetail = { /** Committed size in px along the drag axis (height for top/bottom, width for left/right). */ readonly size: number; /** Index into `snapPoints` the drawer settled on; unset without snap points. */ readonly snapIndex?: number; }; export type DrawerResizeEvent = CustomEvent; export type DrawerCloseEvent = CustomEvent; export interface DrawerElementEventMap { 'drawer-close': DrawerCloseEvent; 'drawer-resize': DrawerResizeEvent; } /** Commands a named drawer registers, namespaced as `.`. */ export type DrawerCommand = `expand` | `collapse` | `toggle`; /** Builds the command id for a named drawer's command, e.g. `inspector.expand`. */ export declare function drawerCommandId(name: string, command: DrawerCommand): string; export declare class DrawerElement extends LitElement { #private; static styles: import("lit").CSSResult[]; edge: DrawerEdge; open: boolean; size: number; minSize: number; dismissThreshold: number; maxSizeRatio: number; /** Forced resting positions as fractions (0–1] of the container's length on the drag axis. */ snapPoints: number[]; /** Release speed (px/ms) at which a drag counts as a flick when snap points are set. */ flickVelocity: number; label: string; iconName: string; closable: boolean; collapsible: boolean; maintainHandle: boolean; name: string; registry: CommandRegistry | undefined; /** Rotate the header into a vertical strip (left/right drawers only). */ verticalTitle: boolean; private _dragSize; connectedCallback(): void; disconnectedCallback(): void; protected firstUpdated(changed: PropertyValues): void; protected updated(changed: PropertyValues): void; show(): void; close(): void; toggle(): void; /** Resize to the snap point at `index` (opening the drawer if needed). */ snapTo(index: number): void; private _onTitlebarToggle; private _onTitlebarClose; protected render(): ReturnType; } declare global { interface HTMLElementTagNameMap { 'ixfx-drawer': DrawerElement; } } export interface DrawerElement { addEventListener: ((type: K, listener: (this: DrawerElement, event: DrawerElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } /** * Direction of a wheel tick. `+1` for `deltaY < 0` (wheel up/away), `-1` for * `deltaY > 0` (wheel down/toward). */ type WheelDirection = 1 | -1; /** * Abstract surface a consumer of {@link WheelNudgeMixin} may override. * * `_applyWheelDelta` is called once per handled wheel tick. The consumer is * expected to reuse its existing arrow-key step math (typically a shared * `_stepByDelta(direction, effectiveStep)` private method) and call it here. * The mixin ships a no-op default so `override` in a consumer always has a * base member to attach to. * * `_shouldHandleWheel` may be overridden to restrict when the wheel acts * (e.g. editable-number rejects while the user is typing). * * Both are declared here as methods (not arrow-function properties) so a * consumer's `override _applyWheelDelta() {}` stays method-compatible with * the base — see the `ts/method-signature-style` override in `eslint.config.js`, * which stops the linter rewriting these back to property signatures. */ interface WheelNudgeConsumer { _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void; _shouldHandleWheel(): boolean; } declare const EditableNumber_base: typeof EditableLabel & (new (...args: any[]) => WheelNudgeConsumer); export declare class EditableNumber extends EditableNumber_base { #private; min?: number; max?: number; step?: number; /** Quantised stops for keyboard nudging. Overrides `step` when > 1. */ stops?: number; dragSensitivity: number; fillStyle?: `linear` | `circular`; linearStyle?: `range` | `bipolar` | `unipolar`; circularStyle?: `grow` | `offset` | `dot`; noDrag: boolean; precision: number; constructor(); render(): import("lit").TemplateResult<1>; private _stopNativeInput; connectedCallback(): void; disconnectedCallback(): void; private _handleMouseEnter; private _handleMouseLeave; /** Click just focuses; edit mode is entered by pressing a key while focused. */ protected _handleClick: () => void; /** Suppress auto-edit-on-focus from editor mode; keydown handles it instead. */ protected _handleFocus: () => void; /** Override to use .number instead of .content for text display */ protected get _contentEl(): HTMLElement | undefined; firstUpdated(changedProperties: Map): void; protected _onUserInteraction(): void; private _onValueChange; updated(changedProperties: Map): void; private _updateValueCss; protected _getDisplayText(): string; protected _tryCommit(): void; protected _handleBeforeInput: (e: InputEvent) => void; protected _handleKeydown: (e: KeyboardEvent) => void; private _onKeyDown; private _handleArrowKey; /** * Apply a signed delta to the current value, clamp/snap/format, and fire * `input`/`change`. Shared between arrow-key handler and the wheel handler. */ private _applyDelta; _shouldHandleWheel(): boolean; _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void; private _onPointerDown; private _onPointerMove; private _onPointerUp; private _interceptClick; private _parseValue; /** * Formats the stored value for display, inferring decimal places from the value * string itself. This preserves typed precision (e.g. "0.1234" stays "0.1234") * and also respects trailing zeros written by drag storage (e.g. "5.0" stays "5.0"). */ private _formatDisplay; private _clamp; private _snap; private _inferDecimals; private _formatNumber; /** Returns a 0..1 fraction for the given value within [min, max]. */ private _normalizedValue; static styles: CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-editable-number': EditableNumber; } } /** How branches and leaves are ordered within one level. */ type FlatListBranchOrder = `first` | `mixed`; type FlatListNavigateDetail = { /** Key path (excluding the root) of the level now shown. */ readonly path: readonly string[]; /** Key path of the level shown before. */ readonly previousPath: readonly string[]; /** The node whose children are now listed (the root when `path` is empty). */ readonly node: TreeNode; /** `into` = descended, `up` = moved to an ancestor, `jump` = anything else (crumb, API). */ readonly direction: `into` | `up` | `jump`; }; type FlatListSelectDetail = { readonly selected: ReadonlySet; readonly selectedKeys: ReadonlySet; readonly previous: ReadonlySet; }; type FlatListActivateDetail = { readonly node: TreeNode; }; type FlatListDropDetail = { /** The row dropped on — a branch is *not* entered — or the current level's node for empty space or a gap between rows. */ readonly node: TreeNode; readonly dataTransfer: DataTransfer; /** What the drop resolved to: `on` a row, `between` two rows of the current level, or `empty` space. */ readonly target: ListDropTarget; }; type FlatListContextMenuDetail = { /** The row the menu was requested on (already selected). */ readonly node: TreeNode; /** The whole selection, `node` included. */ readonly nodes: readonly TreeNode[]; readonly x: number; readonly y: number; }; type FlatListEditCommitDetail = { readonly node: TreeNode; readonly value: string; }; type FlatListEditCancelDetail = { readonly node: TreeNode; }; /** * `ixfx-flat-list` view state. `selected`, `focus` and `scroll` belong to the * level at `path`; they are held until that level is shown, then handed to * the inner list. */ type FlatListViewState = ViewStateBase & { /** Keys from the root (excluded) to the level shown — the `path` property. */ readonly path?: readonly string[]; }; type FlatListNavigateEvent = CustomEvent; type FlatListSelectEvent = CustomEvent; type FlatListActivateEvent = CustomEvent; type FlatListDropEvent = CustomEvent; type FlatListContextMenuEvent = CustomEvent; type FlatListEditCommitEvent = CustomEvent; type FlatListEditCancelEvent = CustomEvent; interface FlatListElementEventMap { 'flat-list-navigate': FlatListNavigateEvent; 'flat-list-select': FlatListSelectEvent; 'flat-list-activate': FlatListActivateEvent; 'flat-list-drop': FlatListDropEvent; 'flat-list-context-menu': FlatListContextMenuEvent; 'flat-list-edit-commit': FlatListEditCommitEvent; 'flat-list-edit-cancel': FlatListEditCancelEvent; } /** * Navigates a tree inside one flat list. Each level shows its branches and * leaves together in an `ixfx-vertical-list`; entering a branch swaps the list * for that branch's children, and an `ixfx-crumb-navigation` pinned above the * scroll area shows the path and jumps back up. * * Uses the same `TreeNode` / `TreeDataModel` data as `ixfx-crumb-navigation` * and `ixfx-tree-list`. As in crumb-navigation, lazily loaded children are * written back to `node.children`. * * Selection and keyboard behaviour is the inner list's. On top of that: * double-click / Enter / ArrowRight enter the cursor branch; * ArrowLeft / Backspace go up. Selection is cleared on every level change. * * Events (all bubble, composed) * - `flat-list-navigate` `{ path, previousPath, node, direction }` * - `flat-list-select` `{ selected: Set, selectedKeys, previous }` * - `flat-list-activate` `{ node }` — a leaf was double-clicked / Enter pressed * The inner list's own `list-*` events also cross the shadow boundary. * * CSS variables (others, e.g. `--list-item-height`, pass through to the list) * --flat-list-bg: var(--list-bg, var(--surface-3)); * --flat-list-text: var(--list-text, var(--surface-3-text)); * --flat-list-border: var(--list-border, var(--border)); * --flat-list-radius: var(--list-radius, var(--radius-s)); * --flat-list-crumb-padding: var(--space-xs); * --flat-list-crumb-font-size: var(--text-s); * --flat-list-toolbar-gap: var(--space-xs); // between the crumbs and slotted toolbar items * --flat-list-chevron-gap: 0.4em; // space after the branch chevron * --flat-list-marked-bg / --flat-list-marked-bar: the `marked-key` row * --flat-list-empty-text: var(--surface-muted-text); */ export declare class FlatListElement extends LitElement { #private; root: TreeNode | undefined; model: TreeDataModel | undefined; /** Keys from the root (excluded) to the level being shown. */ path: readonly string[]; /** Lazily loads a branch's children when `node.children` is `undefined`. */ loadChildren: LoadChildrenCallback | undefined; filterPredicate: TreeFilterPredicate | undefined; /** Orders nodes within the level (within each half when `branchOrder` is `first`). */ sort: ((a: TreeNode, b: TreeNode) => number) | undefined; branchOrder: FlatListBranchOrder; selectionMode: ListSelectionMode; interactionMode: ListInteractionMode; /** * Row keys shown as *partially* selected (see `ixfx-vertical-list`'s * `partialKeys`). Independent of the selection; a key in both counts as selected. */ partialKeys: ReadonlySet; itemWrap: `stop` | `wrap`; searchModes: string | undefined; itemsDraggable: boolean; /** Write an application payload onto the drag's `DataTransfer`. Forwarded to the inner list. */ writeDataTransfer: ListDragDataTransferWriter | undefined; /** Rows (and empty space) accept native drops. See `flat-list-drop`. */ itemsDroppable: boolean; /** * Which targets a drag can resolve to: onto a row (`on`, the default), into the gap between two rows * (`between`), or both. Forwarded to the inner `ixfx-vertical-list`; `flat-list-drop` reports the target. */ dropPositions: ListDropPositions; /** * A drag that starts in this list and ends between its own rows is a reorder: the inner list's * `list-reorder` (keys are node keys, in display order) bubbles out of this element. The list never * reorders anything — the host owns the order (see `applyListReorder`). Implies `items-draggable`. */ itemsReorderable: boolean; /** * Refuse a drop before it is highlighted or reported, given the resolved target: `on` a row, * `between` two rows of the current level, or `empty` space (the current level itself). */ canDrop: ListCanDrop | undefined; /** Sync gate for internal moves (e.g. nothing may go above a pinned row). */ canReorder: ListCanReorder | undefined; /** * For a host that cancels the browser drag in `list-native-drag-start` and starts an OS drag in its * place: say which node keys a drag carries, so a drop inside the list is still a reorder. */ resolveInternalDrag: ListResolveInternalDrag | undefined; /** * Opt in to in-place rename. Called with the typed text and the node when * the user commits; return `false` to reject it. Without it nothing can be * renamed and rows are plain text. Rows must also have `item.editable`. */ validateEdit: ((value: string, node: TreeNode) => boolean) | undefined; /** Key of a node to keep visibly marked across level changes (unlike selection). */ markedKey: string | undefined; /** Only render the visible rows. Needs `itemHeight`. See `ixfx-vertical-list`. */ virtualize: boolean; /** Fixed row height in px, required for `virtualize`. */ itemHeight: number; /** Show an Up button in the crumb bar. Off by default: clicking the last crumb goes up too. */ /** Row entry / exit effect when the level changes (`sweep`, or `none`). See `ixfx-vertical-list`. */ itemEffect: ListItemEffect; withUp: boolean; hideRoot: boolean; /** * Hide the breadcrumb navigation (and its Up button). Navigation still works * by keyboard, double-click and the `navigate*()` methods. A slotted toolbar * stays visible; with nothing slotted the whole bar goes. */ hideNav: boolean; /** Shown when the current level has no children. */ emptyText: string; /** Mirrors the inner list's `:focus-visible`, so the ring can go round the whole component. */ private _focusVisible; /** Whether anything is slotted into the toolbar; an empty toolbar takes no space. */ private _hasToolbar; private _rows; private _loading; /** The inner list, for registry / search commands and other advanced use. */ get list(): VerticalListElement | undefined; /** Command registry carrying the inner list's `list.search.*` commands. */ get registry(): VerticalListElement[`registry`]; /** Run a command on the inner list, e.g. `dispatch('list.search.filter')`. */ dispatch(commandId: string, args?: Record): void; /** * Rename a row in place. Needs `validateEdit`, and only rows whose * `item.editable` is true can be edited. Ends with `flat-list-edit-commit` or `flat-list-edit-cancel`; the * label is not rewritten — update the tree in response. Returns false if * the row is unknown, not editable, or not on screen. */ beginEdit(key: string): boolean; /** The node whose children are listed. */ get currentNode(): TreeNode | undefined; get selectedNodes(): ReadonlySet; /** Show the children of the node at this key path. Returns false if the path does not resolve. */ navigateTo(keys: readonly string[]): boolean; /** Enter the child branch with this key. */ navigateInto(key: string): boolean; /** Move to the parent level. Returns false at the root. */ navigateUp(): boolean; /** * Snapshot the level shown (`path`) and, from the inner list, its selection, * cursor and scroll. Includes a saved level not reached yet. */ getViewState(options?: GetViewStateOptions): FlatListViewState; /** * Go to a saved level. Keys not loaded yet are reached as they load (the * level shown is always loaded); `selected` / `focus` / `scroll` apply once * that level is shown. */ setViewState(state: Partial): void; clearPendingViewState(): void; disconnectedCallback(): void; protected willUpdate(changed: PropertyValues): void; protected updated(changed: PropertyValues): void; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-flat-list': FlatListElement; } } export interface FlatListElement { addEventListener(type: K, listener: (this: FlatListElement, event: FlatListElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } export declare class FormGroupElement extends LitElement { label: string; /** Label justification in the wide layout. Inherits from `ixfx-form` when unset. */ labelAlign?: `left` | `right`; private _fieldset?; private _observer?; protected createRenderRoot(): this; connectedCallback(): void; firstUpdated(): void; disconnectedCallback(): void; private _sync; /** Sets the number of label/input pairs in the widest shared row, used for the wide grid columns. */ private _updatePairs; private _moveChildren; protected render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-form-group': FormGroupElement; } } /** * Groups several option `ixfx-form-part` elements (typically radio buttons) * under one label. Options flow horizontally by default, each shown as the * control with its label centred underneath. */ export declare class FormOptionsElement extends LitElement { label: string; orientation: `horizontal` | `vertical`; private readonly _labelId; private _observer?; protected createRenderRoot(): this; connectedCallback(): void; firstUpdated(): void; disconnectedCallback(): void; private _moveChildren; protected render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { "ixfx-form-options": FormOptionsElement; } } export declare class FormPartElement extends LitElement { label: string; private _id?; protected createRenderRoot(): this; connectedCallback(): void; private _ensureId; protected render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { "ixfx-form-part": FormPartElement; } } /** * Lets two or more `ixfx-form-part` elements share a row. * Each part is given a 1-based `--ixfx-form-part-index` so CSS can place it. */ export declare class FormRowElement extends LitElement { private _observer?; protected createRenderRoot(): this; connectedCallback(): void; disconnectedCallback(): void; private _indexParts; } declare global { interface HTMLElementTagNameMap { "ixfx-form-row": FormRowElement; } } type CollectFormValuesOptions = { /** Return numbers (or `null` when empty) for `number` and `range` inputs, instead of strings. */ typed?: boolean; }; /** * Wraps its content in a native ``, so submit, Enter-to-submit, * validation, `FormData` and `form.elements` behave as they do for any form. * Submitting never navigates: listen for the standard `submit` event. */ export declare class FormElement extends LitElement { /** Label justification in the wide layout. Groups can override. */ labelAlign: `left` | `right`; /** Skip validation when submitting (like ``). `reportValidity()` still validates. */ noValidate: boolean; private _form?; private _observer?; protected createRenderRoot(): this; /** The native form element that holds the content. */ get form(): HTMLFormElement; /** Native controls in the form. Components with their own shadow root are not included. */ get elements(): HTMLFormControlsCollection; connectedCallback(): void; disconnectedCallback(): void; protected updated(): void; /** Moves everything into the native form. Nodes (not just elements) move so Lit's markers stay with their content. */ private _adoptChildren; /** * Browsers only submit on Enter when the form has a native submit button * or a single text field. Cover the other cases (e.g. an `ixfx-button`). */ private readonly _onKeydown; /** Validates (unless `novalidate`), then fires `submit`. */ requestSubmit(): void; /** Resets native controls. Components with their own shadow root are not reset. */ reset(): void; /** True if all native controls are valid. Shows nothing. */ checkValidity(): boolean; /** True if all native controls are valid. Otherwise shows the browser's message on the first invalid one. */ reportValidity(): boolean; /** Values of all named controls, including components with their own shadow root. Numbers are strings unless `typed`. */ getValues(options?: CollectFormValuesOptions): Record; setValues(data: Record): void; } declare global { interface HTMLElementTagNameMap { 'ixfx-form': FormElement; } } /** * Helpers for key-based selection on the Element-flavoured list components * (`ixfx-vertical-list`, `ixfx-detail-list`, `ixfx-grid-list`). * * A "key" is a stable string the host puts on each item element — `data-key` * (preferred) or `data-value`. It survives the host rebuilding the item set * (re-fetch, re-sort, filter) where raw `Element` references do not. */ /** * The stable key for an item element: `data-key`, then `data-value`, else * `undefined`. */ export declare function keyForElement(el: Element): string | undefined; /** * A lazily-built key → element index over a container. Rebuilt on first use * and after any child-list mutation under `root`; `invalidate()` forces a * rebuild on the next `get()`. * * ```ts * #keyIndex = new KeyedElementIndex(this); * // ... * const el = this.#keyIndex.get(`row-42`); * // on disconnect: * this.#keyIndex.dispose(); * ``` */ export declare class KeyedElementIndex { #private; /** * @param root Container whose descendants are indexed. * @param itemSelector Which descendants count as items (default: any `[data-key]`). */ constructor(root: Element, itemSelector?: string); /** The element with this key, or `undefined`. First match wins on duplicates. */ get(key: string): Element | undefined; /** Force a rebuild on the next `get()` — e.g. after a `data-key` attribute change. */ invalidate(): void; /** Stop observing and drop the cache. */ dispose(): void; } /** Caption for a drag entry — explicit element labels win, then data values, then generic element text, then the key. */ export declare function captionForEntry(entry: ListDragEntry): string; /** * Built-in drag preview shared by the list components. `tree-list` gets a * compact row pill (icon + label + count badge); the others get the layouts below. * * - ≤5 selected → a row of small cards (thumbnail well + caption). * - >5 selected → a compact list (`N items` header, up to 5 rows, `+N more`). * * Always returns an offscreen `element` for `DataTransfer.setDragImage()` and, * when a 2D context is available, a DPR-aware painted `canvas` for native * hosts. Colours track the active theme via `ctx.hostStyle` CSS variables. * * When `ctx.resolveDragPreviewSource` is provided, it is called for each * selected entry before the default DOM-image lookup. The resolver must * return an already-loaded `CanvasImageSource` (e.g. an ``, ``, * `
  • `) that `ixfx-vertical-list` renders and handles * pointer/keyboard interaction for. * * The returned element bridges the `list-*` event names fired by * `ixfx-vertical-list` to the `select / activate / item-click / tickle` names * required by `IGroupedSubComponent`, and maps element-based selection sets back * to typed `T` values. * * @example Basic usage with ixfx-grouped-item-lister: * ```ts * lister.factory = () => * createVerticalListAdapter(item => { * const li = document.createElement('li'); * li.textContent = item.label; * return li; * }); * ``` */ export declare function createVerticalListAdapter(renderItem: (item: T) => Element, options?: VerticalListAdapterOptions): HTMLElement & IGroupedSubComponent; type BytePos = number; type SingleSelection = { readonly kind: `single`; readonly pos: BytePos; }; type ContiguousSelection = { readonly kind: `contiguous`; readonly start: BytePos; readonly end: BytePos; }; type RectangularSelection = { readonly kind: `rectangular`; readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; type Selection$1 = SingleSelection | ContiguousSelection | RectangularSelection | null; type DiffEntry = { readonly before: number; readonly after: number; }; type Diff = ReadonlyMap; type ColourScheme = `ascii` | `shade`; export declare class IxfxHexEditorElement extends LitElement { columns: number; colourScheme: ColourScheme; showChangeset: boolean; hideOffsetCol: boolean; hideHexCol: boolean; hideTextCol: boolean; private _selection; private _scrollTop; private _editState; private _containerH; private _shadeMap; private _focusSide; private _store; private _undoStack; private _copyBuffer; private _rowHeight; private _dragStart; private _dragAnchor; private _rectAnchorX; private _rectAnchorY; private _rectAnchorXFromKeyboard; private _rectAnchorYFromKeyboard; private _initialSelectionPoint; private _currentCursorPoint; private _pointerMode; private _currentDragDiff; private _shiftClickTarget; static styles: import("lit").CSSResult; setData(data: Uint8Array): void; undo(): void; redo(): void; recomputeColours(): void; selectedBytes(): Generator<{ selection_index: number; array_index: number; value: number; }>; containsPosition(pos: number): boolean; selectSingle(position: number): void; selectContiguous(start: number, end: number): void; selectRectangular(x: number, y: number, width: number, height: number): void; clearSelection(): void; getSelection(): Selection$1; protected firstUpdated(): void; private _onScroll; private _onPointerDown; private _onPointerMove; private _onPointerUp; private _onKeyDown; private _handleBackspace; private _handleValueEntry; private _commitDecimalValue; private _advanceCursor; private _dispatchChangeEvent; private _dispatchSelectEvent; private _copy; private _paste; private _parseHexString; private _getColHeaders; private _isRowShaded; private _isHexShaded; private _isTextShaded; protected render(): import("lit").TemplateResult<1>; private _renderRow; private _renderColumn; private _renderHexCell; private _renderTextChar; } export type HexChangeDetail = { readonly diff: Diff; }; export type HexChangeEvent = CustomEvent; export type SingleSelectEventDetail = { readonly type: `single`; readonly position: number; }; export type ContiguousSelectEventDetail = { readonly type: `contiguous`; readonly start: number; readonly end: number; }; export type RectangularSelectEventDetail = { readonly type: `rectangular`; readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; export type NoneSelectEventDetail = { readonly type: `none`; }; export type SelectEventDetail = SingleSelectEventDetail | ContiguousSelectEventDetail | RectangularSelectEventDetail | NoneSelectEventDetail; declare global { interface HTMLElementTagNameMap { 'ixfx-hex-editor': IxfxHexEditorElement; } } /** Euclidean norm (`|z|`) of a point. */ export declare function norm(a: Point): number; /** Clamp a point to stay strictly inside the unit disk (the Poincaré model's boundary is never reached). */ export declare function clampToDisk(p: Point, maxNorm?: number): Point; /** * Möbius transform that translates `a` to the origin: `(z - a) / (1 - conj(a) * z)`. * A hyperbolic isometry — preserves all pairwise Poincaré distances. */ export declare function mobiusToOrigin(z: Point, a: Point): Point; /** * Inverse of {@link mobiusToOrigin}: translates the origin back to `a`, i.e. * `(z + a) / (1 + conj(a) * z)`. */ export declare function mobiusFromOrigin(z: Point, a: Point): Point; /** * Möbius addition (gyrogroup composition) of two disk-translations: the * canonical-space point reached by translating the origin to `a`, then * translating that local frame's origin by `b`. */ export declare function mobiusAdd(a: Point, b: Point): Point; /** Euclidean Poincaré-disk radius corresponding to hyperbolic distance `d` from the origin. */ export declare function euclideanRadiusForHyperbolicDistance(d: number): number; /** Hyperbolic distance from the origin corresponding to Euclidean disk radius `r`. */ export declare function hyperbolicDistanceForEuclideanRadius(r: number): number; /** Hyperbolic (Poincaré) distance between two points in the unit disk. */ export declare function poincareDistance(p: Point, q: Point): number; /** * Point at parameter `t` (0–1) along the hyperbolic geodesic from `a` to `b`. * `t=0` yields `a`, `t=1` yields `b`; intermediate values move at constant * hyperbolic speed along the geodesic (not the Euclidean straight line). */ export declare function geodesicInterpolate(a: Point, b: Point, t: number): Point; /** * An orientation-preserving isometry of the Poincaré disk, stored as the * SU(1,1) pair `(a, b)` of the map `z ↦ (a·z + b) / (conj(b)·z + conj(a))`. * * Every disk isometry is a translation *plus a rotation*, and composing two * translations generally yields a rotation too (the hyperbolic "gyration"). * Tracking the full map — rather than just "the point that goes to the * origin" — is what keeps a recursively-built local frame correctly oriented. */ export type DiskIsometry = { readonly a: Point; readonly b: Point; }; export declare const identityIsometry: DiskIsometry; /** Apply `m` to `z`. */ export declare function applyIsometry(m: DiskIsometry, z: Point): Point; /** `outer ∘ inner` — apply `inner` first, then `outer`. */ export declare function composeIsometry(outer: DiskIsometry, inner: DiskIsometry): DiskIsometry; export declare function invertIsometry(m: DiskIsometry): DiskIsometry; /** Pure translation carrying the origin to `p` (same map as {@link mobiusFromOrigin}). */ export declare function translationFromOrigin(p: Point): DiskIsometry; /** `z ↦ e^{iθ}·z`. */ export declare function rotationIsometry(theta: number): DiskIsometry; /** * The view map that sends canonical point `center` to the origin, then * rotates by `rotation` radians: `z ↦ e^{i·rotation}·mobiusToOrigin(z, center)`. */ export declare function viewIsometry(center: Point, rotation?: number): DiskIsometry; /** Decompose `m` into the `{ center, rotation }` accepted by {@link viewIsometry}. */ export declare function decomposeViewIsometry(m: DiskIsometry): { center: Point; rotation: number; }; /** * Exact geodesic between `p` and `q`, for rendering: either a straight * segment (when the geodesic is a diameter) or a circular arc orthogonal to * the unit circle. `sweep` follows SVG's `sweep-flag` convention in the * points' own (unflipped) coordinate system; the in-disk segment of an * orthogonal circle is always less than a semicircle, so it's always the * minor arc. */ export type GeodesicSegment = { readonly kind: `line`; } | { readonly kind: `arc`; readonly center: Point; readonly radius: number; readonly sweep: 0 | 1; }; export declare function geodesicSegment(p: Point, q: Point): GeodesicSegment; /** SVG path `d` for the geodesic from `p` to `q`, with coordinates multiplied by `scale`. */ export declare function geodesicPath(p: Point, q: Point, scale?: number): string; /** * Pointer/keyboard gesture mapping (subset of `TreeInteractionMode`). * `checked` is deliberately unsupported — there is no checkbox affordance at * disk-edge node scale. */ type HyperbolicInteractionMode = `implicit` | `standard` | `manual`; /** A point in the Poincaré unit disk, represented as a complex number `x + yi`. */ type Point = { readonly x: number; readonly y: number; }; /** A single node positioned on the Poincaré disk. */ type HyperbolicLayoutNode = { readonly node: TreeNode; /** `node.item.key`. Not necessarily unique if the data repeats keys — use {@link id} for identity. */ readonly key: string; /** * Layout id derived from the key path from the root — unique even when * `item.key`s repeat across the tree (e.g. `readme.md` in many folders). */ readonly id: string; /** Absolute depth from the true root (root is depth 0). */ readonly depth: number; /** Tree-graph distance (steps) from the current focus — `0` for the focused node itself. */ readonly ring: number; readonly parentKey: string | undefined; readonly parentId: string | undefined; /** Poincaré-disk position with the focus projected to the origin. */ readonly position: Point; /** * Angular width (radians) this node was allocated by its parent's * partition — root is `2π`. Measured in the *parent's canonical local * frame*, not on screen: after refocusing, the same share can look very * different in size. For on-screen crowding use the projected `position`s * (the built-in renderer caps node size by nearest-neighbour distance). */ readonly angularShare: number; /** This node's raw `TreeItem.weight`, if set. */ readonly weight: number | undefined; /** * `weight` normalized to `0..1` against the min/max weight of the * currently visible node set. `0.5` when this node (or the whole visible * set) has no weight set. Exposed to renderers as the `--node-weight` CSS * custom property so weight can drive node size, colour, etc. via CSS. */ readonly weightNormalized: number; }; /** An edge between two currently-visible nodes, with their projected endpoints. */ type HyperbolicLayoutEdge = { readonly fromKey: string; readonly toKey: string; /** Layout ids of the endpoints — see {@link HyperbolicLayoutNode.id}. */ readonly fromId: string; readonly toId: string; readonly from: Point; readonly to: Point; /** * Average of the two endpoint nodes' {@link HyperbolicLayoutNode.weightNormalized}. * Exposed to renderers as the `--edge-weight` CSS custom property. */ readonly weightNormalized: number; }; type ComputeHyperbolicLayoutOptions = { /** * Node to center the view on: a layout id ({@link HyperbolicLayoutNode.id}) * or a plain `item.key` (first depth-first match). Defaults to the true root. */ focusedKey?: string; /** Tree-graph steps from the focus to lay out and render. Defaults to unlimited. */ maxRadius?: number; /** * Safety cap on canonical-position recursion depth from the true root * (independent of `maxRadius`, which windows around the focus). Default 24. */ maxDepth?: number; /** * Center the view on this point of the focus's local frame instead of the * focus itself (which is that frame's origin). */ centerOverride?: Point; /** * Full focus-local → screen isometry to project through, taking * precedence over `centerOverride`. Unlike a bare center, this can also * carry a rotation — needed for panning to track the pointer faithfully. * Views are expressed relative to the focus (not the root) so they stay * precise however deep the focus is. */ view?: DiskIsometry; /** * Minimum hyperbolic distance placed between each generation (bushy * nodes' children go further, per `siblingSpacing`). Default `1`. * Raising it exaggerates the disk's fisheye compression (distant * generations crowd the boundary faster, reading as "zooming in" on the * focus); lowering it flattens the layout toward a Euclidean-feeling one. */ curvature?: number; /** * Minimum hyperbolic distance between adjacent siblings. Children of a * bushy node are pushed further from it until they're at least this far * apart — so dragging a crowded fan towards the center always spreads it * out (panning can't change hyperbolic distances, only magnify them). * `0` disables it (every child at exactly `curvature`). Default `0.5`. */ siblingSpacing?: number; }; type HyperbolicEdgeRenderContext = { readonly edge: HyperbolicLayoutEdge; readonly fromNode: TreeNode; readonly toNode: TreeNode; }; /** Custom renderer for an edge, given its projected endpoints and the nodes it connects. */ type HyperbolicEdgeRenderer = (context: HyperbolicEdgeRenderContext) => unknown; /** * Fired when the focused (centered) node changes. * Event name: `focus` */ type HyperbolicFocusDetail = { readonly node: TreeNode; readonly previous: TreeNode | undefined; }; type HyperbolicFocusEvent = CustomEvent; /** * Pure view-state helpers for `ixfx-hyperbolictree-list`. The element re-runs * {@link reconcileHyperbolicViewState} whenever its structure changes (new * `root` / `model`, model invalidation, a lazy load), so state keyed to nodes * that left the tree goes pending and comes back when those keys reappear. */ /** * `ixfx-hyperbolictree-list` view state. * - `selected` / `focus` — the shared base fields (`focus` is the keyboard * cursor, not the centred node). * - `center` — key path from the root's children down to the centred node * (`[]` = the root). A path, not a lone key, because keys may repeat across * branches here (e.g. `readme.md`), and so a deep centre in lazily-loaded * data can be restored by loading each ancestor in turn. A free pan away * from the centred node is transient and not saved. * - `zoom` — the visual magnification (the `zoom` property). */ type HyperbolicTreeListViewState = ViewStateBase & { readonly center?: readonly string[]; readonly zoom?: number; }; /** * How nodes are drawn: * - `dot` — a filled circle with the label beside it (thinned when crowded). * - `box` — a rectangle containing the label, shrinking with distance from * the focus the way the space itself does. */ type HyperbolicNodeShape = `dot` | `box`; export interface HyperbolicTreeListElementEventMap extends TreeComponentEventMap { 'select': TreeSelectEvent; 'tickle': TreeTickleEvent; 'activate': TreeActivateEvent; 'item-click': TreeItemClickEvent; 'item-dblclick': TreeItemDblClickEvent; 'expand': TreeExpandEvent; 'collapse': TreeCollapseEvent; 'focus': HyperbolicFocusEvent; } /** * `ixfx-hyperbolictree-list` — a hyperbolic (Poincaré disk) browser over tree * data. The focused node sits at the disk's center; its neighbourhood rings * outward, shrinking toward the edge with tree-graph distance. Implements the * shared `TreeComponent` interface so existing infrastructure (`TreeDataModel`, * `IncrSearchTreeController`, `TreeComponent`-typed code) works unmodified. * * Deliberate differences from `ixfx-tree-list`: expand/collapse is * reinterpreted as focus change (`expand`/`collapse` still fire, for * interop); `interactionMode` drops `checked`; `exclusivity` is ignored; * `filterPredicate` dims rather than hides; dragging empty space pans; * drag-and-drop and `checkboxRenderer` are out of scope. * * See `src/hyperbolic-tree/README.md` for zoom vs. curvature, crowded fans, * label legibility, weighting, branch colours, `::part()` targeting and the * full CSS variable list. */ export declare class HyperbolicTreeListElement extends LitElement implements TreeComponent, TreeSearchHost { #private; /** Delegates focus to the shadow-DOM `[role="tree"]` SVG (nodes themselves are `tabindex="-1"`). */ static shadowRootOptions: { delegatesFocus: boolean; clonable?: boolean; customElementRegistry?: CustomElementRegistry | null; mode: ShadowRootMode; serializable?: boolean; slotAssignment?: SlotAssignmentMode; }; root: TreeNode | undefined; model: TreeDataModel | undefined; /** Callback to lazily load children for a node. Superseded by `model` when both are set. */ loadChildren: LoadChildrenCallback | undefined; /** * Accepted for `TreeComponent` compatibility but ignored — every loaded * node is always laid out, so exclusivity is not meaningful here. */ exclusivity: TreeExclusivity; selectionFilter: TreeSelectionFilter; /** * Gesture mapping. `checked` is unsupported (see class docs). * @default 'standard' */ interactionMode: HyperbolicInteractionMode; /** Tree-graph steps from the focus to lay out and render. */ maxRadius: number; /** * How nodes are drawn: `dot` (filled circle, label beside it) or `box` * (a rectangle containing the label, shrinking with distance from focus). * @default 'dot' */ nodeShape: HyperbolicNodeShape; /** `box` mode: labels longer than this are truncated with `…`. `0` disables truncation. */ boxMaxChars: number; /** * `box` mode: smallest on-screen label size (CSS px) worth drawing. Boxes * whose label would render smaller — or that would overlap a * higher-priority label — are drawn as small text-less markers instead * (hover one to reveal its label). */ minLabelSize: number; /** * Tint each top-level branch (each child of the root, and everything under * it) its own hue, like a classic hyperbolic browser — makes it obvious * which subtree a distant node belongs to. Hues are spread evenly around * the colour wheel from `--hyperbolictree-branch-hue-start`. */ colorByBranch: boolean; /** Base node dot radius, as a fraction of the disk radius (the disk has radius 1). */ nodeRadius: number; /** Nodes whose scaled radius falls below this (same fraction-of-disk-radius units) render without a label. */ minNodeRadius: number; /** Radius multiplier applied to a node with `weight` at the low end of the currently-visible range. */ minWeightScale: number; /** Radius multiplier applied to a node with `weight` at the high end of the currently-visible range. */ maxWeightScale: number; /** * Visual (Euclidean) magnification of the rendered disk — a post-layout * scale, distinct from {@link curvature} (which reshapes the layout) and * {@link maxRadius} (how many rings are laid out). Labels stay the same * size on screen, so zooming in spreads crowded labels apart. Zoom * gestures update it; see {@link disableZoomGestures}. */ zoom: number; /** * Turn off zoom gestures: trackpad pinch / Ctrl-⌘-wheel (over the tree), * plain wheel (while the tree has keyboard focus), and two-finger touch * pinch. All zoom around the pointer, and update {@link zoom}. */ disableZoomGestures: boolean; /** * Turn off radial labels. By default a label runs along its node's * incoming edge (flipped on the left half so it never reads upside-down), * so a fan of siblings only needs room for each label's height, not its * width. Disabled, every label is horizontal. */ disableRadialLabels: boolean; /** * Turn off the child preview: hovering (or keyboard-tickling) a node whose * children aren't all legible in the current view — labels culled, or * beyond `maxRadius` — pops up a clickable list of them. */ disableChildPreview: boolean; /** * Minimum hyperbolic distance placed between generations — how curved the * space is. Raising it crowds distant generations toward the boundary * faster (a stronger fisheye that reads as "zooming in" on the focus); * lowering it flattens the view toward a Euclidean-feeling layout. */ curvature: number; /** * Minimum hyperbolic distance between adjacent siblings. A bushy node's * children are pushed further out until they're at least this far apart, * so dragging a crowded fan towards the center always spreads it out — * panning can't change hyperbolic distances, only magnify them, so without * this a tightly-packed fan stays packed wherever it's dragged. Larger * values fan out more when inspected, at the cost of pushing crowds further * towards the edge in the overview. `0` disables it. */ siblingSpacing: number; /** Duration (ms) of the animated re-center on focus change. `0` snaps instantly. */ focusAnimationDuration: number; /** Optional custom renderer for edges, in place of the default geodesic-arc path. */ edgeRenderer: HyperbolicEdgeRenderer | undefined; selectedNode: TreeNode | undefined; private _selectedNodes; get selectedNodes(): ReadonlySet; filterPredicate: TreeFilterPredicate | undefined; disableKeyboardNavigation: boolean; registry: CommandRegistry | undefined; /** * Space-separated subset of `navigate select filter` — limits which * incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search * disabled. See `docs/infra-incremental.md`. */ searchModes: string | undefined; /** The node currently centered on the disk. Pure view-state — `root` is never mutated by focus changes. */ get focusedNode(): TreeNode | undefined; /** * Layout id (see `HyperbolicLayoutNode.id`) of the focused node — * `undefined` means the root. Ids rather than `item.key`s, so data that * repeats keys across branches still focuses the node actually clicked. */ private _focusId; /** * Whether restoring a saved `center` may call `loadChildren` / `model` to * load the ancestors on its path (one at a time, cascading down). Default `true`. */ restoreLoads: boolean; /** * Canonical → screen projection overriding the settled "focus at the * center" view — set per-frame while a focus change animates, and by * panning. `undefined` when settled on the focus. */ private _viewOverride; /** * Orientation of the settled view (focus at the center). Views are * expressed in the focus's own local frame, and focus changes keep * whatever orientation the tree had when the animation started, so there * is no global "up" to snap back to — and no spin on refocus. */ private _focusRotation; /** Pan of the zoomed disk, in screen units — see {@link ZoomState}. */ private _zoomOffset; /** Layout id of the node whose children are being previewed. */ private _previewId; /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */ readonly search: ListSearchController<{ node: TreeNode; depth: number; }>; private tickled; /** The host's size in CSS px. */ private _hostSize; connectedCallback(): void; disconnectedCallback(): void; protected willUpdate(changedProps: PropertyValues): void; protected updated(changedProps: PropertyValues): void; select(node: TreeNode): void; deselect(node: TreeNode): void; clearSelection(): void; selectAll(): void; deselectAll(): void; /** Replace the selection with `nodes` (subject to `selectionFilter`) — search "select" mode. */ selectMany(nodes: Iterable): void; /** * Re-center the disk on `node` (an animated Möbius transform of the fixed * layout — `root` is never mutated). Fires `focus`, plus the semantic * `expand`/`collapse` event when the new focus is a descendant/ancestor of * the previous one, for interop with generic `TreeComponent` listeners. */ focusOn(node: TreeNode): void; /** Focus + select the node at `keys` (path from the root's children). Returns `true` if found. */ navigateTo(keys: readonly string[]): boolean; /** Focus + select the first node for which `predicate` returns `true`. Returns `true` if found. */ navigateToNode(predicate: (node: TreeNode) => boolean): boolean; /** * Bring the node with `key` into the visible window and move the keyboard * cursor to it, without changing the selection. Used by incremental-search * "navigate" mode. */ revealKey(key: string): boolean; /** * All nodes currently laid out on the disk (within `maxRadius` of the * focus), in render (ring-major) order. Unlike `ixfx-icicletree-list`, the * focused node itself is included — it is literally rendered, at the * center. */ getNodes(): ReadonlyArray<{ node: TreeNode; depth: number; }>; /** * Snapshot selection, centred node, keyboard cursor and zoom as plain JSON, * keyed by `item.key`. Includes pending state for keys not currently loaded. */ getViewState(options?: GetViewStateOptions): HyperbolicTreeListViewState; /** * Apply saved view state. Fields present replace the current ones; keys * that aren't loaded yet are applied as they appear — a deep `center` loads * its ancestors via `loadChildren` / `model` when `restoreLoads`. */ setViewState(state: Partial): void; clearPendingViewState(): void; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-hyperbolictree-list': HyperbolicTreeListElement; } } export interface HyperbolicTreeListElement { addEventListener: ((type: K, listener: (this: HyperbolicTreeListElement, event: HyperbolicTreeListElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); removeEventListener: ((type: K, listener: (this: HyperbolicTreeListElement, event: HyperbolicTreeListElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void); } type CanonicalEntry = { readonly node: TreeNode; /** Path-derived id, unique even when `item.key`s repeat — see {@link hyperbolicChildIds}. */ readonly id: string; readonly depth: number; readonly parentKey: string | undefined; readonly parentId: string | undefined; /** * Root-anchored position. Informational only: every step away from the * root pushes it exponentially closer to the disk boundary, so beyond * ~14 hyperbolic units (e.g. depth 5 at `curvature` 3) it saturates to the * clamp limit and distinct nodes collapse together. Views are built from * {@link toParent} instead — see {@link hyperbolicRelativeFrame}. */ readonly position: Point; /** * This node's local frame expressed in its parent's local frame — the * single short hop (a translation by one generation) from parent to * child. Identity for the root. Composing these outward from the focus * keeps every visible position precise, however deep the focus sits. */ readonly toParent: DiskIsometry; /** Angular width (radians) this node's own parent allocated to it — root is `2π`. */ readonly angularShare: number; }; /** * Path-derived ids for `children` of the node with id `parentId`. `TreeItem.key` * is meant to be unique, but real data (e.g. a file system, where `readme.md` * recurs in many folders) often only has keys unique among siblings. Keying * the layout on `item.key` alone would silently merge those nodes — edges get * attached to the wrong parent and clicks focus the wrong node — so the * layout identifies nodes by their key path instead. Repeated keys among * siblings are disambiguated by occurrence count. The root's id is its key. */ export declare function hyperbolicChildIds(parentId: string, children: readonly TreeNode[]): string[]; /** Depth (root is 0) of the node with layout id `id`. */ export declare function hyperbolicIdDepth(id: string): number; /** * Layout id of the root's child that `id` descends from (or is) — i.e. which * top-level branch it belongs to. `undefined` for the root itself. */ export declare function hyperbolicBranchId(id: string): string | undefined; /** Whether layout id `id` is a strict descendant of `ancestorId`. */ export declare function isHyperbolicDescendantId(id: string, ancestorId: string): boolean; /** Chain of nodes from `root` down to the node with layout id `id`, or `undefined` if absent. */ export declare function findHyperbolicPathById(root: TreeNode | undefined, id: string): TreeNode[] | undefined; /** Layout id of `target` (matched by object identity) within `root`, or `undefined` if absent. */ export declare function findHyperbolicIdOf(root: TreeNode | undefined, target: TreeNode): string | undefined; /** Key path (from the root's children) to the first node, depth-first, satisfying `predicate`. */ export declare function findHyperbolicKeyPath(nodes: readonly TreeNode[], predicate: (node: TreeNode) => boolean, prefix?: readonly string[]): string[] | undefined; /** Depth-first search for the node with `key`. Returns `undefined` when absent. */ export declare function findHyperbolicNode(root: TreeNode | undefined, key: string): TreeNode | undefined; /** * Chain of nodes from `root` down to (and including) the node with `key`. * Returns `undefined` when the key is absent. The first entry is always `root`. */ export declare function findHyperbolicPath(root: TreeNode | undefined, key: string): TreeNode[] | undefined; /** Default minimum hyperbolic distance between adjacent siblings. See {@link childDistance}. */ export declare const DEFAULT_SIBLING_SPACING = 0.5; /** * Canonical (true-root-anchored) hyperbolic position of every currently-loaded * node, keyed by layout id (see {@link hyperbolicChildIds}). Positions never depend on the current focus — * refocusing is purely a Möbius re-projection of these fixed coordinates, so * the tree never needs to be re-laid-out when the focus changes. * * Each node holds an angular wedge — inherited from its parent, expressed in * its *own* local frame (root starts with the full `[-π, π]`) — across which * its children are placed at hyperbolic distance of at least `curvature` * (default `1`) — further for a thin slice, per `siblingSpacing` (see * {@link childDistance}). * That wedge is partitioned among the children, weighted by √ of each child's own * subtree size rather than split evenly, and each child's own share is * carried into its local frame via {@link boundaryAngleInLocalFrame} before * recursing. This is a strict partition, and each child's wedge region * (bounded by geodesic rays to the same two ideal boundary points as its * slice) nests inside its parent's, which is what guarantees sibling * subtrees never spatially cross regardless of how deep or bushy they are. * * Every node's local frame is tracked as a full {@link DiskIsometry} * (local → canonical), built by composing its parent's frame with the * translation to the child. Composing Möbius translations introduces a * rotation (gyration); dropping it — i.e. assuming a node's frame is simply * `mobiusToOrigin(·, position)` — makes every wedge from depth 3 onward * point in a subtly wrong direction, so subtrees cross each other. * * A wedge wider than π is narrowed to π (around the same bisector) before * the child recurses into it: a near-full-circle wedge would otherwise fan * that child's own children back around towards — and across — its parent. * * `curvature` scales how far apart (in hyperbolic distance) each generation * sits. Raising it pushes each generation further out, so the Poincaré * metric's own `tanh` compression crowds distant generations toward the * boundary faster — a stronger fisheye, which is why it reads as "zooming * in" on the focus. Lowering it spreads generations out more evenly, * flattening the view toward a Euclidean-feeling layout. */ export declare function computeCanonicalPositions(root: TreeNode | undefined, maxDepth?: number, curvature?: number, siblingSpacing?: number): Map; /** * The frame of node `toId` expressed in node `fromId`'s local frame (maps * `toId`-local coordinates to `fromId`-local ones), composed along the tree * path between them via their lowest common ancestor. Used to hand a view * over from one focus to another without passing through root-anchored * coordinates. `undefined` if either id is absent. */ export declare function hyperbolicRelativeFrame(entries: ReadonlyMap, fromId: string, toId: string): DiskIsometry | undefined; /** * Compute the visible nodes/edges of a hyperbolic tree view: every * currently-loaded node within `maxRadius` tree-graph steps of the focused * node, projected onto the Poincaré disk with the focus at its center. * * @param root True tree root. `undefined` yields an empty layout. * @param options `focusedKey` (a layout id or plain `item.key`; default the * true root; unknown keys fall back to the true root), `maxRadius` (default unlimited), `maxDepth` (safety * cap on layout recursion depth, default 24), `curvature`, * `siblingSpacing`, `centerOverride` (put this point of the focus's local * frame at the center instead of the focus itself), `view` (a full * focus-local → screen isometry, taking precedence over `centerOverride` — * used for panning and animation, which also rotate). */ export declare function computeHyperbolicLayout(root: TreeNode | undefined, options?: ComputeHyperbolicLayoutOptions): { nodes: HyperbolicLayoutNode[]; edges: HyperbolicLayoutEdge[]; }; /** * Pure helpers behind `ixfx-icicletree-list` view state (also used by the * sunburst, which shares the zoom-path model). The component runs them on * every update, so state keyed to nodes that left the tree goes pending and * comes back when those keys reappear. See `docs/infra-view-state.md`. */ /** * `ixfx-icicletree-list` view state: `selected`, `focus`, `scroll`, plus the * zoom path. */ type IcicleViewState = ViewStateBase & { /** * Keys from the root's children down to the zoomed-into node; `[]` = the * full tree. A path rather than a lone key so a lazily-loaded tree can be * opened down to it, one load at a time. */ readonly zoom?: readonly string[]; }; /** * Weight accessor — returns the area share of `item` within its siblings. * Non-finite or negative values are treated as `0`. * Default: `() => 1` (equal-width siblings). */ export type IcicleValueAccessor = (item: TreeItem) => number; /** * Band stacking direction. * - `'horizontal'` — classic icicle: bands stack top-down, rects flow left-to-right. * - `'vertical'` — bands stack left-to-right, rects flow top-down. */ export type IcicleOrientation = `horizontal` | `vertical`; /** * Pointer/keyboard gesture mapping (subset of `TreeInteractionMode`). * - `'implicit'` — click selects + zooms; single selection follows the pointer. * - `'standard'` — click selects + zooms; Ctrl/Cmd+click toggles, Shift+click range-selects. * - `'manual'` — click only zooms; selection is driven via `select()`/`deselect()`/`clearSelection()`. * * `checked` is deliberately unsupported — a checkbox per rectangle does not * hold up visually at small rect sizes. */ export type IcicleInteractionMode = `implicit` | `standard` | `manual`; /** A single positioned rectangle produced by `computeIcicleLayout()`. */ export type IcicleRect = { readonly node: TreeNode; /** Absolute depth from the true root (root's children are depth 0). */ readonly depth: number; /** Band index from the current zoom root (0-based). */ readonly relativeDepth: number; /** Offset as a fraction of the band (0–1). */ readonly x: number; /** Width share as a fraction of the band (0–1). */ readonly width: number; readonly parentKey: string | undefined; /** 0-based position among siblings. */ readonly index: number; /** Number of siblings (for `aria-setsize`). */ readonly setSize: number; readonly hasChildren: boolean; }; export type ComputeIcicleLayoutOptions = { valueAccessor?: IcicleValueAccessor; /** How many depth bands to emit from the zoom root. Defaults to no limit. */ maxDepth?: number; /** Key of the node that acts as the visual root. Defaults to the true root. */ zoomKey?: string | undefined; /** * Omit leaf nodes entirely (no rect, no layout space) at every depth, not * just the deepest visible band — their non-leaf siblings' shares * renormalise to fill the freed space. A node is a leaf when * `item.isLeaf === true`, or its `children` array has already loaded and is * empty; a node whose `children` is still `undefined` (not yet loaded) is * never treated as a leaf, since it might turn out to have children. * Default `false`. */ hideLeaves?: boolean; }; /** Fired when the zoom root changes. `node` is `undefined` on zoom-out to the full tree. */ export type IcicleZoomDetail = { readonly node: TreeNode | undefined; /** Absolute depth of the zoom node (root's children are depth 0); `-1` when fully zoomed out. */ readonly depth: number; }; export type IcicleZoomEvent = CustomEvent; export interface IcicleTreeListElementEventMap extends TreeComponentEventMap { 'select': TreeSelectEvent; 'tickle': TreeTickleEvent; 'activate': TreeActivateEvent; 'item-click': TreeItemClickEvent; 'item-dblclick': TreeItemDblClickEvent; 'expand': TreeExpandEvent; 'collapse': TreeCollapseEvent; 'zoom': IcicleZoomEvent; } /** * `ixfx-icicletree-list` — an icicle (partition) view over tree data. * * Each depth is a horizontal band (or vertical band when * `orientation="vertical"`); each node is a rectangle whose width is * proportional to its `valueAccessor` share of its parent, stacked within the * band. Implements the shared `TreeComponent` interface so existing * infrastructure (`TreeDataModel`, `IncrSearchTreeController`, * `TreeComponent`-typed code) works unmodified. * * Differences from `ixfx-tree-list` (deliberate): * - **Expand/collapse is reinterpreted as zoom.** Clicking a branch zooms so it * becomes the visual root; ancestors collapse into the breadcrumb strip. * `expand`/`collapse` events fire on zoom-in/zoom-out with the same detail * shape so existing listeners keep working conceptually. * - **`interactionMode` drops `checked`** — a checkbox per rectangle does not * hold up at small rect sizes. * - **`exclusivity` is accepted but ignored** — nothing is independently "open". * - **`filterPredicate` dims** non-matching rects instead of hiding rows. * - Drag-and-drop is out of scope. */ export declare class IcicleTreeListElement extends LitElement implements TreeComponent, TreeSearchHost { #private; /** * Delegates focus to the shadow-DOM `[role="tree"]` div (the actual * `tabindex="0"` element — rects themselves are `tabindex="-1"`). Without * this, the host custom element has no `tabIndex` of its own: `el.focus()` * is a no-op, clicking a rect doesn't focus the tree (so arrow keys don't * work until the user separately Tabs in), and the host never reports as * `document.activeElement`. */ static shadowRootOptions: { delegatesFocus: boolean; clonable?: boolean; customElementRegistry?: CustomElementRegistry | null; mode: ShadowRootMode; serializable?: boolean; slotAssignment?: SlotAssignmentMode; }; root: TreeNode | undefined; model: TreeDataModel | undefined; /** Callback to lazily load children for a node. Superseded by `model` when both are set. */ loadChildren: LoadChildrenCallback | undefined; /** * Accepted for `TreeComponent` compatibility but ignored — an icicle has no * independently open branches, so exclusivity is not meaningful. */ exclusivity: TreeExclusivity; selectionFilter: TreeSelectionFilter; /** * Gesture mapping. `checked` is unsupported (see class docs). * @default 'standard' */ interactionMode: IcicleInteractionMode; /** * Band stacking direction. * - `'horizontal'` — bands stack top-down, rects flow left-to-right. * - `'vertical'` — bands stack left-to-right, rects flow top-down. */ orientation: IcicleOrientation; /** How many depth bands render at once from the current zoom root. */ maxDepth: number; /** * Rects narrower than this (px, horizontal orientation only) rotate their * label 90° (`writing-mode: vertical-rl`) to fit more characters in the * available band height instead of the shrinking width. Below * {@link minVerticalLabelWidth} even the rotated label is hidden. */ minLabelWidth: number; /** * Rects narrower than this (px) hide their label outright — even the * rotated form from {@link minLabelWidth} doesn't fit. Ignored in * `orientation="vertical"`, where labels never rotate. */ minVerticalLabelWidth: number; /** * Omit leaf nodes entirely — no rect, no layout space — at every depth, * not just the deepest visible band. Non-leaf siblings renormalise to fill * the freed space. A node is a leaf when `item.isLeaf === true`, or its * `children` array has already loaded and is empty — a node whose * `children` is still `undefined` (not yet loaded) is never hidden. */ hideLeaves: boolean; /** Weight per node. Default `() => 1` — equal-width siblings. */ valueAccessor: IcicleValueAccessor; selectedNode: TreeNode | undefined; private _selectedNodes; get selectedNodes(): ReadonlySet; filterPredicate: TreeFilterPredicate | undefined; disableKeyboardNavigation: boolean; registry: CommandRegistry | undefined; /** * Space-separated subset of `navigate select filter` — limits which * incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search * disabled. See `docs/infra-incremental.md`. */ searchModes: string | undefined; /** Current zoom root. `undefined` when showing the full tree. Pure view-state — `root` is never mutated. */ get focusedNode(): TreeNode | undefined; private _zoomKey; /** * Whether restoring a saved zoom may call `loadChildren` / `model` to load * the nodes along its path (one at a time). Default `true`. */ restoreLoads: boolean; /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */ readonly search: ListSearchController<{ node: TreeNode; depth: number; }>; private tickled; /** * Shared instant tooltip for rects whose label is rotated or hidden for * lack of space — positioned purely via CSS anchor positioning * (`anchor-name` on the tickled rect, `position-anchor` here), shown/hidden * via the Popover API. Deliberately not the native `title` attribute: that * has a UA-controlled show delay, this shows the instant the rect is * tickled (hover or keyboard). */ private _tooltipEl; connectedCallback(): void; disconnectedCallback(): void; protected willUpdate(changedProps: PropertyValues): void; protected updated(changedProps: PropertyValues): void; /** * Snapshot selection, zoom path, keyboard cursor and scroll as plain JSON, * keyed by `item.key`. Includes pending state for keys not currently loaded. */ getViewState(options?: GetViewStateOptions): IcicleViewState; /** * Apply saved view state. Fields present replace the current ones; keys * that aren't loaded yet are applied as they appear — including via * `loadChildren` / `model` down a saved zoom path when `restoreLoads`. */ setViewState(state: Partial): void; clearPendingViewState(): void; select(node: TreeNode): void; deselect(node: TreeNode): void; clearSelection(): void; selectAll(): void; deselectAll(): void; /** Replace the selection with `nodes` (subject to `selectionFilter`) — search "select" mode. */ selectMany(nodes: Iterable): void; /** * Drill down so `node` becomes the visual root (ancestors move to the * breadcrumb strip). Pure view-state — `root` is never mutated. * Fires `zoom` and the semantic `expand` event. */ zoomTo(node: TreeNode): void; /** * Zoom back out to the full tree. Fires `zoom` (with `node: undefined`) and * the semantic `collapse` event for the previous zoom root. */ zoomOut(): void; /** * Zoom so the node at `keys` (path from the root's children) is visible, * then select it. Returns `true` if the path was found. */ navigateTo(keys: readonly string[]): boolean; /** * Zoom + select the first node for which `predicate` returns `true`. * Returns `true` if a matching node was found. */ navigateToNode(predicate: (node: TreeNode) => boolean): boolean; /** * Zoom so the node with `key` is visible and move the keyboard cursor to it, * without changing the selection. Used by incremental-search "navigate" mode. */ revealKey(key: string): boolean; /** * All nodes currently visible as rectangles, in render (band-major) order, * with absolute depth (root's children are depth 0). */ getNodes(): ReadonlyArray<{ node: TreeNode; depth: number; }>; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-icicletree-list': IcicleTreeListElement; } } export interface IcicleTreeListElement { addEventListener: ((type: K, listener: (this: IcicleTreeListElement, event: IcicleTreeListElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); removeEventListener: ((type: K, listener: (this: IcicleTreeListElement, event: IcicleTreeListElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void); } /** Coerce a raw accessor result to a non-negative finite weight. */ export declare function normaliseValue(raw: unknown): number; /** Depth-first search for the node with `key`. Returns `undefined` when absent. */ export declare function findIcicleNode(root: TreeNode | undefined, key: string): TreeNode | undefined; /** * Chain of nodes from `root` down to (and including) the node with `key`. * Returns `undefined` when the key is absent. The first entry is always `root`. */ export declare function findIciclePath(root: TreeNode | undefined, key: string): TreeNode[] | undefined; /** * Follow `keys` from `root`; a leading key equal to the root's own key * matches the root itself. Returns `undefined` when a key isn't found. */ export declare function resolveIcicleKeyPath(root: TreeNode | undefined, keys: readonly string[]): TreeNode | undefined; /** Key path (depth-first) to the first node among `nodes` matching `predicate`. */ export declare function findIcicleKeyPath(nodes: readonly TreeNode[], predicate: (node: TreeNode) => boolean, prefix?: readonly string[]): string[] | undefined; /** * Compute the visible rectangles for an icicle view. * * Bands start at the zoom node's **children** (the zoom node itself is shown in * the breadcrumb strip, never as a rect — matching `TreeComponent.getNodes()`, * where the root is never listed). Each band spans 0–1; a rect's `x`/`width` * are fractions of its band, proportional to `valueAccessor` shares among * siblings. Siblings whose weights all normalise to `0` split the band equally. * * @param root True tree root. `undefined` (or a root without children) yields `[]`. * @param options `valueAccessor` (default equal weights), `maxDepth` (band count, * default unlimited), `zoomKey` (visual root, default true root; unknown keys * fall back to the true root). */ export declare function computeIcicleLayout(root: TreeNode | undefined, options?: ComputeIcicleLayoutOptions): IcicleRect[]; /** Chevron pointing down (Lucide `chevron-down`). Used for split-button dropdown toggle. */ export declare const ICON_CHEVRON_DOWN = ""; /** * Chevron pointing right (Lucide `chevron-right`). Used for tree-basic expand * indicator as a CSS mask — shape only, color comes from background-color. */ export declare const ICON_CARET_RIGHT = ""; /** Checkmark (Lucide `check`). Useful for menu-check-item or confirmation states. */ export declare const ICON_CHECK = ""; /** Close / X icon (Lucide `x`). Useful for dialogs, notifications, dismissible elements. */ export declare const ICON_CLOSE = ""; export declare const iconBus: EventTarget; type IconChangedDetail = { readonly name: string; }; type IconChangedEvent = CustomEvent; type IconEntry = { kind: `svg`; svg: string; } | { kind: `font`; char: string; }; export declare function registerIcon(name: string, svg: string): void; export declare function registerFontIcon(name: string, glyph: string | number): void; export declare function getIcon(name: string): string | undefined; export declare function getIconEntry(name: string): IconEntry | undefined; export declare function hasIcon(name: string): boolean; export declare function setIconFont(fontFamily: string): void; export declare function getIconFont(): string | undefined; export declare function svgToDataUri(svg: string): string; /** * Type definitions for radial input component */ export type ValueMode = `range` | `bipolar` | `unipolar`; export type MarkerStyle = `needle` | `dot` | `none`; export type LaneType = `value` | `fixed` | `anchored`; export interface LaneData { key: string; value: number; type: LaneType; offset: number; width: number; } export interface RadialInputInputDetail { value: number; valueRelative: number; } export interface RadialInputChangeDetail { value: number; valueRelative: number; previousValue: number; } export type RadialInputInputEvent = CustomEvent; export type RadialInputChangeEvent = CustomEvent; declare const RadialInputElement_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer); export declare class RadialInputElement extends RadialInputElement_base { #private; /** * Formats the text written to `data-tooltip` when `data-tooltip-live` is * set. Receives the value (min..max units) and its relative position (0..1). * Defaults to a rounded percentage. */ tooltipFormatter?: (value: number, relative: number) => string; get radius(): number; set radius(v: number); value: number; min: number; max: number; step: number | undefined; stops?: number; valueMode: ValueMode; flatten: number; markerStyle: MarkerStyle; wedge: boolean; disabled: boolean; constructor(); addLane(key: string, options?: { value?: number; type?: LaneType; offset?: number; width?: number; }): void; setLaneValue(key: string, value: number): void; removeLane(key: string): void; getLanes(): ReadonlyMap; getLane(key: string): LaneData | undefined; _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void; protected willUpdate(changed: PropertyValues): void; render(): unknown; protected updated(changed: PropertyValues): void; disconnectedCallback(): void; firstUpdated(): void; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-radial-input': RadialInputElement; } } export declare class LabelledRadialInput extends LabelledInputBase { readonly inputSelector = "ixfx-radial-input"; max: number; step: number; /** * Formats the dial tooltip text: `(value in min..max units, relative 0..1) => string`. * Defaults to the built-in formatting. Property only. */ tooltipFormatter?: (value: number, relative: number) => string; radius: number; flatten: number; markerStyle: MarkerStyle; wedge: boolean; valueMode: ValueMode; tooltip: boolean; flip: boolean; aspectRatioThreshold: number; /** Pass-through: enables wheel-on-hover for the inner dial and editable-number. */ lighttouch: boolean; private _isWide; private _getEffectivePrecision; protected _handleResize(entries: ResizeObserverEntry[]): void; protected _renderEditableNumber(): typeof nothing | import("lit").TemplateResult<1>; render(): import("lit").TemplateResult<1>; private _getTooltipValue; static styles: CSSResultGroup; } declare global { interface HTMLElementTagNameMap { 'ixfx-labelled-radial-input': LabelledRadialInput; } } /** * Type definitions for slider-input component */ /** Formats the live tooltip text: `value` in min..max units, `relative` in 0..1. */ export type TooltipFormatter = (value: number, relative: number) => string; export type SliderOrientation = `horizontal` | `vertical`; export type SliderMarkerStyle = `needle` | `dot` | `triangle` | `none`; export type SliderSingleStyle = `range` | `bipolar` | `unipolar`; export type SliderValueMode = `single` | `dual` | `triple`; export type SliderCrossover = `none` | `allow`; export type SliderValueDrag = `none` | `stop` | `flex`; /** * Behaviour for the middle (C) handle in triple mode when the A/B span * changes. `none` (default) keeps C in place and only clamps it when it * falls outside the new [A, B] band. `proportional` keeps C at the same * fractional position within the band as the band moves or resizes. */ export type SliderValueCFollow = `none` | `proportional`; export type SliderLaneType = `value` | `fixed` | `anchored`; export type SliderHandleKey = `a` | `b` | `c`; /** * Per-lane data. Mirrors radial-input's shape with the difference that * `type: 'value'` lanes track a *range* (valueMin/valueMax) rather than a * single value, while `type: 'anchored'` lanes keep a single value (0..1 * length). */ export interface SliderLaneData { key: string; type: SliderLaneType; /** * Used when type === 'anchored': length (0..1) of the lane symmetrically * centered on the current value. */ value?: number; /** Used when type === 'value': lower end of the lane band (0..1). */ valueMin?: number; /** Used when type === 'value': upper end of the lane band (0..1). */ valueMax?: number; /** Perpendicular offset from the track centreline (-1..1 scale relative to the cross axis). */ offset: number; /** Stroke thickness as a fraction of the cross axis (0..1). */ width: number; } /** * A custom, non-interactive marker (e.g. a "ghost" showing a modulated * value). Positioned like a lane (`value` is 0..1 along the track) and styled * via `--marker--*` CSS custom properties. */ export interface SliderMarkerData { key: string; /** Position along the track, 0..1 (same space as lane values). */ value: number; /** Shape; falls back to the slider's `marker-style` when unset. */ style?: SliderMarkerStyle; } /** * Identifies which field(s) of a dual/triple-mode detail changed. * `both` is reserved for length-drag (value-drag) gestures. */ export type SliderChangedField = `min` | `max` | `c` | `both`; /** * In single mode, `value` is the single handle's value and the min/max/c * fields are undefined. In dual/triple mode, `value` is set to `valueMax` * (the "B"/upper handle) for parity with native `` * two-thumb patterns where a single `value` is ambiguous — consumers * wanting min/max should use `valueMin`/`valueMax` directly. */ export interface SliderInputInputDetail { readonly value: number; readonly valueRelative: number; /** Lower handle value (dual/triple modes only). */ readonly valueMin?: number; /** Upper handle value (dual/triple modes only). */ readonly valueMax?: number; readonly valueMinRelative?: number; readonly valueMaxRelative?: number; /** Triple-mode middle handle value. */ readonly valueC?: number; readonly valueCRelative?: number; /** Which field this particular event resulted from. */ readonly changed?: SliderChangedField; } export interface SliderInputChangeDetail { readonly value: number; readonly valueRelative: number; readonly previousValue: number; readonly valueMin?: number; readonly valueMax?: number; readonly previousValueMin?: number; readonly previousValueMax?: number; readonly valueC?: number; readonly previousValueC?: number; readonly changed?: SliderChangedField; } export type SliderInputInputEvent = CustomEvent; export type SliderInputChangeEvent = CustomEvent; export interface SliderInputElementEventMap { input: SliderInputInputEvent; change: SliderInputChangeEvent; } declare const SliderInputElement_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer); export declare class SliderInputElement extends SliderInputElement_base { #private; /** * Formats the text written to `data-tooltip` when `data-tooltip-live` is * set. Receives the value (min..max units) and its relative position (0..1). * Defaults to a rounded percentage. In dual/triple modes it receives the max pole. */ tooltipFormatter?: (value: number, relative: number) => string; valueA: number; valueB: number; /** * Triple-mode middle handle. `undefined` until first willUpdate, then * defaulted to the midpoint of valueA/valueB (matching radial-input's * deferred lane-correction pattern). */ valueC: number | undefined; min: number; max: number; step: number | undefined; stops: number | undefined; valueMode: SliderValueMode; singleStyle: SliderSingleStyle; orientation: SliderOrientation; markerStyle: SliderMarkerStyle; /** * Optional marker-style override for the C handle in triple mode. Lets * consumers give C a different shape (e.g. dot) from the global * `markerStyle` applied to A/B. */ markerStyleC: SliderMarkerStyle | undefined; crossover: SliderCrossover; valueDrag: SliderValueDrag; /** * In triple mode, how the C handle reacts when A or B moves the [A, B] * band. `none` (default): C keeps its value unless pushed outside the * new band. `proportional`: C is re-anchored at the same fractional * position it had within the *old* band, so it moves with A/B. */ valueCFollow: SliderValueCFollow; valueMin: number; disabled: boolean; /** * Swipe-to-draw gesture, mirroring `ixfx-range-input[swipeable]`. * When active, pressing down on the slider or entering it while the * pointer is pressed sets the value from the cursor coordinate. * Pointer capture is NOT held, so the cursor can move to adjacent * swipeable sliders and update them too (step-sequencer style). * Leaving the slider (above/below for horizontal, left/right for * vertical) freezes the value; re-entering re-engages. * * Single mode sets value-A directly. Dual/triple modes move the * nearest handle to the cursor. */ swipeable: boolean; constructor(); connectedCallback(): void; addLane(key: string, options?: { value?: number; valueMin?: number; valueMax?: number; type?: SliderLaneType; offset?: number; width?: number; }): void; setLaneValue(key: string, value: number): void; setLaneRange(key: string, valueMin: number, valueMax: number): void; removeLane(key: string): void; getLanes(): ReadonlyMap; getLane(key: string): SliderLaneData | undefined; /** * Add a custom non-interactive marker (e.g. a ghost for a modulated value). * `value` is 0..1 along the track. Style with `--marker--color`, * `-opacity`, `-offset`, `-length`, `-thickness` (each falls back to the * matching global `--marker-*` variable). */ addMarker(key: string, options?: { value?: number; style?: SliderMarkerStyle; }): void; /** Move a custom marker. `value` is 0..1 along the track. */ setMarkerValue(key: string, value: number): void; removeMarker(key: string): void; getMarkers(): ReadonlyMap; getMarker(key: string): SliderMarkerData | undefined; _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void; protected willUpdate(changed: PropertyValues): void; render(): unknown; protected updated(changed: PropertyValues): void; disconnectedCallback(): void; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-slider-input': SliderInputElement; } } export interface SliderInputElement { addEventListener: ((type: K, listener: (this: SliderInputElement, event: SliderInputElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } export declare class LabelledSliderInput extends LabelledInputBase { readonly inputSelector = "ixfx-slider-input"; orientation: `horizontal` | `vertical`; singleStyle: SliderSingleStyle; markerStyle: SliderMarkerStyle; stops: number | undefined; disabled: boolean; swipeable: boolean; /** Pass-through: enables wheel-on-hover for the inner slider and editable-number. */ lighttouch: boolean; switchHeight: number; protected _renderEditableNumber(): import("lit").TemplateResult<1>; protected _syncValue(v: number): void; render(): import("lit").TemplateResult<1>; static styles: CSSResultGroup; } declare global { interface HTMLElementTagNameMap { 'ixfx-labelled-slider-input': LabelledSliderInput; } } export type LedMode = `brightness` | `blink` | `pulse`; export declare class LedElement extends LitElement { #private; value: number; lit: boolean; color: string; glow: boolean; /** * Operating mode: * - `brightness` (default): {@link value} sets the LED brightness directly * - `blink`: LED blinks on/off every {@link rate} milliseconds (this mode * is what the legacy `blinking` attribute now selects) * - `pulse`: LED sits unlit until {@link pulse} is called, which fires an * attack/release envelope up to {@link value} and back down */ mode: LedMode; /** * Legacy alias for `mode="blink"`. Setting `blinking` switches {@link mode} * to `blink`; clearing it returns to `brightness`. */ blinking: boolean; rate: number; /** Pulse-mode attack time in milliseconds (0 → instant). */ attackTime: number; /** Pulse-mode release/decay time in milliseconds (0 → instant). */ releaseTime: number; /** * Pulse-mode retrigger behaviour. When set, each {@link pulse} call restarts * the envelope from 0. When unset (default), the attack ramps from wherever * the envelope currently sits, so a retrigger mid-decay is continuous. */ pulseRetrigger: boolean; willUpdate(changedProperties: Map): void; disconnectedCallback(): void; /** * Pulse-mode trigger: lights the LED to {@link value} using an attack/release * envelope, then decays back to unlit. Calling again restarts the envelope * (from 0 if {@link pulseRetrigger} is set, otherwise from the current level). * No-op unless {@link mode} is `pulse`. */ pulse(): void; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { "ixfx-led": LedElement; } } export type MillerSelectionMode = `implicit` | `standard` | `manual` | `checked` | `vscode`; /** Detail for the `header-click` event fired when a column header is clicked. */ export type MillerHeaderClickDetail = { /** Zero-based column index whose header was clicked. */ depth: number; /** The header text (label of the column's parent node). */ label: string; /** * Ancestry chain from the root node down to (and including) the node * whose label is shown in this header. * - depth 0 → [root] * - depth 1 → [root, selectedAtDepth0] * - depth d → [root, sel[0], …, sel[d-1]] */ path: Array; }; /** Detail for the `item-dblclick` event. */ export type MillerItemDblClickDetail = { node: TreeNode; depth: number; }; /** Detail for the `rebase` event fired when the view root changes. */ export type MillerRebaseDetail = { /** The new view root, or `undefined` when the view was restored to the full tree. */ viewRoot: TreeNode | undefined; /** * Ancestry chain from the true root down to and including the new view root. * Empty when the view shows the full tree. */ path: Array; }; /** Detail for the `item-rightclick` event. */ export type MillerItemRightClickDetail = { node: TreeNode; depth: number; mouseEvent: MouseEvent; }; /** Detail for the `header-rightclick` event. */ export type MillerHeaderRightClickDetail = { depth: number; label: string; path: Array; mouseEvent: MouseEvent; }; export type MillerHeaderClickEvent = CustomEvent; export type MillerItemDblClickEvent = CustomEvent; export type MillerItemRightClickEvent = CustomEvent; export type MillerHeaderRightClickEvent = CustomEvent; export type MillerRebaseEvent = CustomEvent; /** * A snapshot of all display states for a single item in the miller columns. * * - `selected`: the item is part of the active selection. * - `open`: the item is an ancestor of the current deepest column (it is on * the currently open path, regardless of whether it is also selected). * - `focused`: the keyboard cursor is currently on this item. * - `isLeaf`: the item has no children and cannot be expanded. */ export type MillerItemState = { selected: boolean; open: boolean; focused: boolean; isLeaf: boolean; }; /** * Pure view-state helpers for `ixfx-miller-*`. The element runs these * whenever its data changes (new root, lazy load, `invalidateStructure()`) * and on `setViewState()`; see docs/infra-view-state.md. */ /** `ixfx-miller-list` view state. */ type MillerListViewState = ViewStateBase & { /** * Key of the open branch at each depth, from column 0 down, relative to the * view root. A Miller view has exactly one open branch per column, so this * is an ordered path rather than an `expanded` record. */ readonly path?: readonly string[]; /** User-resized column widths in px, keyed by column depth. */ readonly columnWidths?: Readonly>; /** Per-column scroll, keyed by the key of the node whose children the column lists. */ readonly columnScroll?: Readonly>; }; /** * Base class for Miller column components. Handles column lifecycle, * column resizing, keyboard navigation, and selection modes. * * Subclasses must override `renderColumnContent`. * * ## Interaction modes (`interactionMode`) * * Controls how clicks map to selection changes. Default: `'standard'`. * * - `implicit`: Selection follows the cursor path (navigation mode). * - `standard`: Single click selects; Shift+click range-selects within a column; * Cmd/Ctrl+click toggles individual items. * - `manual`: Component never modifies selection. Use `selectedKeys` / `setSelected` * / `clearSelection` to drive state externally. * - `checked`: Checkboxes on every item (rendered by subclass via `_isChecked` / * `_handleCheckboxClick`). Clicking the item navigates/expands; clicking the * checkbox toggles selection of the node and all loaded descendants. * * ## Events * - `expand`: FYI event fired after a column opens. Detail: `{ node, depth }` * - `collapse`: FYI event fired when a column closes. Detail: `{ node, depth }` * - `header-click`: fired when a column header is clicked (requires `headers` attr). * Detail: `{ depth, label, path: MillerNode[] }` * - `activate`: fired when Enter is pressed on an item. Detail: `{ node, depth }` * - `select`: fired when the selection set changes. Detail: `{ selected, previous }` * - `item-click`: fired on any item click. Detail: `{ node, depth }` * - `tickle`: fired when an item is hovered or keyboard cursor moves to it. Detail: `{ node, depth }` * * ## CSS variables * - `--column-bg`: var(--surface-3) * - `--column-header-bg`: var(--surface-2) * - `--column-header-text`: var(--surface-muted-text) * - `--column-separator`: var(--surface-5) * - `--column-resize-handle`: var(--surface-5) * - `--column-resize-handle-hover`: var(--accent) * - `--column-resize-width`: 4px * - `--item-hover-bg`: var(--item-bg-tickled) * - `--item-selected-bg`: var(--item-bg-selected) * - `--item-selected-text`: var(--item-text-selected) */ export declare class MillerBaseElement extends LitElement implements TreeComponent, TreeSearchHost { #private; root: TreeNode | undefined; model: TreeDataModel | undefined; headers: boolean; /** * When true, the last (rightmost) column grows to fill any remaining * horizontal space in the host. All other columns size to their content * (`max-content`), unless the user has manually resized them. * * When the user clicks into an item in the stretched column and a new * column opens, the previously-last column automatically transitions back * to its content-based width and the new last column stretches instead. * Explicit user-resized widths (via the resize handle) always win over * stretching. */ stretchLastColumn: boolean; /** * Alternative node to use as the display root (Finder-style column-view * rebase). When set, column 0 shows this node's children and all depths, * headers, and key paths are relative to it. When `undefined` (default), * the full `root` tree is shown. * * Prefer `rebaseTo()` / `rebaseUp()` over assigning this directly — they * validate the target and report whether the view changed. Assigning a new * `root` (or receiving one via `model`) silently clears the view root. */ viewRoot: TreeNode | undefined; /** * Controls the column-level interaction pattern (how clicks map to column changes). * This is distinct from `selectionFilter` (which restricts which node kinds are selectable). * Default: `'standard'`. */ interactionMode: MillerSelectionMode; selectionFilter: TreeSelectionFilter; exclusivity: TreeExclusivity; /** * Callback to load children for a lazy node. * Superseded by `model` when both are set. * If not set and `model` is not set, clicking a lazy node opens an empty column. */ loadChildren: LoadChildrenCallback | undefined; filterPredicate: TreeFilterPredicate | undefined; /** * Space-separated subset of `navigate select filter` — limits which * incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search * disabled. See `docs/infra-incremental.md`. */ searchModes: string | undefined; protected _columns: TreeNode[][]; protected _loadingDepth: number | undefined; protected _selectedByDepth: Map; protected _selectedKeys: Set; protected _selectedNodes: Set; /** * Whether restoring view state may call `loadChildren` / `model` to open a * saved path through branches that aren't loaded yet (one load at a time, * cascading down the path). Default `true`. */ restoreLoads: boolean; /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */ readonly search: ListSearchController<{ node: TreeNode; depth: number; }>; /** Command registry carrying this component's `list.search.*` commands. */ get registry(): CommandRegistry | undefined; tickled: TickledController; willUpdate(_changedProps: PropertyValues): void; updated(changedProps: PropertyValues): void; firstUpdated(): void; connectedCallback(): void; disconnectedCallback(): void; /** * Snapshot the open path, selection, keyboard cursor, column widths and * column scroll as plain JSON, keyed by `item.key`. Includes pending state * for keys not currently loaded. */ getViewState(options?: GetViewStateOptions): MillerListViewState; /** * Apply saved view state. Fields present replace the current ones; keys not * loaded yet are applied as they appear — including via `loadChildren` / * `model` for the saved path when `restoreLoads`. */ setViewState(state: Partial): void; clearPendingViewState(): void; /** Read current selection as an immutable set of item keys. */ get selectedKeys(): ReadonlySet; /** Replace entire selection and trigger a re-render. */ set selectedKeys(keys: Iterable); /** The most recently selected node. */ get selectedNode(): TreeNode | undefined; set selectedNode(node: TreeNode | undefined); /** Full selection set (implements TreeComponent interface). */ get selectedNodes(): ReadonlySet; /** Add `node` to the selection (respects selectionFilter). Dispatches `select` event. */ select(node: TreeNode): void; /** Remove `node` from the selection. Dispatches `select` event. */ deselect(node: TreeNode): void; /** * Clear all selection and trigger a re-render. */ clearSelection(): void; /** Not implemented on miller-list. */ selectAll(): void; private _partialKeys; /** * Nodes shown as *partially* selected (a part of the resource is selected): * an indeterminate checkbox in `checked` mode, `.partial` and an accessible * description otherwise. Independent of the selection — a key in both counts * as selected. In `checked` mode a node is indeterminate if either the * loaded descendants or this say so (as in the tree). Replace-on-set. */ get partialKeys(): ReadonlySet; set partialKeys(keys: Iterable); /** Accessible description for a partial row outside checked mode. */ protected readonly _partialDescription = "Partially selected"; /** Whether `node` is shown as partial (and, being selected, not). */ protected _isPartial(node: TreeNode, depth: number): boolean; /** Not implemented on miller-list. */ deselectAll(): void; /** * Select or deselect a single node by key. * In `checked` interactionMode this also recursively selects/deselects all loaded descendants. */ setSelected(node: TreeNode, selected: boolean): void; /** * Return all MillerNodes whose key is in `_selectedKeys`, searching only * the currently visible columns. */ getSelected(): TreeNode[]; /** * Programmatically navigate to a node by key path, relative to the current * view root (rebased or full tree). */ navigateTo(keys: readonly string[], options?: TreeNavigateOptions): boolean; /** * Re-sync the element with children arrays patched in place (see * `MillerTreeController.sync()`): columns whose selected node was removed are * closed, selection entries for removed nodes are dropped, then it re-renders. */ invalidateStructure(): void; /** * Programmatically navigate to the first node (breadth-first) matching a predicate. */ navigateToNode(predicate: (node: TreeNode) => boolean): boolean; /** Open the columns down to `key` and move the cursor to it, without changing the selection (search "navigate" mode). */ revealKey(key: string): boolean; /** Replace the selection with `nodes` (search "select" mode). */ selectMany(nodes: Iterable): void; getNodes(): ReadonlyArray<{ node: TreeNode; depth: number; }>; /** * Rebase the view to show `target`'s children in column 0 (Finder column-view * behavior on double-click), keeping the full tree in `root`. * * - Pass a `MillerNode` (used as-is) or a key (looked up in the full tree). * - Pass `undefined` to restore the full-tree view. * - Rebasing to the true root is equivalent to restoring the full view. * - Leaves are refused (returns `false`). * * Selection is cleared; all depths, headers, and key paths are relative to * the new view root. Fires a `rebase` event when the view actually changes. * Returns `false` when nothing changed (unknown key, leaf, or same view). */ rebaseTo(target: TreeNode | string | undefined): boolean; /** * Rebase one level up from the current view root (no-op at the full tree). * Fires a `rebase` event when the view actually changes. */ rebaseUp(): boolean; protected renderColumnContent(nodes: TreeNode[], depth: number): TemplateResult | typeof nothing; protected _handleItemClick(node: TreeNode, depth: number, event?: MouseEvent): void; /** * Called by subclasses (in `checked` interactionMode) when a checkbox is clicked. */ protected _handleCheckboxClick(event: MouseEvent, node: TreeNode, _depth: number): void; /** * Called by subclasses when an item is double-clicked. */ protected _handleItemDblClick(node: TreeNode, depth: number, _event: MouseEvent): void; /** * Called by subclasses when an item is right-clicked. */ protected _handleItemRightClick(node: TreeNode, depth: number, event: MouseEvent): void; /** * Called by subclasses when a column header is right-clicked. */ protected _handleHeaderRightClick(event: MouseEvent, depth: number): void; protected _isSelected(node: TreeNode, depth: number): boolean; protected _isOpen(node: TreeNode, depth: number): boolean; /** * Return the display state for an item identified by key at a given depth. */ getItemState(key: string, depth: number): MillerItemState | undefined; /** * Override to provide a custom loading indicator. */ protected renderLoadingIndicator(): TemplateResult | typeof nothing; protected render(): TemplateResult<1>; protected _getFocusedIndex(depth: number): number; protected _isFocused(node: TreeNode, depth: number): boolean; /** * Called by subclasses when pointer enters an item. * Fires tickle event and switches to mouse mode. */ protected _handleItemPointerEnter(node: TreeNode, depth: number): void; /** * Called by subclasses when pointer leaves the column container. */ protected _handleColumnPointerLeave(): void; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-miller-base': MillerBaseElement; } } export interface MillerBaseElementEventMap extends TreeComponentEventMap { 'item-click': TreeItemClickEvent; 'expand': TreeExpandEvent; 'collapse': TreeCollapseEvent; 'select': TreeSelectEvent; 'list-select': CustomEvent; }>; 'list-select-intent': CustomEvent; 'tickle': TreeTickleEvent; 'activate': TreeActivateEvent; 'item-dblclick': CustomEvent; 'item-rightclick': CustomEvent; 'header-click': CustomEvent; 'header-rightclick': CustomEvent; 'rebase': CustomEvent; } export interface MillerBaseElement { addEventListener: ((type: K, listener: (this: MillerBaseElement, event: MillerBaseElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); removeEventListener: ((type: K, listener: (this: MillerBaseElement, event: MillerBaseElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void); } /** * Miller columns with a vertical list layout — items stack in rows like macOS Finder. * * Usage: * ```html * * * ``` */ export declare class MillerListElement extends MillerBaseElement { #private; protected renderColumnContent(nodes: TreeNode[], depth: number): TemplateResult; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-miller-list': MillerListElement; } } export type MillerTreeControllerOptions = { /** * Convert a tree node's value to a `MillerItem`. * You must supply at minimum `key` and `label`. * If `isLeaf` is omitted the controller infers it from whether the * `TraversableTree` node has any children. */ valueToItem: (value: T, node: TraversableTree) => TreeItem; /** * Children loader installed on the element by `connect()`. Defaults to a * synchronous read from the source tree. `sync()` never touches it. */ loadChildren?: LoadChildrenCallback; }; /** * Bridges an `ixfx` `TraversableTree` with an `ixfx-miller-*` component. * * Usage: * ```ts * import { Trees } from '@ixfx/collections'; * import { MillerTreeController } from 'ixfx-components/miller'; * * const root = Trees.Mutable.createNode({ key: 'root', label: 'Root' }); * Trees.Mutable.addValue({ key: 'a', label: 'Alpha' }, root); * * const ctrl = new MillerTreeController( * Trees.Mutable.asDynamicTraversable(root), * document.querySelector('ixfx-miller-list'), * { valueToItem: v => ({ key: v.key, label: v.label }) } * ); * ctrl.connect(); * ``` * * Children are populated lazily: the controller provides a `loadChildren` * callback that synchronously reads from the underlying tree. * * Call `disconnect()` to remove all event listeners and release resources. */ export declare class MillerTreeController { #private; constructor(root: TraversableTree, element: MillerBaseElement, options: MillerTreeControllerOptions); /** * Wire up the controller: sets `element.root` and provides `loadChildren` callback. * Safe to call again after `disconnect()`. */ connect(): void; /** Remove all event listeners and release internal state. */ disconnect(): void; /** * Navigate the component to the first node (depth-first) in the ixfx tree * whose value satisfies `predicate`. * * Any ancestor `MillerNode`s with unloaded children are populated * synchronously before calling `element.navigateTo()`. * * Key paths are relative to the element's current view root: when the view * is rebased, only matches at or below the view root can be reached. * * Returns `false` if no matching node is found. */ navigateToValue(predicate: (value: T) => boolean, options?: TreeNavigateOptions): boolean; /** * Navigate using item keys **relative to the element's current view root** * (the real root when not rebased). Ancestors with unloaded children are * populated first. Returns `false` if a key is missing. */ navigateToKeyPath(keys: readonly string[], options?: TreeNavigateOptions): boolean; /** * Navigate to the source node with this identity. Returns `false` when it is * unknown or lies outside a rebased view (keys are relative to the view root). */ navigateToIdentity(identity: unknown, options?: TreeNavigateOptions): boolean; /** The source node whose item key is `key`, if it has been materialised. */ lookupByKey(key: string): TraversableTree | undefined; /** * Re-derive children for every already-materialised node from the source tree * and patch them in place. Children arrays are mutated (not replaced) so open * columns keep their references, and `MillerNode`s are reused by key so * selection survives. A rebased `viewRoot` is reset only if its node was * removed. `loadChildren` is left alone. Refreshes the element once. */ sync(): void; } type SortDirection = `asc` | `desc`; type MulticolItem = { readonly key: string; readonly label: string; readonly count?: number; readonly data?: unknown; }; type MulticolCategoryDefaults = { grouped?: boolean; groupBy?: (item: MulticolItem) => string; allLabel?: string; sort?: SortDirection; menu?: boolean; }; type MulticolCategory = { readonly key: string; readonly label: string; /** Shown as a tooltip on the column header label. */ readonly description?: string; readonly children?: readonly MulticolCategory[]; readonly defaults?: MulticolCategoryDefaults; }; type MulticolColumnState = { readonly id: string; readonly categoryKey: string; readonly sort: SortDirection; readonly grouped: boolean; /** Defaults to `true` if omitted. */ readonly menu?: boolean; readonly width?: number; }; type MulticolColumnsChangeReason = `add` | `remove` | `reorder` | `category` | `sort` | `grouping` | `resize`; type MulticolQuery = { readonly columnId: string; readonly categoryKey: string; readonly otherSelections: ReadonlyMap; }; type MulticolColumnSelection = { readonly columnId: string; readonly categoryKey: string; readonly values: readonly string[]; }; type MulticolSelectDetail = { readonly columnId: string; readonly columns: readonly MulticolColumnSelection[]; }; /** * `ixfx-multicol-list` view state. The shared `selected` / `scroll` fields * aren't used: every column has its own selection and scroll, keyed by * column id. */ type MulticolListViewState = ViewStateBase & { /** Column layout in display order. */ readonly columns?: readonly MulticolColumnState[]; /** Selected item keys per column id. A missing / empty column is at 'All'. */ readonly selectedByColumn?: Readonly>; /** Scroll position of each column's list, keyed by column id. */ readonly scrollByColumn?: Readonly>; }; export type MulticolSelectEvent = CustomEvent; export type MulticolColumnsChangeDetail = { readonly columns: readonly MulticolColumnState[]; readonly reason: MulticolColumnsChangeReason; }; export type MulticolColumnsChangeEvent = CustomEvent; export interface MulticolListElementEventMap { 'multicol-select': MulticolSelectEvent; 'list-select-intent': CustomEvent; 'multicol-columns-change': MulticolColumnsChangeEvent; 'view-state-change': ViewStateChangeEvent; } declare global { interface HTMLElementTagNameMap { 'ixfx-multicol-list': MulticolListElement; } } export interface MulticolListElement { addEventListener(type: K, listener: (this: MulticolListElement, event: MulticolListElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } export declare class MulticolListElement extends LitElement { #private; static styles: import("lit").CSSResult[]; categories: readonly MulticolCategory[]; dataProvider?: IDataProvider; selectionMode: ListSelectionMode; minColumns: number; maxColumns: number; /** * A column with more choices than this (and not grouped) renders only the rows near its viewport; the rest are * data. Keeps a column of 100k choices cheap to build, re-query, sort and scroll. `0` always renders every row. */ virtualizeThreshold: number; private _columns; private _colOffsets; private _resizingColumnId; private _draggingColumnId; private _dropCaretX; private _containerEl; private _idCounter; private _autoSeeded; private _drag; addColumn(categoryKey: string, position?: number): void; removeColumn(columnId: string): void; getSelection(): ReadonlyArray<{ columnId: string; categoryKey: string; values: readonly string[]; }>; clearSelection(): void; protected createRenderRoot(): HTMLElement | DocumentFragment; protected render(): import("lit").TemplateResult<1>; /** * Snapshot the column layout (in display order) and each column's * selection and scroll, keyed by column id. Includes pending state — * saved columns whose category isn't known and keys not yet in the data. */ getViewState(options?: GetViewStateOptions): MulticolListViewState; /** * Apply saved view state; fields present replace the current ones. * `columns` creates, reorders, re-points and removes columns to match * (columns whose category isn't in `categories` wait until it is). * Selection keys not in a column's data are applied when they arrive. */ setViewState(state: Partial): void; clearPendingViewState(): void; protected updated(changedProperties: Map): void; private _renderColumn; private _getCategoryLabel; /** Category description if present, else the default 'Change category' hint. */ private _getCategoryTooltip; /** * Caller-assigned tags for an item (`undefined` ⇒ none), given the column it * is shown in. Each tag is mirrored on the item as `data-tags` * (`li[data-tags~="foo"]`); `tagBehaviour` can switch off selection, focus, * drag or search per tag. Merged with {@link tagKeys}. Call {@link refreshTags} * after changing what the hook reads. */ tags: ((item: MulticolItem, columnId: string) => readonly string[] | undefined) | undefined; /** Tags by item key, in every column with an item of that key: tag name → keys. */ get tagKeys(): ItemTagKeys | undefined; set tagKeys(value: ItemTagKeys | undefined); /** Interaction flags per tag name (`selectable`, `focusable`, `draggable`, `searchable`); the most restrictive flag wins. */ get tagBehaviour(): ItemTagBehaviour | undefined; set tagBehaviour(value: ItemTagBehaviour | undefined); /** Re-evaluate every column's tags. */ refreshTags(): void; /** * Item keys shown as *partially* selected in every column that has an item * with that key (see `ixfx-vertical-list`'s `partialKeys`). Independent of * the selection; selected wins. For per-column keys use * {@link setColumnPartialKeys}. Replace-on-set. */ get partialKeys(): ReadonlySet; set partialKeys(keys: Iterable); /** Partially selected keys for one column, on top of {@link partialKeys}. Pass no keys to clear. */ setColumnPartialKeys(columnId: string, keys?: Iterable): void; private _onHeaderPointerDown; private _onResizePointerDown; private _openCategoryPicker; private _openBurgerMenu; private _changeColumnCategory; private _onColumnSelectionChange; private _onColumnRequestData; private _buildQuery; private _requeryAllColumns; private _syncColumnsWithCategories; private _updateColOffsets; private _emitColumnsChange; autoSizeColumns(options?: { minWidth?: number; maxWidth?: number; }): Promise; } /** Direction a port faces: `in` receives wires, `out` sends them. */ export type PortDir = `in` | `out`; /** * Which way a wire leaves a port. Nested ports (not on the node rails) may * override it with the `side` attribute; it defaults from {@link PortDir}. */ export type PortSide = `left` | `right` | `top` | `bottom`; /** * Identifies one end of a wire: a port `key` on the node with the given `key`. * Both keys are author-chosen, so two graphs on one page never collide. */ export type PortRef = { readonly node: string; readonly port: string; }; /** * A wire between two ports. `from` is always an `out` port and `to` always an * `in` port (normalised — a wire dragged backwards from an `in` port commits * in this orientation). The id is deterministic (see `edgeId`), so edges stay * plain immutable data. */ export type GraphEdge = { /** `edgeId(from, to)` — e.g. `osc/out->amp/in` (with keys escaped). */ readonly id: string; /** Source: always an `out` port. */ readonly from: PortRef; /** Destination: always an `in` port. */ readonly to: PortRef; }; /** * Pan/zoom state. `x` / `y` are the translation applied to the viewport layer * (screen px), `zoom` the scale factor. */ export type Viewport = { readonly x: number; readonly y: number; readonly zoom: number; }; /** A point in some coordinate space (flow, screen, node-relative — by context). */ type Point$1 = { readonly x: number; readonly y: number; }; /** Everything the connect rules need to know about a port. */ export type PortInfo = { readonly ref: PortRef; readonly dir: PortDir; /** Compatibility tag. Empty or `*` matches anything. */ readonly type: string; /** Maximum connections. `in` defaults to 1, `out` to unlimited. */ readonly max: number; /** Wire tangent at this port. */ readonly side: PortSide; /** Human-visible name (`ref.port` is the unique key). */ readonly label?: string; /** Optional longer explanation. */ readonly description?: string; }; /** Plain-JSON snapshot of the whole editor state. See `NodeGraphElement.getGraph()`. */ export type GraphSnapshot = { readonly nodes: ReadonlyArray<{ readonly key: string; readonly x: number; readonly y: number; readonly label: string; readonly ports: readonly PortInfo[]; }>; readonly edges: readonly GraphEdge[]; }; /** Why a connection was rejected by the built-in rules. */ export type ConnectionCheckReason = `same-dir` | `self` | `type` | `max` | `duplicate` | `cycle` | `custom`; /** * Result of the built-in connection rules. `ok: true` may carry an edge that * the new wire replaces (an `in` port at `max === 1`). */ export type ConnectionCheck = { readonly ok: true; readonly replaces?: GraphEdge; } | { readonly ok: false; readonly reason: ConnectionCheckReason; }; /** * Extra veto hook, on top of the built-in rules. Return `false` to reject. * `graph` is the port graph as it stands when the check runs. */ export type IsValidConnection = (from: PortInfo, to: PortInfo, graph: index_d_exports$2.Directed.DirectedGraph) => boolean; /** A single node position change. */ export type NodeMove = { readonly key: string; readonly x: number; readonly y: number; }; export type GraphConnectDetail = { readonly edge: GraphEdge; /** Existing wire the new one replaces (`in` port at `max === 1`). */ readonly replaces?: GraphEdge; }; export type GraphConnectEvent = CustomEvent; export type DisconnectReason = `delete` | `detach` | `replace` | `api`; export type GraphDisconnectDetail = { readonly edges: readonly GraphEdge[]; readonly reason: DisconnectReason; }; export type GraphDisconnectEvent = CustomEvent; /** A wire was dropped on empty space — the consumer may open a "create node" menu. */ export type GraphConnectEndDetail = { readonly from: PortRef; /** Drop point in flow coordinates. */ readonly point: Point$1; /** Drop point in client coordinates. */ readonly client: Point$1; }; export type GraphConnectEndEvent = CustomEvent; export type GraphDeleteDetail = { /** Every node being deleted, including the children of a deleted group. */ readonly nodes: readonly string[]; readonly edges: readonly GraphEdge[]; /** Wires added to keep the flow connected through deleted nodes (`bridge-on-delete`). Cancel the event to veto them all. */ readonly bridged: readonly GraphEdge[]; }; export type GraphDeleteEvent = CustomEvent; export type GraphNodeMoveDetail = { readonly moves: readonly NodeMove[]; }; export type GraphNodeMoveEvent = CustomEvent; export type GraphNodeMovedEvent = CustomEvent; /** A node was resized (`graph-node-resize` while dragging, `graph-node-resized` on release). `x` / `y` are relative to its parent. */ export type GraphNodeResizeDetail = { readonly key: string; readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; export type GraphNodeResizeEvent = CustomEvent; /** A port was added (`available`) or hidden away (`potential`) by the user. */ export type GraphPortChangeDetail = { readonly node: string; readonly port: string; readonly dir: `in` | `out`; readonly availability: `available` | `potential`; }; export type GraphPortChangeEvent = CustomEvent; /** A node was collapsed to its title bar or expanded (bubbles from the node). */ export type GraphNodeCollapseDetail = { readonly key: string; readonly collapsed: boolean; }; export type GraphNodeCollapseEvent = CustomEvent; /** * The user double-clicked a node's title bar (not one of its controls). Cancelable: with the graph's * `dblclick-toggle` on, `preventDefault()` stops the node collapsing or expanding. */ export type GraphNodeTitleDblclickDetail = { readonly key: string; /** Whether the node was collapsed when it was double-clicked. */ readonly collapsed: boolean; }; export type GraphNodeTitleDblclickEvent = CustomEvent; /** A node made by `nodeFactory` was added (`connectedTo` is the port it was wired to). */ export type GraphNodeAddedDetail = { readonly key: string; readonly from: PortRef; readonly connectedTo?: PortRef; }; export type GraphNodeAddedEvent = CustomEvent; /** Right-click on a node, wire or the background. Cancel it to suppress the menu. */ export type GraphContextMenuDetail = { readonly kind: `node` | `edge` | `pane` | `port`; /** Node key (`kind: 'node'`), wire id (`kind: 'edge'`) or `node/port` (`kind: 'port'`). */ readonly id?: string; readonly client: Point$1; readonly point: Point$1; }; export type GraphContextMenuEvent = CustomEvent; export type GraphSelectionChangeDetail = { readonly nodes: readonly string[]; readonly edges: readonly string[]; }; export type GraphSelectionChangeEvent = CustomEvent; export type GraphViewportChangeEvent = CustomEvent; export type GraphEdgesChangeDetail = { readonly edges: readonly GraphEdge[]; /** The new port graph, for consumers keeping an immutable history (undo). */ readonly graph: index_d_exports$2.Directed.DirectedGraph; }; export type GraphEdgesChangeEvent = CustomEvent; /** Internal, non-composed event `ixfx-graph-node` fires when its geometry may have changed. */ export type GraphNodeGeometryDetail = { readonly key: string; readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; export type GraphNodeGeometryEvent = CustomEvent; export interface NodeGraphElementEventMap { 'graph-connect': GraphConnectEvent; 'graph-disconnect': GraphDisconnectEvent; 'graph-connect-end': GraphConnectEndEvent; 'graph-delete': GraphDeleteEvent; 'graph-node-move': GraphNodeMoveEvent; 'graph-node-moved': GraphNodeMovedEvent; 'graph-node-resize': GraphNodeResizeEvent; 'graph-node-resized': GraphNodeResizeEvent; 'graph-node-collapse': GraphNodeCollapseEvent; 'graph-node-title-dblclick': GraphNodeTitleDblclickEvent; 'graph-port-change': GraphPortChangeEvent; 'graph-node-added': GraphNodeAddedEvent; 'graph-context-menu': GraphContextMenuEvent; 'graph-selection-change': GraphSelectionChangeEvent; 'graph-viewport-change': GraphViewportChangeEvent; 'graph-edges-change': GraphEdgesChangeEvent; 'view-state-change': CustomEvent; } /** View state for `ixfx-node-graph`: viewport transform plus selection. */ export type NodeGraphViewState = ViewStateBase & { readonly viewport?: { readonly x: number; readonly y: number; readonly zoom: number; }; /** Selected wire ids (`GraphEdge.id`). */ readonly edges?: readonly string[]; }; /** A pointer gesture owning the current drag (pan, node drag, wire drag, marquee, resize). */ export interface PointerGesture { onPointerMove: (e: PointerEvent) => void; /** Returns `true` to keep the gesture alive (e.g. a multi-pointer pinch). */ onPointerUp: (e: PointerEvent) => boolean; onPointerCancel: (e: PointerEvent) => boolean; addPointer?: (e: PointerEvent) => void; } /** * Vertex id of a port in the port graph: node and port joined by `/`, * with `\` and `/` in the keys escaped. Use `parsePortId` to reverse it — * never hand-parse ids. */ export declare function portId(ref: PortRef): string; /** Reverse of `portId`. Returns `undefined` for ids without a separator. */ export declare function parsePortId(id: string): PortRef | undefined; /** Deterministic edge id: `${portId(from)}->${portId(to)}`. */ export declare function edgeId(from: PortRef, to: PortRef): string; /** All the port vertices that exist as ids, whether or not they have wires. */ export declare function ensurePort(g: index_d_exports$2.Directed.DirectedGraph, ref: PortRef): index_d_exports$2.Directed.DirectedGraph; /** Adds a wire `from → to` (out port → in port), creating port vertices as needed. */ export declare function addWire(g: index_d_exports$2.Directed.DirectedGraph, from: PortRef, to: PortRef): index_d_exports$2.Directed.DirectedGraph; /** Removes the wire `from → to`, if present. Exact, because vertices are ports. */ export declare function removeWire(g: index_d_exports$2.Directed.DirectedGraph, from: PortRef, to: PortRef): index_d_exports$2.Directed.DirectedGraph; /** * Removes every port of a node (with their wires), keeping the node itself — * the element may come back. `portKeys` is the set of port keys the node had. */ export declare function removeNode(g: index_d_exports$2.Directed.DirectedGraph, nodeKey: string, portKeys: readonly string[]): index_d_exports$2.Directed.DirectedGraph; /** Builds a fresh port graph from a plain edge array, in one mutation pass. */ export declare function fromEdges(edges: readonly GraphEdge[]): index_d_exports$2.Directed.DirectedGraph; /** * Derives the public edge view from a port graph. Every graph edge runs out → * in by construction; ids are recomputed deterministically. */ export declare function toEdges(g: index_d_exports$2.Directed.DirectedGraph): GraphEdge[]; /** * Collapses a port graph to node keys. Every node key that has a port in the * port graph appears as a vertex, and parallel wires between the same node * pair collapse to one edge. * * Ports only become vertices of the port graph once they are wired, so a node * with no wires is invisible to `g`. Pass `nodeKeys` (every node that exists) * to include those isolated nodes too. */ export declare function toNodeGraph(g: index_d_exports$2.Directed.DirectedGraph, nodeKeys?: Iterable): index_d_exports$2.Directed.DirectedGraph; /** * Per-drag context for the connection rules. Computed once when a wire drag * starts so each candidate port is O(1) to check. */ export type ConnectContext = { /** * The port graph with every edge reversed: the in-degree of an `in` port is * `vertex.out.length` in this graph, read in O(1). */ readonly transposed: index_d_exports$2.Directed.DirectedGraph; /** * With `acyclic` set: node keys that the dragged wire may not connect into * (the source node itself, plus its ancestors or descendants depending on * drag direction). Only computed when `acyclic` is on; otherwise empty. */ readonly blockedNodes: ReadonlySet; }; /** * Context for one wire drag. `anchor` is the port the drag started from and * `forward` is `true` when the anchor is an `out` port (a normal forward * wire) — cycle blocking then uses the anchor's ancestors. For a wire dragged * backwards from an `in` port, candidates are `out` ports, so blocking uses * the anchor's descendants instead. */ export declare function connectContext(portGraph: index_d_exports$2.Directed.DirectedGraph, nodeGraph: index_d_exports$2.Directed.DirectedGraph, anchor: PortRef, forward: boolean, acyclic: boolean): ConnectContext; /** * Node keys that must not be the target of a new wire from `nodeKey`. * Forward (the target reads from us): its ancestors plus itself. * Backward (we read from the target): its descendants plus itself. */ export declare function cycleBlockedNodes(nodeGraph: index_d_exports$2.Directed.DirectedGraph, nodeKey: string, forward: boolean): Set; /** Number of wires arriving at an `in` port, read in O(1) from a transposed graph. */ export declare function inDegreeOf(transposed: index_d_exports$2.Directed.DirectedGraph, ref: PortRef): number; /** Number of wires leaving an `out` port, read in O(1). */ export declare function outDegreeOf(g: index_d_exports$2.Directed.DirectedGraph, ref: PortRef): number; /** True when the exact wire `from → to` already exists. */ export declare function hasWire(g: index_d_exports$2.Directed.DirectedGraph, from: PortRef, to: PortRef): boolean; /** * The single wire currently arriving at an `in` port, if any — the edge an * `in` port at `max === 1` would replace. */ export declare function incomingEdge(transposed: index_d_exports$2.Directed.DirectedGraph, ref: PortRef): GraphEdge | undefined; /** All wires arriving at an `in` port (for `max > 1` ports). */ export declare function incomingEdges(g: index_d_exports$2.Directed.DirectedGraph, ref: PortRef): GraphEdge[]; /** * Pure connection rules for the wire drag and the `connect()` API. * * All checks take a {@link ConnectContext} (computed once per drag) and the * working* port graph — the graph the drag commits into. During a detach * the picked-up wire is removed from the working graph first, so the rules * naturally ignore it. */ export type ConnectionRulesOptions = { /** Allow both ends on the same node. Default `false`. */ readonly allowSelf: boolean; /** Reject connections that would create a (node-level) cycle. Default `false`. */ readonly acyclic: boolean; /** Extra consumer veto, checked last. */ readonly isValidConnection?: IsValidConnection; }; /** Port types are compatible when equal, or either side is empty or `*` (matches anything). */ export declare function typesCompatible(a: string, b: string): boolean; /** * Normalises an (unordered) pair of ports to out → in. Returns `undefined` * when both ports face the same direction — no wire is possible. */ export declare function normaliseConnection(a: PortInfo, b: PortInfo): { readonly from: PortInfo; readonly to: PortInfo; } | undefined; /** * Runs the built-in rules, in order, stopping at the first failure. When * everything passes it returns the wire's `PortRef` pair plus an edge it * would replace (an `in` port whose `max === 1` already has a wire). */ export declare function canConnect(from: PortInfo, to: PortInfo, ctx: ConnectContext, graph: index_d_exports$2.Directed.DirectedGraph, options: ConnectionRulesOptions): ConnectionCheck; /** * Convenience for the `connect()` API: validates a pair of port infos (in * either order) against a context built on the fly, returning the normalised * wire on success. */ export declare function resolveConnection(a: PortInfo, b: PortInfo, graph: index_d_exports$2.Directed.DirectedGraph, nodeGraph: index_d_exports$2.Directed.DirectedGraph, options: ConnectionRulesOptions): { readonly edge: { readonly from: PortRef; readonly to: PortRef; }; readonly replaces?: GraphEdge; } | { readonly reason: ConnectionCheckReason; }; /** * The first valid wire from one of `outs` to one of `ins` that adds a new * wire without replacing another. Used by proximity connect. */ export declare function findValidWire(outs: readonly PortInfo[], ins: readonly PortInfo[], graph: index_d_exports$2.Directed.DirectedGraph, nodeGraph: index_d_exports$2.Directed.DirectedGraph, options: ConnectionRulesOptions): { readonly from: PortInfo; readonly to: PortInfo; } | undefined; /** * Deleting a node in the middle of a flow without breaking it: each wire that * entered the node is reconnected to each wire's destination that left it. * * "Through" pairs are matched by port type: a wire arriving at an `in` port of * type T is bridged to wires leaving an `out` port of a compatible type. Every * new wire must also pass the normal connection rules (types, max, cycles, * duplicates, `isValidConnection`); one that wouldn't is skipped, and a bridge * never replaces an existing wire. */ type BridgeDeps = { readonly portInfo: (ref: PortRef) => PortInfo | undefined; /** Port keys of a node, so its vertices can be removed. */ readonly portKeys: (nodeKey: string) => readonly string[]; /** Every node key (so unwired nodes stay in the node graph used for cycle checks). */ readonly nodeKeys: readonly string[]; readonly rules: ConnectionRulesOptions; }; type BridgeResult = { /** The port graph with the nodes removed and the bridges added. */ readonly graph: index_d_exports$2.Directed.DirectedGraph; /** The wires that were added to keep the flow connected. */ readonly bridged: readonly GraphEdge[]; }; /** * Removes `remove` from the graph. Nodes in `bridge` (a subset, normally the * ones the user chose rather than a deleted group's children) are bridged first. */ export declare function removeNodes(graph: index_d_exports$2.Directed.DirectedGraph, remove: readonly string[], bridge: ReadonlySet, deps: BridgeDeps): BridgeResult; /** * Right-click targets for the graph: a node, a wire, or the background, each * with its own optional `ixfx-menu-trigger` (`slot="context-menu"` on a node, * `slot="edge-menu"` / `slot="pane-menu"` on the graph). */ type ContextKind = `node` | `edge` | `pane` | `port`; /** The slice of `ixfx-menu-trigger` used here. */ type OpenableMenu = { openAt: (clientX: number, clientY: number) => void; }; type ContextTarget = { readonly kind: ContextKind; /** Node key or wire id. */ readonly id?: string; /** The trigger to open, if the author provided one for this kind. */ readonly menu?: OpenableMenu; }; /** * Pure logic for the selection rectangle ("marquee"): geometry, hit-testing * and the rule for which input starts one. */ export type GraphRect = { readonly x: number; readonly y: number; readonly width: number; readonly height: number; }; /** * What an empty-space drag does for touch / pen input (which can't hold a * modifier key): `pan` moves the canvas, `select` draws a selection rectangle. * Mouse always pans, and draws a rectangle only while Shift is held. */ export type TouchMode = `pan` | `select`; /** The normalised rectangle spanning two corner points (either order). */ export declare function rectFromPoints(a: Point$1, b: Point$1): GraphRect; /** True when the rectangles overlap (touching edges don't count). */ export declare function rectsIntersect(a: GraphRect, b: GraphRect): boolean; /** Keys of the nodes whose rectangle overlaps `area` at all (partial overlap selects). */ export declare function nodesInRect(area: GraphRect, nodes: ReadonlyArray<{ readonly key: string; readonly rect: GraphRect; }>): string[]; /** The selection while a marquee is live: the hits, plus the starting selection when additive. */ export declare function combineSelection(base: ReadonlySet, hits: readonly string[], additive: boolean): Set; export type MarqueeStartInput = { readonly pointerType: string; readonly button: number; readonly shiftKey: boolean; /** The press landed on empty pane background (not a node, port or wire). */ readonly onBackground: boolean; /** Space is held, which pans from anywhere and wins over selecting. */ readonly spacePan: boolean; readonly touchMode: TouchMode; }; /** * Whether a pointerdown starts a selection rectangle instead of a pan. * Mouse needs Shift. Touch and pen follow `touchMode`, since neither has a * modifier key to hold. */ export declare function wantsMarquee(input: MarqueeStartInput): boolean; /** Inline style placing the rectangle (client px) inside a pane whose top-left is at `origin` (client px). */ export declare function marqueeStyle(r: GraphRect, origin: Point$1): Record; /** * Easy connect: drag from anywhere inside a node (not just a port) to start a * wire, and drop anywhere on another node to finish one. A margin ring around * the node stays free so the node can still be grabbed and moved. */ /** Default width of the move-the-node margin, in flow px. */ export declare const EASY_CONNECT_MARGIN = 10; /** True when `p` is inside `rect` and at least `margin` away from every edge. */ export declare function inEasyConnectZone(p: Point$1, rect: GraphRect, margin: number): boolean; /** * The port a drag from inside a node starts from: the one named `prefer`, else * the first `out` port, else the first `in` port (drawn backwards). */ export declare function pickStartPort(ports: readonly PortInfo[], prefer?: string): PortInfo | undefined; /** * How wires are drawn, and how that can be steered. * * Per wire the path comes from, in order of priority: * 1. an {@link EdgeRouter} result for that wire (e.g. an obstacle-avoiding router such as libavoid), * 2. the wire's {@link EdgeHint} `waypoints`, * 3. the wire's hint `style`, else the graph's `edge-style`. */ /** `bezier` (default) curves out of each port; `straight` is a line; `step` is orthogonal with rounded corners. */ export type EdgeStyle = `bezier` | `straight` | `step`; export type EdgeHint = { /** Overrides the graph's `edge-style` for this wire. */ readonly style?: EdgeStyle; /** Points (flow coordinates) the wire is drawn through, between its two ends. */ readonly waypoints?: readonly Point$1[]; }; /** Wire id → hint. */ export type EdgeHintMap = Readonly>; /** One end of a wire as a router sees it. */ export type RouteEnd = { readonly node: string; readonly port: string; /** Port centre, flow coordinates. */ readonly pos: Point$1; /** The direction the wire should leave the port in. */ readonly side: PortSide; }; export type EdgeRouteRequest = { readonly edges: ReadonlyArray<{ readonly id: string; readonly from: RouteEnd; readonly to: RouteEnd; }>; /** The nodes the wires should go around (every node that is shown). */ readonly obstacles: ReadonlyArray<{ readonly key: string; readonly rect: GraphRect; }>; }; /** * Plugs in a router. Called synchronously whenever wires need redrawing (so keep it fast, or cache), it * returns, for the wires it routed, the full list of points from start to end (flow coordinates). A wire it * leaves out is drawn normally. */ export type EdgeRouter = (request: EdgeRouteRequest) => ReadonlyMap | undefined; /** * Port states. A port is **connected** when a wire is attached. Otherwise it * is **available** (visible, unconnected) or **potential** (unconnected and * hidden away). `availability` is what the author or user chose for an * unconnected port; the graph works out `connected` from the wires. */ type PortAvailability = `available` | `potential`; type PortStatus = `connected` | `available` | `potential`; /** Whether a node shows its available (unconnected) ports, or tucks them away until needed. */ type AvailablePorts = `show` | `hide`; type PortEdge = `in` | `out`; /** * How a node lists its ports: `rail` puts inputs on the left edge and outputs on the right, beside the content; * `full` lists every input and then every output as a full-width row, each with its label and description. */ type PortListLayout = `rail` | `full`; /** * Which edges of a node its ports sit on: `vertical` puts them on the left and right edges (inputs left, outputs * right); `horizontal` puts them on the top and bottom edges (inputs top, outputs bottom). The full-width list layout * needs the left/right edges, so it is ignored when `horizontal`. */ type PortLocation = `vertical` | `horizontal`; /** Extends `p` in the direction `side` faces. */ export declare function extendFromSide(p: { readonly x: number; readonly y: number; }, side: PortSide, reach: number): { x: number; y: number; }; /** Default wire tangent for a port direction: `in` faces left, `out` faces right. */ export declare function defaultSide(dir: `in` | `out`, location?: PortLocation, flip?: boolean): PortSide; /** * SVG path data for the wire. Points are in flow coordinates; the edge layer * draws inside the transformed viewport layer, so no further scaling applies. */ export declare function edgePath(from: { readonly x: number; readonly y: number; }, fromSide: PortSide, to: { readonly x: number; readonly y: number; }, toSide: PortSide): string; /** * The point halfway along the wire (a cubic bezier at t = 0.5), for placing a * label. Uses the same control points as {@link edgePath}. */ export declare function edgeMidpoint(from: { readonly x: number; readonly y: number; }, fromSide: PortSide, to: { readonly x: number; readonly y: number; }, toSide: PortSide): { x: number; y: number; }; /** Corner rounding (flow px) for wires drawn as polylines: `step`, waypoints and routed wires. */ export declare const EDGE_CORNER_RADIUS = 8; /** * The corners of an orthogonal wire: out of the port along its side, across in an elbow halfway between, * and into the other port along its side. */ export declare function stepPoints(from: Point$1, fromSide: PortSide, to: Point$1, toSide: PortSide): Point$1[]; /** SVG path through `points`, with corners rounded to at most `radius`. */ export declare function polylinePath(points: readonly Point$1[], radius?: number): string; /** The point halfway along a polyline, by length (where a label goes). */ export declare function polylineMidpoint(points: readonly Point$1[]): Point$1; /** Path and label position of a wire between two ports in the given style. */ export declare function edgeShape(style: EdgeStyle, from: Point$1, fromSide: PortSide, to: Point$1, toSide: PortSide): { d: string; mid: Point$1; }; /** Path and label position of a wire drawn through the given points (a router result, or waypoints). */ export declare function polylineShape(points: readonly Point$1[]): { d: string; mid: Point$1; }; /** * A force-directed layout, as plain immutable steps. Nodes repel each other, links pull their two nodes to a * target distance, a weak gravity keeps everything near the centre, and overlapping nodes are pushed apart. * Call {@link forceStep} repeatedly (e.g. once per animation frame) and apply {@link forcePositions}. * * Positions are node top-left corners (as `ixfx-graph-node` `x` / `y`); the forces work on node centres. */ export type ForceNode = { readonly key: string; readonly x: number; readonly y: number; readonly width: number; readonly height: number; /** A pinned node doesn't move (but still pushes the others), e.g. while the user drags it. */ readonly pinned?: boolean; }; export type ForceLink = { readonly source: string; readonly target: string; }; export type ForceOptions = { /** Push between every pair of nodes (strength / distance²). */ readonly repulsion: number; /** Rest length of a link, between node centres. */ readonly linkDistance: number; /** How hard a link pulls back to its rest length (per px of stretch). */ readonly linkStrength: number; /** Pull of every node toward `center`. */ readonly gravity: number; /** Fraction of velocity kept each step (0..1). Lower settles faster. */ readonly damping: number; /** Largest movement per step, px. */ readonly maxSpeed: number; /** Extra space kept between nodes' edges, px. */ readonly padding: number; readonly center: Point$1; }; export declare const DEFAULT_FORCE_OPTIONS: ForceOptions; type Body = ForceNode & { readonly vx: number; readonly vy: number; }; export type ForceState = { readonly bodies: readonly Body[]; }; /** A resting state (no velocity) for the given nodes. */ export declare function forceState(nodes: readonly ForceNode[]): ForceState; /** One simulation step. Returns a new state; the input is not changed. */ export declare function forceStep(state: ForceState, links: readonly ForceLink[], options?: Partial): ForceState; /** Node key → top-left position, for `setNodePositions`. */ export declare function forcePositions(state: ForceState): Record; /** Total movement this step: near zero once the layout has settled. */ export declare function forceMovement(state: ForceState): number; /** Returns the state with one node moved to `to` and pinned (or released with `pinned: false`), e.g. while it is dragged. */ export declare function forcePin(state: ForceState, key: string, to: Point$1 | undefined, pinned?: boolean): ForceState; /** * `` — a connectable dot on an `ixfx-graph-node`. * * Author as a child of `ixfx-graph-node`: * * ```html * * * * * ``` * * Ports that are *direct children* are auto-assigned to the `in` / `out` * slots (the node's left/right rails) based on `dir`. Ports nested inside * content stay where the author put them; wires follow their measured * position, and `side` sets the wire tangent. * * During a wire drag the graph sets state attributes for CSS: * `data-connect="valid|invalid"`, `data-magnet="active"` and the custom * property `--magnet-proximity` (0..1). * * Per-type colours work through plain consumer CSS: * `ixfx-graph-port[type=number] { --node-graph-port-color: … }`. */ export declare class GraphPortElement extends LitElement { #private; static styles: import("lit").CSSResult; /** Unique within its node. */ key: string; dir: PortDir; /** Compatibility tag. Empty or `*` matches anything. */ type: string; /** Max connections; 0 = default (1 for `in`, unlimited for `out`). */ max: number; /** Wire tangent; empty = from `dir` (`in` → left, `out` → right). */ side: string; /** Human-visible name, shown next to the dot. `key` is the unique identifier. */ label: string; /** Optional longer explanation, shown in the tooltip (the label is shown there when there is none). */ description: string; /** * What an unconnected port is: `available` (visible) or `potential` (hidden * away until added with the node's + button). A wired port is always * `connected`, whatever this says. The user can change it at runtime. */ availability: PortAvailability; /** * Blink rate in Hz (blinks per second). `0` (default) = steady. Works on `in` * and `out` ports; clamped to 10 Hz. Honours `prefers-reduced-motion`. */ blink: number; /** `connected` (a wire is attached), else `available` or `potential` from `availability`. */ get status(): PortStatus; /** @internal */ setConnected(connected: boolean): void; connectedCallback(): void; /** Effective max connections. */ get portMax(): number; /** Effective wire tangent. */ get portSide(): PortSide; /** Builds the `PortInfo` the rules work with. `nodeKey` comes from the graph. */ portInfo(nodeKey: string): PortInfo; /** @internal */ setDragState(state: `valid` | `invalid` | undefined): void; /** @internal */ setMagnet(active: boolean, proximity: number): void; protected render(): import("lit").TemplateResult<1>; protected firstUpdated(): void; protected updated(changed: Map): void; } declare global { interface HTMLElementTagNameMap { 'ixfx-graph-port': GraphPortElement; } } /** * `` — one node on an `ixfx-graph-node-graph` canvas. * * Light-DOM child of the graph, slotted into its transformed viewport layer. * Position (`x` / `y`, flow coordinates) is applied as a CSS transform on the * host. Arbitrary content (controls, text, markup) is authored as children; * consumer CSS reaches it because it stays in the document scope. * * ```html * * * * * * ``` * * A `ixfx-graph-port` that is a direct child is auto-assigned to the * `in` / `out` slot (left/right rail) from its `dir`, unless it already has * an explicit `slot`. A port nested deeper stays in the content flow, like * Svelte Flow's ``. * * Optional features, all plain attributes: * - `shape` (`rect` `rounded` `pill` `circle` `diamond` `hexagon`) and the * `--graph-node-border-*` / `--graph-node-radius` variables, set on the node * (one node) or on the graph (all nodes). * - `drag-by="handle"`: only the grip in the title bar (or an element with * `data-drag-handle`) starts a drag, instead of the whole node. * - `resizable` (+ `width` / `height` / `min-*` / `max-*`): edge and corner grips. * - `group` and `parent`: a container node, and children placed inside it. * - `slot="toolbar"` (e.g. an `ixfx-toolbar`) shown above the selected node. * - `slot="context-menu"` (an `ixfx-menu-trigger icon-name="ellipsis"`): shown as a three-dot * button in the title bar, and also opened by right-click. * - A titled node can be collapsed to just its title bar with the disclosure widget (`collapsed`). * Collapsing a group hides its children. * * Fires the internal, non-composed `graph-node-geometry` event whenever its * position, size or ports may have changed, so the graph re-renders wires. */ export declare class GraphNodeElement extends LitElement { #private; static styles: import("lit").CSSResult[]; /** Unique within its graph. */ key: string; /** Flow-space position. */ x: number; y: number; /** Header text; omit for a headerless node. */ label: string; /** Set by the graph, for styling. */ selected: boolean; /** * Key of a parent (group) node. `x` / `y` are then relative to that parent, * which also carries this node when it moves. Ignored if it names a missing * node or this node itself. */ parent: string; /** Outline: `rect` `rounded` (default) `pill` `circle` `diamond` `hexagon`. */ shape: string; /** A container for child nodes (which name it with `parent`). */ group: boolean; /** Keep a child within its parent's bounds while dragging (`parent`). */ extent: `` | `parent`; /** Name of an icon from the icon registry, shown at the left of the title. */ icon: string; /** `show` / `hide` the node's available (unconnected) ports. Empty inherits the graph's `available-ports`. */ availablePorts: `` | AvailablePorts; /** The graph's default, set by the graph. */ inheritedAvailablePorts: AvailablePorts; private _potential; /** Wires to hidden children shown on a collapsed group's virtual in / out port. */ private _virtual; private _menu; /** Whether available ports are tucked away (own setting, else the graph's). */ get hidesAvailable(): boolean; /** `rail` (inputs left, outputs right) or `full` (a full-width row per port). Empty inherits the graph's `port-layout`. */ portLayout: `` | PortListLayout; /** The graph's default, set by the graph. */ inheritedPortLayout: PortListLayout; /** `vertical` (ports on the left and right edges) or `horizontal` (top and bottom). Empty inherits the graph's `port-location`. */ portLocation: `` | PortLocation; inheritedPortLocation: PortLocation; /** Swaps the ends ports sit at (inputs right / bottom, outputs left / top). The graph's `flip-ports` also applies. */ flipPorts: boolean; inheritedFlipPorts: boolean; /** The graph's `dblclick-toggle`, set by the graph. */ inheritedDblclickToggle: boolean; private _bodyEmpty; private _filled; /** Which edges the ports sit on (own setting, else the graph's). */ get effectivePortLocation(): PortLocation; get effectiveFlipPorts(): boolean; /** How this node lists its ports (own setting, else the graph's). Always `rail` when the ports are on the top and bottom edges. */ get effectivePortLayout(): PortListLayout; /** Show only the title bar. Needs a `label`; the disclosure widget toggles it. */ collapsed: boolean; /** Hide the disclosure widget, so the node can't be collapsed. */ noCollapse: boolean; private _hasMenu; /** Collapsed in effect: only a titled node can collapse. */ get isCollapsed(): boolean; /** Edge and corner resize grips. */ resizable: boolean; /** Explicit size in flow px (`0` = size to content / `--graph-node-width`). Set by resizing. */ width: number; height: number; minWidth: number; minHeight: number; /** `0` = unlimited. */ maxWidth: number; maxHeight: number; /** `handle`: only the title-bar grip starts a drag. Empty inherits the graph's `drag-by`. */ dragBy: `` | `node` | `handle`; /** The graph's default, set by the graph. */ inheritedDragBy: `node` | `handle`; /** `on` / `off` overrides the graph's `easy-connect` for this node. */ easyConnect: `` | `on` | `off`; /** Key of the port easy-connect wires from / to (default: the first suitable port). */ connectPort: string; /** When the `toolbar` slot shows: while `selected` (default), `always`, or on `hover`. */ toolbarVisible: `selected` | `always` | `hover`; toolbarPosition: `top` | `bottom` | `left` | `right`; /** Whether the title-bar grip is the only drag start (own setting, else the graph's). */ get dragsByHandle(): boolean; /** * True when this press may start moving the node: always for the default * `node` mode, otherwise only from the grip (or any `data-drag-handle`). */ startsDrag(e: Event): boolean; /** * Asks to show the tucked-away available ports on one side for `ms` * (`Infinity` = until `reveal(side, 0)`); `0` withdraws the request. They are * also shown whenever the node is selected. No effect when the node isn't * hiding its available ports. */ reveal(side: PortEdge, ms: number): void; /** Opens the menu of potential ports on one side, at a client point. */ openAddMenu(side: PortEdge, x: number, y: number): Promise; /** Opens the menu for an available port (just "Hide port"), at a client point. */ openPortMenu(port: GraphPortElement, x: number, y: number): Promise; /** * Whether a client point is over the revealed overlay of ports on one side (with a margin), * so a wire being dragged along the list keeps it shown after leaving the node's edge strip. */ overlayContains(side: PortEdge, client: { x: number; y: number; }, margin?: number): boolean; /** @internal */ refreshPortSlots(): void; /** Collapses or expands the node (if it has a title) and tells the graph, which hides or shows a group's children. */ toggleCollapsed(): void; /** @internal */ setVirtualPorts(inCount: number, outCount: number): void; /** @internal */ setHiddenByAncestor(hidden: boolean): void; /** @internal */ setClip(clipPath: string): void; /** @internal */ setSize(width: number, height: number): void; /** @internal */ setOrigin(x: number, y: number, depth: number): void; connectedCallback(): void; disconnectedCallback(): void; protected firstUpdated(): void; protected willUpdate(changed: PropertyValues): void; protected updated(changed: PropertyValues): void; protected render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-graph-node': GraphNodeElement; } } /** * The "magnetic" wire drag: while a wire is being pulled, nearby compatible * ports attract it. Pure maths — screen-space distances, hysteresis and the * smoothing that gives the wire its pulled-in feel. */ /** A port eligible for snapping, in screen coordinates. */ export type SnapCandidate = { readonly ref: PortRef; readonly x: number; readonly y: number; }; /** The port a dragged wire is currently snapped to. */ export type SnapTarget = { readonly ref: PortRef; readonly x: number; readonly y: number; /** Screen distance from the pointer to the port centre. */ readonly distance: number; }; /** * Finds the snap target for the pointer, with hysteresis: * * - The nearest candidate within `snapRadius` snaps. * - Once snapped, the wire stays on its target until the pointer leaves * `1.5 × snapRadius` of it *or* another candidate is ≥ 25 % closer. This * stops flicker between neighbouring ports. * * Returns `undefined` when nothing is snapped. */ export declare function findSnapTarget(candidates: readonly SnapCandidate[], pointer: Point$1, snapRadius: number, current: SnapTarget | undefined): SnapTarget | undefined; /** * Proximity glow for a candidate `distance` away, 0..1 within * `2 × snapRadius` (0 at the edge of the glow zone, 1 at the port). */ export declare function proximityFactor(distance: number, snapRadius: number): number; /** * One smoothing step toward `goal`: exponential approach with time constant * `tau` (ms). `tau <= 0` (e.g. `prefers-reduced-motion`) snaps immediately. * `dtMs` is the elapsed time since the previous step. */ export declare function smoothStep(p: Point$1, goal: Point$1, dtMs: number, tau: number): Point$1; /** True when `p` has effectively arrived at `goal` (sub-pixel). */ export declare function settled(p: Point$1, goal: Point$1): boolean; /** * The selection-rectangle gesture. Dragging on empty space draws a rectangle * and live-selects every node it overlaps; selected nodes then drag together * (the node-drag controller already moves a whole selection). * * Which input starts it is decided by `wantsMarquee` (Shift for mouse, * `touchMode` for touch/pen); this class only runs the gesture. */ /** Movement (px) before a press becomes a rectangle, so a plain click isn't one. */ export declare const MARQUEE_THRESHOLD_PX = 3; type Selection = { readonly nodes: ReadonlySet; readonly edges: ReadonlySet; }; type MarqueeConfig = { readonly getPane: () => HTMLElement | undefined; /** Client → flow coordinates. */ readonly screenToFlow: (p: Point$1) => Point$1; /** Every node's rectangle in flow coordinates. */ readonly getNodeRects: () => ReadonlyArray<{ readonly key: string; readonly rect: GraphRect; }>; readonly getSelection: () => Selection; readonly applySelection: (nodes: ReadonlySet, edges: ReadonlySet) => void; /** Re-render (the rectangle changed). */ readonly invalidate: () => void; }; export declare class MarqueeController { #private; constructor(config: MarqueeConfig); /** The pointer that owns the gesture, or `null` when idle. */ get pointerId(): number | null; /** The rectangle in **client** px while it is being drawn, else `undefined`. */ get clientRect(): GraphRect | undefined; /** `additive` keeps the existing selection and adds to it. */ begin(e: PointerEvent, additive: boolean): void; onPointerMove(e: PointerEvent): void; onPointerUp(e: PointerEvent): boolean; onPointerCancel(e: PointerEvent): boolean; /** Cancels the gesture and puts the selection back as it was. */ abort(): void; /** * A second finger arrived: cancel the selection and hand the first pointer * over so the caller can start a pinch. `undefined` when not active. */ cancelForPinch(): { readonly pointerId: number; readonly point: Point$1; } | undefined; } /** * Dragging nodes: a 3 px press threshold turns into a move of the whole * selection. Node positions are applied by the host element (`applyMoves`); * no layout is read during the drag — the viewport transform handles it. * * Pointer capture is taken on the pane only once the threshold passes, so * plain clicks on node content keep working. * * Selection itself (click / shift-click) is the host element's job; this * controller only moves. */ /** Drag activation threshold in screen px. */ export declare const DRAG_THRESHOLD_PX = 3; type NodeDragConfig = { readonly getPane: () => HTMLElement | undefined; readonly getViewport: () => Viewport; /** Applies positions and re-renders wires. Returns what was actually applied (e.g. after clamping to a parent). */ readonly applyMoves: (moves: readonly NodeMove[]) => readonly NodeMove[]; /** Per-frame event while dragging. */ readonly emitMove: (moves: readonly NodeMove[]) => void; /** Committed on release. */ readonly emitMoved: (moves: readonly NodeMove[]) => void; readonly setGestureActive: (active: boolean) => void; /** A real drag finished (`committed`) or was cancelled. Not called for a click that never became a drag. */ readonly onEnd?: (committed: boolean) => void; }; /** A node the controller may move: its key and live flow position. */ type DraggableNode = { readonly key: string; x: number; y: number; }; export declare class NodeDragController { #private; constructor(config: NodeDragConfig); get dragging(): boolean; /** * Tracks a potential drag of the given selection. The host applies * selection before calling this; the whole selection moves together. */ onPointerDown(e: PointerEvent, selection: readonly DraggableNode[]): boolean; onPointerMove(e: PointerEvent): void; /** @returns `true` to keep the gesture alive — always `false`. */ onPointerUp(e: PointerEvent): boolean; onPointerCancel(e: PointerEvent): boolean; } /** * DOM measuring of port positions, cached per node. * * A port offset is the port's centre relative to its node's top-left corner, * in **flow** coordinates. Because we divide measured screen distances by the * zoom level, offsets are zoom-independent — node drags and zoom changes do * not invalidate them, only node resizes and port add/remove do. */ export type PortOffset = { /** Port key within the node. */ readonly key: string; readonly x: number; readonly y: number; /** Wire tangent at this port. */ readonly side: PortSide; }; /** * Where a port sits on a collapsed node, which shows only its title bar: the * middle of the edge its wire leaves from. */ export declare function collapsedOffset(side: PortSide, width: number, height: number): { x: number; y: number; }; export type NodeLayout = { /** Port offsets by port key. */ readonly offsets: ReadonlyMap; readonly width: number; readonly height: number; }; /** * Measures one node: the flow-space offsets of every `ixfx-graph-port` * descendant, plus the node's flow-space size. `zoom` is the current viewport * zoom; rects are measured in screen px and divided out. */ export declare function measureNode(node: HTMLElement, zoom: number): NodeLayout; /** * Add-node-on-drop: when a wire is released on empty space, an opt-in * `nodeFactory` makes a new node there, and it is wired to the dragged port. */ type NodeFactoryContext = { /** The port the wire was dragged from. */ readonly from: PortInfo; /** Drop point in flow coordinates. */ readonly point: Point$1; /** Drop point in client coordinates. */ readonly client: Point$1; }; /** * Returns the node to add (a detached `ixfx-graph-node` with a unique `key` and * its ports as children), or `null` / `undefined` to add nothing. */ type NodeFactory = (context: NodeFactoryContext) => GraphNodeElement | null | undefined; type AddedNode = { readonly node: GraphNodeElement; /** The wire made to the dragged port, if a compatible port was found. */ readonly connectedTo?: PortRef; }; /** * Styles for `ixfx-node-graph`: host, pane (dot background), transformed * viewport layer and the SVG edge layer. Node chrome lives in * `graph-node.ts`, port chrome in `graph-port.ts`. */ export declare const nodeGraphStyles: import("lit").CSSResult; /** * ReactiveController for pan and zoom gestures on the graph pane: * * - **Pan** — drag on the empty pane (primary button), the middle button * anywhere, or Space + drag. Pointer capture is on the pane. * - **Zoom** — wheel (mode `zoom`), ctrl/cmd + wheel (trackpad pinch), or a * two-pointer touch pinch. In mode `pan`, the wheel pans and ctrl/pinch * zooms. * - Escape hatches (as in Svelte Flow): elements with `data-nowheel` opt out * of wheel handling; native form controls and `[contenteditable]` never * have their wheel intercepted. */ type WheelMode = `zoom` | `pan`; type PanZoomConfig = { readonly getPane: () => HTMLElement | undefined; readonly getPaneRect: () => DOMRect | undefined; readonly getViewport: () => Viewport; /** Commit a viewport change; the element handles events and rendering. */ readonly setViewport: (v: Viewport) => void; readonly getMinZoom: () => number; readonly getMaxZoom: () => number; readonly getWheelMode: () => WheelMode; /** True when the wheel event started on a target that opted out (`data-nowheel`, form controls). Scans the event's `composedPath`, so light-DOM content inside nodes is seen. */ readonly isWheelBlockedTarget: (e: WheelEvent) => boolean; /** Gestures enable `will-change: transform` on the layer. */ readonly setGestureActive: (active: boolean) => void; /** Toggled while Space is held, for the grab cursor. */ readonly setSpacePan: (active: boolean) => void; }; /** True when `target` is a native form control or contenteditable element. */ export declare function isEditableTarget(target: EventTarget | null | undefined): boolean; export declare class PanZoomController implements ReactiveController { #private; constructor(host: ReactiveControllerHost, config: PanZoomConfig); hostDisconnected(): void; /** Space starts a pan-from-anywhere. Returns `true` when the key was used. */ onKeyDown(e: KeyboardEvent): boolean; /** Releasing Space (or leaving the pane, with `key` omitted) ends it. */ onKeyUp(e?: KeyboardEvent): void; /** True while Space is held (space + drag pans from anywhere). */ get spacePan(): boolean; setSpacePan(active: boolean): void; /** * Consumes a pointerdown when it starts a pan or pinch: the pane * background (primary button), the middle button anywhere, or Space + drag. * Returns `false` to let node/wire controllers try first. */ onPointerDown(e: PointerEvent): boolean; /** * Starts a pinch from a pointer another gesture already owned (`first`, e.g. * a cancelled touch selection) plus the pointer that just arrived. */ startPinch(first: { readonly pointerId: number; readonly point: Point$1; }, second: PointerEvent): void; onPointerMove(e: PointerEvent): void; /** @returns `true` when the gesture should stay alive (multi-pointer pinch). */ onPointerUp(e: PointerEvent): boolean; onPointerCancel(e: PointerEvent): boolean; /** A second pointer joined the gesture → pinch. */ addPointer(e: PointerEvent): void; onWheel(e: WheelEvent): void; } /** * Edges that cross the boundary of a sub flow (a group and everything inside it). */ type SubflowEdges = { /** Wires from a node outside into the sub flow. */ readonly incoming: readonly GraphEdge[]; /** Wires from the sub flow to a node outside. */ readonly outgoing: readonly GraphEdge[]; /** Wires with both ends inside. */ readonly internal: readonly GraphEdge[]; }; /** * Per-wire "data is flowing" animation state. * * Animation is presentation, not topology, so it is not stored on the graph * (the ixfx graph's edges carry no data). It is a plain `edgeId → speed` map * held by the element. Edge ids are deterministic (`edgeId(from, to)`), so an * entry survives a wire being removed and re-created. */ /** Wire id → flow speed in flow-space px/second. Missing, 0 or invalid = no animation. */ export type WireFlowMap = Readonly>; /** Upper bound, so a bad value can't produce an unreadable strobe. */ export declare const MAX_FLOW_SPEED = 2000; /** Returns a usable speed (`0` = off) from anything a consumer might pass. */ export declare function sanitizeFlowSpeed(value: unknown): number; /** * Immutably sets (or, for `undefined` / `0`, clears) one wire's speed. Returns * the same object when nothing changes, so identity checks stay cheap. */ export declare function withWireFlow(map: WireFlowMap, id: string, speed: number | undefined): WireFlowMap; /** * Immutably sets (or, for `undefined`, clears) one entry of a wire-keyed map: labels, hints and * the like. Returns a new object. */ export declare function withEntry(map: Readonly>, id: string, value: T | undefined): Readonly>; type WirePath = { readonly id: string; readonly d: string; readonly selected: boolean; /** Halfway along the wire, where its label goes. */ readonly mid: { readonly x: number; readonly y: number; }; }; /** Wire id → label text. Missing or empty = no label. */ type EdgeLabelMap = Readonly>; /** * The SVG content of the edge layer: each wire, its hit area, an optional * flow overlay and label, the in-progress wire preview, and the proximity-connect preview. * * The flow overlay is a dashed copy of the wire whose `stroke-dashoffset` is * animated by CSS (no per-frame JS). Speed is set per wire through the * `--_flow-speed` custom property (flow-space px/s). */ export declare function renderWires(paths: readonly WirePath[], flow: WireFlowMap, labels: EdgeLabelMap, detachedId: string | undefined, preview: string | undefined, proximity?: string | undefined): import("lit").TemplateResult<2>; /** * How wires are drawn, per graph and per wire: flow animation, labels, style, hints and an optional router. * (The base of `ixfx-node-graph`, which redraws its wires when these change.) */ declare abstract class EdgeDrawingElement extends LitElement { /** * Wires that show data flowing: wire id → speed in flow-space px/second * (missing or 0 = static). Animated in CSS, not JS. Ids are `edgeId(from, to)`; * prefer `setWireFlow()` for a single wire. */ wireFlow: WireFlowMap; /** Wire id → label text, drawn at the middle of the wire. Prefer `setEdgeLabel()` for one wire. */ edgeLabels: EdgeLabelMap; /** How wires are drawn: `bezier` (default), `straight`, or `step` (orthogonal). A wire's own hint wins. */ edgeStyle: EdgeStyle; /** Per-wire drawing hints (wire id → `{ style?, waypoints? }`). Prefer `setEdgeHint()` for one wire. */ edgeHints: EdgeHintMap; /** Opt-in router (e.g. libavoid) that returns the points of each wire; it wins over hints and `edge-style`. */ edgeRouter: EdgeRouter | undefined; /** Starts, retunes (`speed` px/s) or stops (`0` / `undefined`) one wire's flow animation. */ setWireFlow(id: string, speed: number | undefined): void; /** Sets or clears (`''` / `undefined`) one wire's label. */ setEdgeLabel(id: string, text: string | undefined): void; /** Sets or clears one wire's drawing hint (`style`, `waypoints`). */ setEdgeHint(id: string, hint: EdgeHint | undefined): void; } export declare class NodeGraphElement extends EdgeDrawingElement { #private; static styles: import("lit").CSSResult[]; /** * Wires. Plain immutable objects; internally backed by the port graph. * Replaced immutably on every change, so identity can be compared. */ get edges(): readonly GraphEdge[]; set edges(value: readonly GraphEdge[]); /** Pan/zoom state of the viewport layer. */ viewport: Viewport; minZoom: number; maxZoom: number; /** `zoom`: the wheel zooms (ctrl/pinch always zooms). `pan`: the wheel pans. */ wheel: WheelMode; /** Snap radius for the magnet, in **screen** px. */ snapRadius: number; /** Allow a node to connect to itself. */ allowSelf: boolean; /** Reject connections that would create a cycle (node level). */ acyclic: boolean; /** * What a touch/pen drag on empty space does: `pan` (default) moves the * canvas, `select` draws a selection rectangle. Mouse always pans; hold * Shift to draw a rectangle instead. */ touchMode: TouchMode; /** Extra veto hook, on top of the built-in rules. */ isValidConnection: IsValidConnection | undefined; /** What starts moving a node: `node` (anywhere on it) or `handle` (only its title-bar grip). A node's own `drag-by` wins. */ dragBy: `node` | `handle`; /** `show` or `hide` the available (unconnected) ports of every node; a node's own `available-ports` wins. Hidden ones are revealed when a wire is dragged toward them, on tap, or on mouse hover. */ availablePorts: AvailablePorts; /** `rail`: inputs on the left edge, outputs on the right. `full`: every input then every output as a full-width row with its label and description. A node's own `port-layout` wins. */ portLayout: PortListLayout; /** `vertical`: ports on the left (in) and right (out) edges. `horizontal`: top (in) and bottom (out); `full` layout is then ignored. A node's own `port-location` wins. */ portLocation: PortLocation; /** Swaps the ends ports sit at (inputs right / bottom, outputs left / top), for flows that run right-to-left or bottom-to-top. A node's `flip-ports` also turns it on. */ flipPorts: boolean; /** Double-clicking a node's title bar collapses or expands it. Off by default; the `graph-node-title-dblclick` event fires either way, and `preventDefault()` on it stops the toggle. */ dblclickToggle: boolean; /** Drag from anywhere inside a node (not just a port) to start a wire, and drop anywhere on a node to finish one. */ easyConnect: boolean; /** Width (flow px) of the margin ring that still moves a node when `easy-connect` is on. */ easyConnectMargin: number; /** While dragging a node, offer a wire to the nearest node within this many flow px (`0` = off); it is made on drop. */ proximityConnect: number; /** Deleting a node in the middle of a flow reconnects what fed it to what it fed, where the rules allow. */ bridgeOnDelete: boolean; /** Opt-in: called when a wire is dropped on empty space. Return a node to add there (it is wired to the dragged port). */ nodeFactory: NodeFactory | undefined; private _gestureActive; private _spacePan; constructor(); connectedCallback(): void; disconnectedCallback(): void; protected firstUpdated(): void; protected willUpdate(changed: Map): void; protected updated(changed: Map): void; protected render(): import("lit").TemplateResult<1>; /** Plain-JSON snapshot of nodes (from the DOM) and edges. */ getGraph(): { nodes: { key: string; x: number; y: number; label: string; ports: PortInfo[]; }[]; edges: readonly GraphEdge[]; }; /** The port graph (source of truth for wires). Vertices are ports. */ getPortGraph(): index_d_exports$2.Directed.DirectedGraph; /** * The node graph: the port graph collapsed to node keys. Directly usable * as a `Graphs.Dependencies.DependencyGraph` (edges point in the direction * of data flow) for topological order, cycle detection and evaluation. */ getNodeGraph(): index_d_exports$2.Directed.DirectedGraph; /** * Connects two ports (either order), running the same rules and events as * a wire drag. Returns `false` when rejected or cancelled. */ connect(from: PortRef, to: PortRef): boolean; /** Removes a wire by id, firing the same events as a drag. */ disconnect(id: string): boolean; /** * The wires that cross a sub flow's boundary: `incoming` from nodes outside, `outgoing` to nodes * outside, and the `internal` ones. The sub flow is the group node and everything inside it. */ getSubflowEdges(groupKey: string): SubflowEdges; /** Every shown node's rectangle in flow coordinates, for layout algorithms. */ getNodeRects(): Array<{ key: string; rect: GraphRect; }>; /** Moves nodes (`x` / `y` as set on the node: relative to its parent) in one go, e.g. from a layout. Fires no events. */ setNodePositions(positions: Readonly>): void; /** What the last right-click landed on (valid while its menu is open, for handling `menu-command`). */ get contextTarget(): GraphContextMenuDetail | undefined; /** Sets the viewport (zoom is clamped) and emits `graph-viewport-change`. */ setViewport(v: Viewport): void; /** Pans/zooms so all nodes fit, with `padding` px margin. */ fitView(padding?: number): void; /** Client point → flow coordinates. */ screenToFlow(p: Point$1): Point$1; /** Flow point → client coordinates. */ flowToScreen(p: Point$1): Point$1; getViewState(options?: GetViewStateOptions): NodeGraphViewState; setViewState(state: NodeGraphViewState | null | undefined): void; /** No pending facets: selection and viewport are always live. */ clearPendingViewState(): void; } declare global { interface HTMLElementTagNameMap { 'ixfx-node-graph': NodeGraphElement; } } export interface NodeGraphElement { addEventListener(type: K, listener: (this: NodeGraphElement, event: NodeGraphElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } /** Which edge or corner of a node is being dragged. */ export type ResizeHandle = `n` | `s` | `e` | `w` | `ne` | `nw` | `se` | `sw`; export declare const RESIZE_HANDLES: readonly ResizeHandle[]; export type SizeLimits = { readonly minWidth: number; readonly minHeight: number; readonly maxWidth: number; readonly maxHeight: number; }; export declare function isResizeHandle(value: unknown): value is ResizeHandle; /** * The rectangle after dragging `handle` by (`dx`, `dy`) flow px, from the * rectangle at the start of the drag. Size is clamped to `limits`; dragging a * west/north edge moves the origin so the opposite edge stays put. */ export declare function resizeRect(start: GraphRect, handle: ResizeHandle, dx: number, dy: number, limits: SizeLimits): GraphRect; /** * Node outline shapes. `box` shapes are plain rounded rectangles and get a * real CSS border (any `border-style`). `polygon` shapes are clipped with * `clip-path`, so their border is drawn as a layered background instead * (solid colour only; thickness is approximate on non-square nodes). */ export type NodeShape = `rect` | `rounded` | `pill` | `circle` | `diamond` | `hexagon`; export type ShapeSpec = { readonly kind: `box`; readonly radius: string; } | { readonly kind: `polygon`; readonly clip: string; }; export declare const NODE_SHAPES: Readonly>; export declare function isNodeShape(value: unknown): value is NodeShape; /** The spec for a shape name; anything unknown (or empty) is `rounded`. */ export declare function shapeSpec(value: unknown): ShapeSpec; /** Fastest allowed blink, in Hz. Keeps a bad value from becoming a strobe. */ export declare const MAX_BLINK_HZ = 10; /** * Blink period in seconds for a rate in Hz, or `undefined` for "don't blink" * (zero, negative, non-finite or non-numeric rates). Rates above * `MAX_BLINK_HZ` are clamped. */ export declare function blinkPeriodSeconds(hz: unknown): number | undefined; /** * Proximity connect: while a node is dragged, the nearest other node within * `threshold` is offered as a connection, which is made on drop. */ type ProximityPair = { readonly from: PortInfo; readonly to: PortInfo; }; /** Distance between two rectangles' edges; `0` when they touch or overlap. */ export declare function rectGap(a: GraphRect, b: GraphRect): number; type ProximityQuery = { readonly dragged: string; readonly rects: ReadonlyArray<{ readonly key: string; readonly rect: GraphRect; }>; /** Maximum edge-to-edge distance, in flow px. */ readonly threshold: number; /** Nodes that must not be offered (e.g. the rest of the dragged selection). */ readonly exclude?: ReadonlySet; /** The best valid wire from one node to another, if any. */ readonly tryPair: (fromNode: string, toNode: string) => ProximityPair | undefined; }; /** * The wire to offer. Candidates are tried nearest first. For each, the node on * the left is the source (data flows left to right), then the other way round. */ export declare function findProximityConnection(q: ProximityQuery): ProximityPair | undefined; /** * Pure selection transitions for pointer presses and clicks. * Each returns the next selection, or `undefined` when nothing changes. */ export type SelectionState = { readonly nodes: ReadonlySet; readonly edges: ReadonlySet; }; /** * Pressing a node. `toggle` (Shift/Ctrl/Cmd) flips it in the selection; a * plain press on an unselected node selects only it. A plain press on an * already-selected node keeps the selection so the whole group can be dragged. */ export declare function selectionAfterNodePress(current: SelectionState, key: string, toggle: boolean): SelectionState | undefined; /** Clicking a wire: `toggle` flips it; otherwise it becomes the only selection. */ export declare function selectionAfterEdgeClick(current: SelectionState, edgeId: string, toggle: boolean): SelectionState; /** * Pure pan/zoom coordinate maths for the node graph. * * Flow coordinates are the stable coordinate space of the canvas: node `x`/`y` * and port offsets live there. Screen coordinates are client (page) px. The * mapping needs the pane's client-space origin (its top-left corner). * * `flow = (client − paneOrigin − viewport) / zoom` */ /** Client-space top-left corner of the pane element (`DOMRect.left/top`). */ export type PaneOrigin = Point$1; export declare function clampZoom(zoom: number, minZoom: number, maxZoom: number): number; /** Client point → flow point. */ export declare function screenToFlow(p: Point$1, v: Viewport, paneOrigin: PaneOrigin): Point$1; /** Flow point → client point. */ export declare function flowToScreen(p: Point$1, v: Viewport, paneOrigin: PaneOrigin): Point$1; /** * Zooms by `factor` keeping the flow point under `screenPoint` fixed on * screen — the canvas appears to grow out of the cursor. Result is clamped * to `[minZoom, maxZoom]`; when the clamp bites, the anchor point may drift * slightly rather than jump. */ export declare function zoomAt(v: Viewport, screenPoint: Point$1, paneOrigin: PaneOrigin, factor: number, minZoom: number, maxZoom: number): Viewport; /** Pans by a screen-space delta. */ export declare function panBy(v: Viewport, dx: number, dy: number): Viewport; /** Zoom clamping and margin for `fitBounds`. */ export type FitInput = { readonly padding: number; readonly minZoom: number; readonly maxZoom: number; }; /** * Computes the viewport that centres `bounds` (flow-space rectangle) in a * pane of the given client size, with `padding` px of margin. */ export declare function fitBounds(bounds: { readonly x: number; readonly y: number; readonly width: number; readonly height: number; }, paneWidth: number, paneHeight: number, options: FitInput): Viewport; /** Smallest flow-space rectangle covering all the given rects. */ export declare function boundsOf(rects: ReadonlyArray<{ readonly x: number; readonly y: number; readonly width: number; readonly height: number; }>): { x: number; y: number; width: number; height: number; }; /** The viewport that frames all `rects` in a pane of the given size (see {@link fitBounds}). */ export declare function fitRects(rects: ReadonlyArray<{ readonly x: number; readonly y: number; readonly width: number; readonly height: number; }>, pane: { readonly width: number; readonly height: number; }, options: FitInput): Viewport; /** The slice of `GraphPortElement` the controller drives (structural, for tests). */ interface WireDragPort { setDragState(state: `valid` | `invalid` | undefined): void; setMagnet(active: boolean, proximity: number): void; } type WireDragMode = `new` | `new-backward` | `detach`; /** A port eligible for snapping, in flow coordinates. */ type ValidCandidate = { readonly info: PortInfo; readonly el: WireDragPort; readonly pos: Point$1; }; type DragState = { readonly mode: WireDragMode; readonly pointerId: number; /** The fixed end of the preview wire. */ readonly anchor: PortInfo; /** Anchor port centre, in flow coordinates. */ readonly anchorFlow: Point$1; /** The picked-up wire (detach mode only). */ readonly originalEdge: GraphEdge | undefined; /** Port graph the drag commits into (original edge removed when detaching). */ readonly workingGraph: index_d_exports$2.Directed.DirectedGraph; readonly context: ConnectContext; /** Valid candidates that have a position, in flow coordinates. */ candidates: ValidCandidate[]; /** Every port the rules allow, positioned or not (tucked-away ports gain a position when revealed). */ readonly valid: ReadonlyArray<{ readonly info: PortInfo; readonly el: WireDragPort; }>; /** Every port element marked at drag start, for cleanup. */ readonly markedPorts: readonly WireDragPort[]; /** Ports with a proximity glow set, cleared when they fall out of range. */ readonly glowing: Set; pointerFlow: Point$1; client: Point$1; readonly startClient: Point$1; /** True once the pointer has moved past the drag threshold. */ moved: boolean; goal: Point$1; rendered: Point$1; snap: SnapTarget | undefined; }; type WireDragConfig = { readonly getPane: () => HTMLElement | undefined; readonly getPaneRect: () => DOMRect | undefined; readonly getViewport: () => Viewport; readonly getSnapRadius: () => number; readonly getRulesOptions: () => ConnectionRulesOptions; readonly getPortGraph: () => index_d_exports$2.Directed.DirectedGraph; readonly getNodeGraph: () => index_d_exports$2.Directed.DirectedGraph; readonly getAcyclic: () => boolean; /** Port info for a port element, resolving its node key. */ readonly portInfoFor: (portEl: WireDragPort & { readonly key?: string; }) => PortInfo | undefined; /** Port info for a port ref, for edges' stored refs. */ readonly portInfoForSource: (ref: PortRef) => PortInfo | undefined; /** Every port element in the graph. */ readonly allPorts: () => readonly WireDragPort[]; /** Cached port offset (flow, node-relative) for a node/port pair. */ readonly portOffset: (nodeKey: string, portKey: string) => PortOffset | undefined; /** Node position (flow) of a node key. */ readonly nodePosition: (nodeKey: string) => Point$1 | undefined; readonly setGestureActive: (active: boolean) => void; /** Commits a new port graph and fires `graph-edges-change`. */ readonly commitEdges: (g: index_d_exports$2.Directed.DirectedGraph) => void; /** Cancelable `graph-connect`. Returns `false` when cancelled. */ readonly requestConnect: (edge: GraphEdge, replaces: GraphEdge | undefined) => boolean; /** Cancelable `graph-disconnect`. Returns `false` when cancelled. */ readonly requestDisconnect: (edges: readonly GraphEdge[], reason: DisconnectReason) => boolean; /** `graph-connect-end`: a wire dropped on empty space. */ readonly emitConnectEnd: (from: PortRef, point: Point$1, client: Point$1) => void; /** Easy connect: dropping anywhere on a node snaps to its best valid port. */ readonly getEasyConnect?: () => boolean; /** Called with the pointer (flow coordinates) on every move of a wire drag, so tucked-away ports near it can be revealed. */ readonly onApproach?: (p: Point$1, client: Point$1) => void; /** The topmost node containing a flow-space point. */ readonly nodeAt?: (p: Point$1) => string | undefined; /** Re-render (preview path / edge visibility). */ readonly invalidate: () => void; readonly prefersReducedMotion: () => boolean; }; export declare class WireDragController { #private; constructor(config: WireDragConfig); /** While a wire is being dragged: its state, else `undefined`. */ get state(): Readonly | undefined; /** Edge id hidden while its loose end is dragged (detach mode). */ get detachedEdgeId(): string | undefined; /** Preview path (flow coordinates), or `undefined` when not dragging. */ get previewPath(): string | undefined; get active(): boolean; onPointerDown(e: PointerEvent, info: PortInfo): boolean; /** Call after a port was revealed or moved: positions are measured again, so newly visible ports become targets. */ relayout(): void; onPointerMove(e: PointerEvent): void; onPointerUp(e: PointerEvent): boolean; onPointerCancel(_e: PointerEvent): boolean; /** Escape pressed mid-drag: abort, restoring a detached wire. */ abort(): void; } export type NotificationType = `info` | `warning` | `error`; export type NotificationContent = { readonly type: NotificationType; readonly message: string; readonly icon?: string; readonly onTap?: (id: string) => void; }; export type Notification = NotificationContent & { readonly id: string; readonly createdAt: number; readonly updatedAt: number; }; export interface NotificationRendererHooks { onTap: (id: string) => void; } export interface NotificationRenderer { /** Called once when this renderer becomes active. */ attach: (hooks: NotificationRendererHooks) => void; /** Called once if this renderer is swapped out for another at runtime. */ detach?: () => void; /** * The manager's full, ranked view of currently-visible notifications * (index 0 = oldest/first, the one closest to eviction/dismissal). * Never longer than `queueSize`, since the manager evicts overflow itself. */ setNotifications: (notifications: Notification[], queueSize: number) => void; } export type NotifierOptions = { renderer?: NotificationRenderer; timeout?: number; timeoutError?: number; queue?: boolean; queueSize?: number; tapBehaviour?: `none` | `dismiss`; tapHandlerDefault?: (notification: Notification) => void; }; /** A notification as remembered by a manager's history. */ export type NotificationHistoryEntry = Notification & { /** `true` once read: via `markRead`/`markAllRead`, or when the user taps the toast. */ readonly read: boolean; /** Set once the toast is no longer visible (timed out, evicted, tapped away or dismissed). */ readonly dismissedAt?: number; }; export type NotificationHistoryListener = (history: readonly NotificationHistoryEntry[]) => void; /** Options for `createNotificationManager` / `NotificationManager.scope`. */ export type NotificationManagerOptions = NotifierOptions & { /** Max history entries kept per manager (oldest dropped first). Default 100. */ historyLimit?: number; }; /** * An independent notification manager: its own queue, timers, renderer, * options and history. `NotificationManager` is the default, app-wide * instance; create more with `createNotificationManager()` (or * `NotificationManager.scope(name)`) to show toasts next to the component * they concern. */ export type NotificationManagerInstance = { configure: (opts: NotificationManagerOptions) => void; notify: (content: NotificationContent) => string; update: (id: string, content: Partial) => void; dismiss: (id: string) => void; dismissAll: () => void; /** Remembered notifications, oldest first. Includes ones no longer visible. */ getHistory: () => readonly NotificationHistoryEntry[]; /** Number of history entries not yet read. Drives a bell indicator. */ readonly unreadCount: number; markRead: (id: string) => void; markAllRead: () => void; clearHistory: () => void; /** Called with the full history whenever it changes (new, updated, read, dismissed, cleared). Returns an unsubscribe function. */ subscribe: (listener: NotificationHistoryListener) => () => void; /** Dismiss everything, drop history and listeners, detach the renderer. The instance is unusable afterwards. */ destroy: () => void; }; export declare function createNotificationManager(initial?: NotificationManagerOptions): NotificationManagerInstance; /** * The default, app-wide manager. Also a registry of named, independent * scopes: `NotificationManager.scope('lister-1', { renderer })`. */ export declare const NotificationManager: NotificationManagerInstance & { /** * Get (creating on first use, with `opts`) the independent manager for `name`. * `opts` are ignored if the scope already exists; call `.configure()` on it instead. */ scope: (name: string, opts?: NotificationManagerOptions) => NotificationManagerInstance; /** Destroy and forget a named scope (e.g. when its component unmounts). */ releaseScope: (name: string) => void; }; export type PillTapDetail = { readonly id: string; }; export type PillTapEvent = CustomEvent; export interface NotificationPillElementEventMap { 'pill-tap': PillTapEvent; } export declare class NotificationPillElement extends LitElement { #private; notificationType: NotificationType; message: string; icon?: string; dismissing: boolean; notificationId: string; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-notification-pill': NotificationPillElement; } } export interface NotificationPillElement { addEventListener: ((type: K, listener: (this: NotificationPillElement, event: NotificationPillElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } export type PillPosition = `top-left` | `top-middle` | `top-right` | `bottom-left` | `bottom-middle` | `bottom-right`; export type PillQueueDisplay = `list` | `stack`; export interface PillSafeArea { readonly top?: number; readonly right?: number; readonly bottom?: number; readonly left?: number; } export interface PillRendererOptions { position?: PillPosition; /** `list`: one row per message, oldest nearest the anchor edge. `stack`: only the front message is fully shown, the rest peek out behind it. Default `list`. */ queueDisplay?: PillQueueDisplay; /** Extra margin (px) added to the default spacing on each side, letting pills avoid eg. a fixed header/footer/notch. */ safeArea?: PillSafeArea; /** * Render the toasts in the browser's top layer (via the Popover API), so they * appear above modal `` backdrops and other popovers regardless of any * `z-index`. Each time a new toast arrives the container is re-promoted, so a * dialog opened after earlier toasts doesn't keep covering later ones. * Browsers without the Popover API silently fall back to normal stacking. * * Caveat: a modal dialog makes the rest of the page inert, including toasts, so * they show above it but can't be clicked until it closes (timed dismissal is * unaffected). Default `true`. Set `false` to manage stacking yourself with `zIndex`. */ topLayer?: boolean; /** * `z-index` for the toast layer when `topLayer` is `false`. Ignored otherwise. * Leave unset to take no part in z-ordering. */ zIndex?: number; } export declare function createPillRenderer(options?: PillRendererOptions): NotificationRenderer; export type PanelGroupOrientation = `horizontal` | `vertical`; export interface PanelGroupReorderDetail { readonly fromIndex: number; readonly toIndex: number; readonly panel: PanelElement; } export type PanelGroupReorderEvent = CustomEvent; export interface PanelGroupElementEventMap { reorder: PanelGroupReorderEvent; } /** * Pure helper: nearest gap index for a pointer position along one axis. * `edges` are the [start, end] of each sibling (excluding the drag source), * in DOM order. Returns 0..edges.length. */ export declare function panelGapIndex(edges: ReadonlyArray, pos: number): number; export declare class PanelGroupElement extends LitElement { orientation: PanelGroupOrientation; variant: PanelVariant; toggleInteraction: PanelToggleInteraction; collapsible: boolean; accordion: boolean; allowReorder: boolean; /** * Pin each panel's titlebar to the top (or left, for vertical titlebars) of the scroll area * while its content is in view. On by default; set `sticky-headers="false"` to disable. */ stickyHeaders: boolean; /** Explicit gap between panels. When unset, `--group-gap` (falling back to `--space-l`) controls the gap. */ gap?: string; private _panels; private _dragState; private _suppressNextClick; private _onPanelToggle; connectedCallback(): void; disconnectedCallback(): void; protected firstUpdated(): void; protected updated(changed: Map): void; private _propagateAll; private _onSlotChange; private _onClickCapture; private _onKeyDown; /** * Walk composedPath for the nearest ixfx-panel, requiring the press to have * gone through an ixfx-titlebar (titlebar-anywhere drag). Bails when the * path crosses interactive chrome (buttons/links/inputs/toolbar/caret/close) * so those controls always win over dragging. */ private _findDragTarget; private _onPointerDown; private _onPointerMove; private _onPointerUp; private _onPointerCancel; private _beginDrag; private _abortDrag; private _endDrag; private _commitDrag; private _createGhost; /** * Nearest panel gap to the pointer, ignoring the drag source. * The perpendicular axis is ignored — the pointer always resolves to a gap. */ private _computeGapIndex; private _computeCaretStyle; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { 'ixfx-panel-group': PanelGroupElement; } } export interface PanelGroupElement { addEventListener: ((type: K, listener: (this: PanelGroupElement, event: PanelGroupElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } export type ColourMode = `fixed` | `opacity` | `hue` | `saturation` | `lightness` | `scale`; export type ColourMapConfig = { mode: ColourMode; /** Parsed colours for 'scale' mode. Must have ≥ 2 entries. */ palette: string[]; /** ixfx easing name — applied before the colour mode mapping. Takes precedence over valueMap. */ easingName: string; /** Custom value mapping fn (0..1 → 0..1). Used when easingName is empty. */ valueMap: ((v: number) => number) | null; }; export type ColourResult = { fill: string; opacity: number; }; /** Read the resolved --plot-color CSS variable from an element. */ export declare function readBaseColour(el: Element): string; /** Parse a comma-separated colour string attribute into an array. Falls back to default palette. */ export declare function parseColourScaleAttr(attr: string): string[]; /** * Compute the fill colour and opacity for a single data point. * @param scaledValue Normalised value in 0..1 (data range for single-axis; age fraction for xy). * @param baseColour Resolved base colour string (from --plot-color). * @param config Colour map configuration. */ export declare function computeColour(scaledValue: number, baseColour: string, config: ColourMapConfig): ColourResult; /** * Apply xy-axis age-style modification on top of a base ColourResult. * 'size' is not handled here — the caller adjusts the radius separately. */ export declare function applyAgeModification(base: ColourResult, ageFraction: number, ageStyle: string): ColourResult; export type PlotDataSeriesOptions = { /** * Limit of how many data points to store. * Default: 100 */ capacityLimit: number; /** * If _true_, it maintains the same scale over its lifetime. * If _false_, scale adjusts based on items in its cache. * * Default: true */ persistentScaling: boolean; fixedRange: { min: number; max: number; } | null; }; /** * A data series */ export declare class PlotDataSeries { #private; values: number[]; /** * Constructor. * * Default options: * - `capacityLimit`: 100 * - `persistentScaling`: true * - `fixedRange`: null * @param options */ constructor(options?: Partial); /** * Sets a manual range, this disabled auto-scaling. * Use {@link unsetRange} to re-enable auto-scaling. * @param min * @param max */ setRange(min: number, max: number): void; /** * Disable the manual range */ unsetRange(): void; get isAutoRange(): boolean; /** * Adds a single value * @param valueOrValues Value to add */ add(valueOrValues: number | number[]): void; /** * Sets the entire data series at once, replacing any existing data. If the number of values exceeds the `capacityLimit`, only the most recent values up to the limit are kept. * @param values */ set(values: number[]): void; /** * Returns the manual range if this is in effect, or the automatic */ get range(): { min: number; max: number; }; /** * Clear all data and reset range. If `persistentScaling` is _false_, also resets scaling to initial state. * @returns _true_ if there was data to clear */ clear(): boolean; } export type SingleAxisDrawStyle = `line-sharp` | `line-round` | `circles` | `squares` | `vbar` | `hbar` | `hist-bottom` | `hist-top` | `hist-middle`; export type SingleAxisAgeStyle = `none` | `opacity` | `desaturation` | `size`; /** * PlotSingleAxis * * Adding data: * - add(value: number): adds a single value to the end of the data series. * - set(values: number[]): replaces the entire data series at once. */ export declare class PlotSingleAxis extends LitElement { #private; drawStyle: SingleAxisDrawStyle; ageStyle: SingleAxisAgeStyle; title: string; precise: boolean; tooltips: boolean; capacity: number; rangeMin: number; rangeMax: number; persistentScale: boolean; paused: boolean; clickPauses: boolean; shaded: boolean; areaColor: string; colorMode: ColourMode; colorEasing: string; colorScale: string; /** Custom value-mapping function (0..1 → 0..1). Ignored when color-easing is set. */ colorValueMap: ((v: number) => number) | null; private _width; private _height; /** Override to customize tooltip label. */ valueFormat: (v: number | undefined) => string; /** * Adds a value to the data series. * * Pass `withholdRedraw = true` to prevent automatic redraw after adding the value. In this case, call `redraw()` manually after adding all values to update the plot. * * Use {@link set} to replace the entire data series at once. * @param valueOrValues Single value, or several values * @param withholdRedraw If _false_ (default) plot is automatically redrawn */ add(valueOrValues: number | number[], withholdRedraw?: boolean): void; /** * Redraws the plot. * Normally not needed, unless add() is called with withholdRedraw = true, or styleSeries() is used to update series styles. */ redraw(): void; /** * Sets the entire data for a series at once, replacing contents. * * Use add() to add values one by one. * * Pass `withholdRedraw = true` to prevent automatic redraw after setting the values. In this case, call `redraw()` manually after setting the values to update the plot. * @param values Values * @param withholdRedraw If _false_ (default) plot is automatically redrawn */ set(values: number[], withholdRedraw?: boolean): void; /** * Clears all data and redraws */ clear(): boolean; protected firstUpdated(_changed: PropertyValues): void; protected updated(changed: PropertyValues): void; get series(): PlotDataSeries; /** * Get all values in the data series as a readonly array. */ get values(): readonly number[]; /** * Get length of data series */ get dataLength(): number; /** * Get value at specific index of data series * @param index */ getValueAt(index: number): number | undefined; /** * Get value index based on client X position * @param clientX */ getIndexFromClientX(clientX: number): number; render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } export type PlotSingleAxisPointerMoveDetail = { readonly clientX: number; readonly clientY: number; readonly index: number; }; export type PlotSingleAxisPointerMoveEvent = CustomEvent; export interface PlotSingleAxisElementEventMap { 'plot-pointer-move': PlotSingleAxisPointerMoveEvent; 'plot-pointer-leave': Event; } declare global { interface HTMLElementTagNameMap { 'ixfx-plot-single-axis': PlotSingleAxis; } } export interface PlotSingleAxis { addEventListener: { (type: K, listener: (this: PlotSingleAxis, event: PlotSingleAxisElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; }; } export type PlotMultiAxisLayout = `overlap` | `horizontal` | `vertical` | `grid`; export type PlotMultiAxisDataPointClickDetail = { readonly value: number; readonly index: number; readonly series: string; }; export type PlotMultiAxisDataPointClickEvent = CustomEvent; export interface PlotMultiAxisElementEventMap { 'plot-datapoint-click': PlotMultiAxisDataPointClickEvent; } export declare class PlotMultiAxis extends LitElement { #private; layout: PlotMultiAxisLayout; gridMinWidth: number; /** Override to customize tooltip value display. */ valueFormat: (v: number | undefined) => string; /** * Adds a single data point * @param name Series name * @param value Value * @param witholdRedraw If _false_ (default) plot is automatically redrawn */ addData(name: string, value: number, witholdRedraw?: boolean): PlotSingleAxis; setData(name: string, values: number[], witholdRedraw?: boolean): PlotSingleAxis; setObjects(data: Record, witholdRedraw?: boolean): void; /** * Calls redraw() on all subplots. */ redraw(): void; /** * Adds a record of data points to the plot. Each key in the record corresponds to a series name, and its value is added as a data point to that series. If a series does not exist for a given key, it will be created. * @param data Data to add * @param witholdRedraw If _false_ (default) plot is automatically redrawn after adding the data. If _true_, plot is not redrawn automatically, and you need to call `redraw()` manually to update the plot after adding the data. */ addObject(data: Record, witholdRedraw?: boolean): void; /** * Styles a series by setting CSS variables on the subplot. * @param name Name of series * @param styles Styles to apply */ styleSeries(name: string, styles: Record): void; /** * Clears data from all sub-plots * @returns _True_ if there was data to clear */ clear(): boolean; /** * Clears data from a given series * @param name Series name * @returns _True_ if series was found and had data */ clearSeries(name: string): boolean; /** * Returns a copy of the series names */ get series(): string[]; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { 'ixfx-plot-multi-axis': PlotMultiAxis; } } export interface PlotMultiAxis { addEventListener: { (type: K, listener: (this: PlotMultiAxis, event: PlotMultiAxisElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; }; } export type PlotHistogramOrientation = `horizontal` | `vertical`; /** * - `hover`: floating `ixfx-tooltip` bubble, shown/hidden with a debounce delay. * - `inline`: the title overlay-text switches to the hovered bucket's value, instantly. * - `none`: no hover feedback. */ export type PlotHistogramValueTooltips = `hover` | `inline` | `none`; export type PlotHistogramInteractionMode = `inspect` | `select`; export type PlotHistogramBucketClickDetail = { readonly bucketIndex: number; readonly valueMin: number; readonly valueMax: number; readonly relativeValue: number; }; export type PlotHistogramBucketClickEvent = CustomEvent; /** * A bar-range selection. `null` on both fields means "no selection". * - `barIndices` — inclusive bucket indices (`start` ≤ `end`). * - `dataValues` — the value span those buckets cover (`min` is the low edge of * the first bucket, `max` the high edge of the last). */ export type PlotHistogramSelectionRange = { readonly barIndices: { readonly start: number; readonly end: number; } | null; readonly dataValues: { readonly min: number; readonly max: number; } | null; }; export type PlotHistogramSelectionChangeDetail = PlotHistogramSelectionRange & { /** * `false` while the pointer is still dragging out the range; `true` once the * drag is released, and for `setSelection()` / `clearSelection()`. */ readonly committed: boolean; }; export type PlotHistogramSelectionChangeEvent = CustomEvent; export interface PlotHistogramElementEventMap { 'plot-bucket-click': PlotHistogramBucketClickEvent; 'plot-selection-change': PlotHistogramSelectionChangeEvent; } export declare class PlotHistogram extends LitElement { #private; orientation: PlotHistogramOrientation; resolution: number; min?: number; max?: number; capacity: number; /** * Fallback overlay-text, shown when nothing is hovered. * Not reflected to the native `title` attribute, so the browser's own hover tooltip doesn't show. */ title: string; paused: boolean; /** How hovering a bucket is communicated: a floating tooltip, the inline overlay-text, or nothing. */ valueTooltips: PlotHistogramValueTooltips; /** Delay (ms) before the `hover` tooltip appears/disappears. Switching directly between buckets is instant. */ tooltipDelay: number; /** Max rate (ms) at which an already-shown value display refreshes to match live-changing bucket data. */ valueUpdateInterval: number; /** Interaction mode: 'inspect' for hover tooltips, 'select' for click-drag selection. */ interactionMode: PlotHistogramInteractionMode; /** Override to customize the value/frequency label used by the tooltip and overlay text. */ valueFormat: (valueMin: number, valueMax: number, frequency: number) => string; private _width; private _height; private _hoveredIndex; private _inlineOverlayText; private _coloredRangeMin; private _coloredRangeMax; private _selectionStart; private _selectionEnd; private _isDragging; private _selectionOverlayText; add(v: number): void; set(values: number[]): void; clear(): void; setColoredRange(min: number, max: number): void; clearColoredRange(): void; setSelection(startBarIndex: number, endBarIndex: number): void; clearSelection(): void; getSelectedRange(): PlotHistogramSelectionRange; protected firstUpdated(_changed: PropertyValues): void; protected updated(changed: PropertyValues): void; disconnectedCallback(): void; render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { 'ixfx-plot-histogram': PlotHistogram; } } export interface PlotHistogram { addEventListener: ((type: K, listener: (this: PlotHistogram, event: PlotHistogramElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } export type XyDrawStyle = `circles` | `squares`; export type XyAgeStyle = `none` | `opacity` | `desaturation` | `size`; export declare class PlotXyAxis extends LitElement { #private; drawStyle: XyDrawStyle; ageStyle: XyAgeStyle; title: string; precise: boolean; tooltips: boolean; capacity: number; persistentScale: boolean; paused: boolean; clickPauses: boolean; colorMode: ColourMode; colorEasing: string; colorScale: string; /** * Custom value-mapping fn (0..1 → 0..1). For xy-axis the input is the point's ageFraction * (0 = oldest, 1 = newest). Ignored when color-easing is set. */ colorValueMap: ((v: number) => number) | null; private _width; private _height; /** Override to customize tooltip label. */ valueFormat: (x: number, y: number) => string; add(x: number, y: number): void; setXY(xs: number[], ys: number[]): void; clear(): void; protected firstUpdated(_changed: PropertyValues): void; protected updated(changed: PropertyValues): void; render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { 'ixfx-plot-xy-axis': PlotXyAxis; } } declare const PolarPad_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer); export declare class PolarPad extends PolarPad_base { static styles: import("lit").CSSResult[]; /** Current angle in degrees. 0 = right, increases clockwise. */ angle: number; /** Current radius 0–1. 0 = origin, 1 = edge. */ radius: number; /** Number of concentric rings to display. 0 = none. */ rings: number; /** Number of evenly-spaced radial spoke lines to display. 0 = none. */ rays: number; /** Show a line from origin to the marker. */ showRay: boolean; /** Show a dot at the origin (centre). */ showOrigin: boolean; /** Hide cursor during drag and hover. */ hideCursor: boolean; /** When set, marker snaps to nearest ring/spoke depending on what's displayed. */ snapValue: boolean; /** Disable all interaction (pointer and keyboard). */ disabled: boolean; /** Number of quantised stops for both angle and radius. Overridden by stops-angle/stops-radius if set. */ stops?: number; /** Number of quantised stops for angle. If set, overrides the stops setting for angle. */ stopsAngle?: number; /** Number of quantised stops for radius. If set, overrides the stops setting for radius. */ stopsRadius?: number; /** Explicit keyboard nudge step for angle (degrees). Overrides the 10% default. */ stepAngle?: number; /** Explicit keyboard nudge step for radius (0..1 units). Overrides the 10% default. */ stepRadius?: number; private _dragging; private _dragStartAngle; private _dragStartRadius; private _pressedKeys; private _prevAngle; private _prevRadius; private _onPointerDown; private _onPointerMove; private _onPointerUp; private _updateFromPointer; private _onKeyDown; private _onKeyUp; private _handleKeyboardMove; /** * Apply a radius nudge by direction. Wheel affects radius only (matches the * keyboard `ArrowUp`/`ArrowDown` semantic per `plans/mousewheel.md`); the * angle is unchanged. */ private _stepRadiusByDelta; _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void; private _setCssVars; updated(_changed: PropertyValues): void; disconnectedCallback(): void; private _renderRings; private _renderSpokes; private _renderRay; private _renderOrigin; render(): ReturnType; /** Stable per-instance uid for SVG clipPath IDs. */ private readonly _uid; } export type PolarPadInputDetail = { readonly angle: number; readonly radius: number; }; export type PolarPadInputEvent = CustomEvent; declare global { interface HTMLElementTagNameMap { 'ixfx-polar-pad': PolarPad; } } declare const RangeInput_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer); export declare class RangeInput extends RangeInput_base { min: number; max: number; value: number; step: number; orientation: `horizontal` | `vertical`; swipeable: boolean; tooltip: boolean; tooltipOrientation: TooltipOrientations; labelFormatter?: (rawValue: number, scaledValue: number) => string; _inputEl: HTMLInputElement; _tooltipEl?: TooltipElement | null; /** True if this slider changed its value during the current pointer visit. */ private _swipeModified; connectedCallback(): void; disconnectedCallback(): void; private _valueFromPointer; private _applySwipeValue; private _onPointerDown; private _onPointerMove; private _onPointerEnter; private _onPointerLeave; private _onWindowPointerUp; updated(changedProperties: Map): void; _handleInput: (e: Event) => void; _formatTooltipLabel(): string; _handleChange: () => void; /** * Wheel handler — installed by WheelNudgeMixin on the host. Synthesises a * value change by writing to the inner `` and dispatching * `input` + `change`, so the existing `_handleInput` and `_handleChange` * handlers run unchanged and re-bubble the events to listeners. * * Native wheel handling is left intact for the focused-inner-input case; * the host listener fires under `lighttouch` or when focus is on the host. */ _applyWheelDelta(direction: WheelDirection, _event: WheelEvent): void; render(): import("lit").TemplateResult<1>; static styles: CSSResultGroup; } declare global { interface HTMLElementTagNameMap { 'ixfx-range-input': RangeInput; } } export type Endpoints = `a` | `b`; export type CrossoverBehaviour = `stop` | `allow`; export type ResizeMode = `dual` | `none` | `bipolar` | `bipolar-flex`; export type RangeMultiInputDetail = { readonly a: number; readonly b: number; readonly changed: `a` | `b` | `both`; }; export type RangeMultiInputEvent = CustomEvent; /** * * Attributes * crossover: How thumbs can cross over. Default: 'allow' ('allow'/'stop') * a/b: Initial A/B values on 0...100 scale * step: Increments of input on 0...100 scale. Use 'any' for maximum precision. Default: 1 (number|'any') * tooltip: Whether tooltip is shown. Default: true (boolean) * tooltip-orientation: Orientation of tooltip if used. Default: 'top' ('top'|'right') * * CSS variables * --range-background: AccentColor * --range-height: 1.5em; * --range-thickness: 1em; * --thumb-background: ButtonFace; * --thumb-radius: 50%; * --thumb-width: 1em; * --thumb-height: 1em; */ export declare class RangeMultiElement extends LitElement { #private; tooltip: boolean; tooltipOrientation: TooltipOrientations; crossover: CrossoverBehaviour; resizeMode: ResizeMode; orientation: `horizontal` | `vertical`; step: number | `any`; a: number; b: number; set max(v: number); get max(): number; set min(v: number); get min(): number; valuesAtPointerDown: undefined | { a: number; b: number; }; draggingThumb: `a` | `b` | `none`; _onInput(event: Event): void; setPoles(a: number, b: number): void; _onPointerDown(event: PointerEvent): false | undefined; protected firstUpdated(_changedProperties: PropertyValues): void; protected render(): unknown; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { "ixfx-range-multi": RangeMultiElement; } } declare const RangeElement_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer); export declare class RangeElement extends RangeElement_base { #private; tooltip: boolean; tooltipOrientation: TooltipOrientations; orientation: `horizontal` | `vertical`; disabled: boolean; min: number; max: number; set value(v: number); get value(): number; step: number; onRangeInput(event: InputEvent): void; /** * Wheel handler — installed by WheelNudgeMixin on the host. Synthesises a * value change by writing to the inner `` and dispatching * `input` + `change`, so the existing `onRangeInput` handler runs unchanged. * * The native input still responds to wheel when focused (focus rule wins by * default). The host handler fires when `lighttouch` is set or when the host * itself has focus, ensuring Shift-aware step math and consistent event firing. */ _applyWheelDelta(direction: WheelDirection, _event: WheelEvent): void; protected render(): unknown; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementMap { "ixfx-range": RangeElement; } } export type RatingVariant = `star` | `square` | `heart`; export type RatingChangeDetail = Readonly<{ value: number; oldValue: number; }>; export type RatingChangeEvent = CustomEvent; export type RatingInputEvent = CustomEvent; export interface RatingElementEventMap { change: RatingChangeEvent; input: RatingInputEvent; } export declare class RatingElement extends LitElement { static styles: import("lit").CSSResult[]; value: number; max: number; allowHalf: boolean; disabled: boolean; readonly: boolean; variant: RatingVariant; private _preview; connectedCallback(): void; protected updated(changed: Map): void; private _path; private _effective; private _commit; private _calc; protected render(): import("lit").TemplateResult<1>; firstUpdated(): void; } declare global { interface HTMLElementTagNameMap { 'ixfx-rating': RatingElement; } } export interface IxfxRatingElement { addEventListener: ((type: K, listener: (this: RatingElement, ev: RatingElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); removeEventListener: ((type: K, listener: (this: RatingElement, ev: RatingElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void); } export type SelectHorizChangeDetail = { readonly selectedIndex: number; readonly selectedItem: HTMLElement | null; readonly selectedValue: string | null; }; export type SelectHorizChangeEvent = CustomEvent; export interface SelectHorizEventMap { change: SelectHorizChangeEvent; } declare global { interface HTMLElementTagNameMap { 'ixfx-select-horiz': SelectHorizElement; } } export interface SelectHorizElement { addEventListener: ((type: K, listener: (this: SelectHorizElement, event: SelectHorizEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } declare const SelectHorizElement_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer); export declare class SelectHorizElement extends SelectHorizElement_base { static styles: import("lit").CSSResult[]; private _selectedIndex; private _slottedItems; private tickled; get selectedIndex(): number; set selectedIndex(value: number); get selectedValue(): string | null; set selectedValue(value: string | null); get selectedItem(): HTMLElement | null; get items(): HTMLCollection; protected render(): import("lit").TemplateResult<1>; willUpdate(changed: Map): void; private _onSlotChange; private _syncTickled; private _findSlottedItem; private _handlePointerOver; private _handleKeyDown; private _applyTickledSelection; private _wheelCooldown; _applyWheelDelta(direction: WheelDirection, _event: WheelEvent): void; private _handleClick; private _updateSelectedAttribute; private _scrollSelectedIntoView; private _emitChange; } /** * Type definitions for shapefill-value component */ export type ShapefillDisplay = `rectangle` | `circle`; export type ShapefillFillMode = `centre` | `left` | `right`; export interface ShapefillValueInputDetail { value: number; valueRelative: number; } export interface ShapefillValueChangeDetail { value: number; valueRelative: number; previousValue: number; } export type ShapefillValueInputEvent = CustomEvent; export type ShapefillValueChangeEvent = CustomEvent; declare const ShapefillValueElement_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer); export declare class ShapefillValueElement extends ShapefillValueElement_base { #private; /** * Formats the text written to `data-tooltip` when `data-tooltip-live` is * set. Receives the value (min..max units) and its relative position (0..1). * Defaults to a rounded percentage. */ tooltipFormatter?: (value: number, relative: number) => string; display: ShapefillDisplay; fillMode: ShapefillFillMode; value: number; min: number; max: number; step: number | undefined; stops?: number; disabled: boolean; _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void; render(): unknown; protected updated(changed: PropertyValues): void; disconnectedCallback(): void; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-shapefill-value': ShapefillValueElement; } } /** * Digit-roll direction. * - `auto` — inferred from whether the value went up or down (default) * - `up` / `down` — force the reels to always spin one way * - `none` — take the shortest path */ export type SlidingNumberTrend = `auto` | `up` | `down` | `none` | `increasing` | `decreasing`; /** * `ixfx-sliding-number` — an animated number readout. When `value` changes each * digit rolls vertically to its new figure (odometer / slot-machine style), * digits that appear or disappear slide + fade, and the whole thing stays lined * up on the decimal point. * * Inspired by [NumberFlow](https://number-flow.barvian.me/): configurable * timings, a `trend` to bias roll direction, decimal alignment, and `::part()` * hooks for styling. * * ```html * * * ``` * * ### CSS variables * | Variable | Default | Purpose | * |---|---|---| * | `--sliding-number-spin-duration` | `0.7s` | Time for a digit reel to roll | * | `--sliding-number-spin-easing` | `cubic-bezier(.16,1,.3,1)` | Easing for the roll | * | `--sliding-number-transform-duration` | `0.5s` | Time for digits to slide in/out as the number grows/shrinks | * | `--sliding-number-transform-easing` | `cubic-bezier(.16,1,.3,1)` | Easing for that slide | * | `--sliding-number-opacity-duration` | `0.35s` | Fade time for entering/leaving digits | * | `--sliding-number-digit-width` | `1ch` | Column width of a single digit | * * ### Parts * `prefix`, `suffix`, `number`, `integer`, `fraction`, `digit`, `symbol`. */ export declare class SlidingNumberElement extends LitElement { /** The number to display. */ value: number; /** BCP-47 locale(s) passed to `Intl.NumberFormat`. */ locales: string | undefined; /** * `Intl.NumberFormat` options. As an attribute, pass JSON: * `format='{"style":"currency","currency":"USD"}'`. */ format: Intl.NumberFormatOptions | undefined; /** Static text shown before the number. */ prefix: string; /** Static text shown after the number. */ suffix: string; /** Which way the digit reels roll. */ trend: SlidingNumberTrend; /** Add the `no-animate` attribute to render every change instantly. */ noAnimate: boolean; /** Honour `prefers-reduced-motion: reduce` (default `true`; set the property to `false` to override). */ respectMotionPreference: boolean; private _cells; private _formatted; private _ready; private _prevValue; private _pendingSpins; private _pendingDir; private _reelAnims; private _reapTimer; connectedCallback(): void; disconnectedCallback(): void; private _motionOK; private _timing; private _numberFormat; private _resolveDir; /** Split the formatted value into positioned cells. */ private _buildCells; protected willUpdate(changed: PropertyValues): void; protected updated(): void; private _spin; private _renderCell; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { 'ixfx-sliding-number': SlidingNumberElement; } } export type SnackbarMode = `explicit` | `manual` | `implicit`; export type SnackbarPlacement = `top` | `bottom` | `left` | `right`; export type SnackbarDismiss = `auto` | `manual`; /** * `ixfx-snackbar` is itself the popover panel (`popover="auto"` set on the host) - * unlike `ixfx-menu-trigger`/`ixfx-colour-picker-popup` there's no separate always-visible * trigger living inside the component to keep out of the top layer; the trigger is the * external `for` target, so the whole host can be the popover content. */ export declare class SnackbarElement extends LitElement { for: string; mode: SnackbarMode; placement: SnackbarPlacement; dismiss: SnackbarDismiss; showDelay: number; hideDelay: number; private _isOpen; private _recentCloseAt; private readonly _anchorName; private _target; private _addedTabindex; private _addedRole; private _showTimeout; private _hideTimeout; private readonly _onTargetClick; private readonly _onTargetKeydown; private readonly _onTickleIn; private readonly _onTickleOut; private readonly _onPanelClick; private readonly _onToggle; private readonly _onBeforeToggle; get isOpen(): boolean; show(): void; hide(): void; toggle(): void; connectedCallback(): void; disconnectedCallback(): void; updated(changed: Map): void; private _resolveTarget; private _attachToTarget; private _detachFromTarget; private _scheduleShow; private _scheduleHide; private _cancelShow; private _cancelHide; static styles: import("lit").CSSResult[]; protected render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-snackbar': SnackbarElement; } } export type SnapLogic = `centre` | `balanced`; export type ClickSnapMode = `closest` | `step`; export declare class SnapContainer extends LitElement { static styles: import("lit").CSSResult; orientation: `horizontal` | `vertical`; snapPositions: number; snapLogic: SnapLogic; clickSnap: `closest` | `step`; snap: number; private _dragging; private _dragStart; private _dragThreshold; private _thresholdReached; private _currentDragIndex; private _child; private get _isHorizontal(); private _getChild; private _computeSnapPositions; private _getSnapIndex; private _clampChildPosition; private _updateChildPosition; private _onPointerDown; private _onPointerMove; private _onPointerUp; private _onKeyDown; firstUpdated(): void; updated(changedProperties: Map): void; render(): ReturnType; } export type SnapChangeDetail = { readonly previousSnap: number; readonly newSnap: number; }; export type SnapChangeEvent = CustomEvent; export type SnapInputDetail = { readonly index: number; }; export type SnapInputEvent = CustomEvent; declare global { interface HTMLElementTagNameMap { 'ixfx-snap-container': SnapContainer; } } export declare function buildModel(rootEl: HTMLElement): GroupNode; export declare function normalise(group: GroupNode): GroupNode; export interface DistributeResult { sizesPx: number[]; belowMin: number[]; } export declare function distribute(sizesPx: number[], gutterIndex: number, deltaPx: number, constraints: Array<{ minPx: number; maxPx: number | null; fixedPx: number | null; whenSmall: WhenSmall; }>): DistributeResult; export declare function resolveTracks(group: GroupNode, _containerPx: number): string; export declare function toSnapshot(group: GroupNode): LayoutSnapshot; export declare function applySnapshot(group: GroupNode, snapshot: LayoutSnapshot): GroupNode; export declare function setPanelRestoreWeight(group: GroupNode, id: string, restoreWeight: number): GroupNode; export declare function preserveRestoreWeights(previous: GroupNode | null, next: GroupNode): GroupNode; export declare function findPanelNode(group: GroupNode, id: string): PanelNode | undefined; export declare function walk(group: GroupNode, visitor: (node: LayoutNode, path: number[]) => void): void; /** * Value accessor — returns the magnitude of a node, branches included. * * A child's arc is its share of its parent's value: * `child / max(parent, Σ siblings)`. When children sum to less than their * parent, the remainder shows as an unfilled gap — which is what makes * progressively-arriving data fill in visibly. When they sum to more, they're * scaled to fit. * * Return `undefined` (or a negative / non-finite number) for "unknown": the * node then uses the sum of its loaded children's values, or `1` for a leaf * or not-yet-loaded node. * * Default: `item => item.weight`. */ export type SunburstValueAccessor = (item: TreeItem, node: TreeNode) => number | undefined; /** Formats a node's value for the centre readout. */ export type SunburstValueFormatter = (value: number, node: TreeNode) => string; /** * Pointer/keyboard gesture mapping (subset of `TreeInteractionMode`). * - `'implicit'` — click selects + zooms; single selection follows the pointer. * - `'standard'` — click selects + zooms; Ctrl/Cmd+click toggles, Shift+click range-selects. * - `'manual'` — click only zooms; selection is driven via `select()`/`deselect()`/`clearSelection()`. * * `checked` is deliberately unsupported — a checkbox per arc does not hold up * at small arc sizes. */ export type SunburstInteractionMode = `implicit` | `standard` | `manual`; /** * A node positioned in the absolute (unzoomed) layout produced by * `computeSunburstLayout()`. Angles are fractions of a full turn, clockwise * from 12 o'clock; the true root spans `0..1`. */ export type SunburstLayoutNode = { /** Key path from the true root, joined with {@link SUNBURST_PATH_SEPARATOR}. */ readonly id: string; readonly node: TreeNode; readonly parentId: string | undefined; /** Depth from the true root (root is `0`). */ readonly depth: number; /** Start angle, fraction of a turn (0–1). */ readonly x0: number; /** End angle, fraction of a turn (0–1). */ readonly x1: number; /** Resolved value (accessor result, or fallback). */ readonly value: number; /** 0-based position among siblings. */ readonly index: number; /** Number of siblings (for `aria-setsize`). */ readonly setSize: number; readonly hasChildren: boolean; }; /** Absolute layout, keyed by id, in ring-major (breadth-first) order. */ export type SunburstLayout = ReadonlyMap; export type ComputeSunburstLayoutOptions = { valueAccessor?: SunburstValueAccessor; /** * Deepest absolute depth (root is `0`) to lay out. Nodes below it get no * position. Defaults to no limit. */ maxDepth?: number; }; /** * The zoom window the absolute layout is projected through: the zoom node's * angular span becomes the full circle, and its depth becomes the centre. */ export type SunburstView = { readonly x0: number; readonly x1: number; /** Absolute depth of the zoom node. */ readonly depth: number; }; /** * Everything that's animated about one arc, in screen terms. Interpolated * per frame between the displayed state and the target state. */ export type SunburstArcVisual = { /** Start angle, fraction of a turn (0–1) of the zoomed view. */ readonly a0: number; /** End angle, fraction of a turn (0–1) of the zoomed view. */ readonly a1: number; /** * Ring index relative to the zoom node: `0` is the first ring, `-1` the * centre disc, `≤ -2` collapsed into the centre. Fractional mid-animation. */ readonly depth: number; /** Hue offset in degrees (added to `--sunbursttree-hue-start`). */ readonly hue: number; /** Sibling-position tone offset, `-0.5..0.5`. */ readonly shade: number; readonly opacity: number; }; /** Ring geometry in SVG user units (CSS px). */ export type SunburstRings = { /** Radius of the centre disc. */ readonly center: number; /** Width of each ring. */ readonly ring: number; }; /** Where to draw an arc's label, if it fits. */ export type SunburstLabelPlacement = { readonly kind: `straight`; readonly x: number; readonly y: number; /** Rotation in degrees, applied about (x, y). */ readonly rotate: number; readonly text: string; } | { readonly kind: `curved`; /** Guide path for ``: an arc along the ring's middle, drawn so text reads upright. */ readonly path: string; readonly text: string; }; /** Ids are key paths; keys only need to be unique among siblings. */ export declare const SUNBURST_PATH_SEPARATOR = ""; /** Default accessor: the shared `TreeItem.weight` field. */ export declare const defaultSunburstValueAccessor: SunburstValueAccessor; /** Id of the child `key` under `parentId`. */ export declare function sunburstChildId(parentId: string, key: string): string; /** Join a key path (root key first) into an id. */ export declare function sunburstPathToId(path: readonly string[]): string; /** True when `ancestorId` is a strict ancestor of `id`. */ export declare function isSunburstAncestorId(ancestorId: string, id: string): boolean; /** Split an id back into its key path. */ export declare function sunburstIdToPath(id: string): string[]; /** Parent id, or `undefined` for the root id. */ export declare function sunburstParentId(id: string): string | undefined; /** Resolve an id (key path from the root, root key included) to a node. */ export declare function findSunburstNodeById(root: TreeNode | undefined, id: string): TreeNode | undefined; /** * Depth-first search for the first node matching `predicate`. Returns its id * (root key included), or `undefined`. */ export declare function findSunburstId(root: TreeNode | undefined, predicate: (node: TreeNode) => boolean): string | undefined; /** * Returns a memoised resolver for node values: the accessor's value when * valid, else the sum of loaded children, else `1`. */ export declare function createValueResolver(accessor: SunburstValueAccessor): (node: TreeNode) => number; /** True when `node` may have children (loaded or loadable). */ export declare function sunburstHasChildren(node: TreeNode): boolean; /** * Compute the absolute layout of the whole (loaded) tree. The root spans the * full turn at depth `0`; each child spans * `parentSpan × value / max(parentValue, Σ siblingValues)`, packed from the * parent's start angle in sibling order. Returned in ring-major order. */ export declare function computeSunburstLayout(root: TreeNode | undefined, options?: ComputeSunburstLayoutOptions): SunburstLayout; /** * Pure helpers behind `ixfx-sunbursttree-list` view state. Arcs are * identified by key *path* (keys need only be unique among siblings), so live * selection follows its path across data changes; saved keys — which are * bare `item.key`s — resolve to the first node, depth-first, carrying them. * See `docs/infra-view-state.md`. */ /** `ixfx-sunbursttree-list` view state: `selected`, `focus`, plus the zoom path. */ type SunburstViewState = ViewStateBase & { /** * Keys from the root's children down to the centre node; `[]` = the full * tree. A path because keys are only unique among siblings, and so a * lazily-loaded tree can be opened down to it, one load at a time. */ readonly zoom?: readonly string[]; }; /** Fired when the zoom root changes. `node` is `undefined` on zoom-out to the full tree. */ export type SunburstZoomDetail = { readonly node: TreeNode | undefined; /** Absolute depth of the zoom node (root's children are depth 0); `-1` when fully zoomed out. */ readonly depth: number; }; export type SunburstZoomEvent = CustomEvent; export interface SunburstTreeListElementEventMap extends TreeComponentEventMap { 'select': TreeSelectEvent; 'tickle': TreeTickleEvent; 'activate': TreeActivateEvent; 'item-click': TreeItemClickEvent; 'item-dblclick': TreeItemDblClickEvent; 'expand': TreeExpandEvent; 'collapse': TreeCollapseEvent; 'zoom': SunburstZoomEvent; } /** * `ixfx-sunbursttree-list` — a zoomable sunburst over weighted tree data. * * The zoom node is the centre disc; each ring outward is one generation, * each arc's angle its share of its parent's value. Every data, weighting or * zoom change animates from what's on screen to the new layout. Hues come * from the ring around the centre; descendants take tones of their * first-ring ancestor's hue. * * Implements `TreeComponent`. Deliberate differences from `ixfx-tree-list`: * - **Expand/collapse is reinterpreted as zoom.** `expand` fires on zoom-in, * `collapse` on zoom-out. * - **`interactionMode` drops `checked`**; **`exclusivity` is ignored**. * - **`filterPredicate` dims** non-matching arcs instead of hiding them. * - **Reassigning `root` keeps zoom and selection** where the same key paths * still exist, so streamed or immutably-rebuilt data animates in place. */ export declare class SunburstTreeListElement extends LitElement implements TreeComponent, TreeSearchHost { #private; static shadowRootOptions: { delegatesFocus: boolean; clonable?: boolean; customElementRegistry?: CustomElementRegistry | null; mode: ShadowRootMode; serializable?: boolean; slotAssignment?: SlotAssignmentMode; }; root: TreeNode | undefined; model: TreeDataModel | undefined; /** Callback to lazily load children for a node. Superseded by `model` when both are set. */ loadChildren: LoadChildrenCallback | undefined; /** Accepted for `TreeComponent` compatibility but ignored. */ exclusivity: TreeExclusivity; selectionFilter: TreeSelectionFilter; /** Gesture mapping. `checked` is unsupported. */ interactionMode: SunburstInteractionMode; /** How many rings render around the centre. */ maxDepth: number; /** Radius of the centre disc as a fraction of the overall radius (0–0.9). */ centerRatio: number; /** Arcs whose outer edge is shorter than this (px) aren't drawn. */ minArcLength: number; /** Hide in-arc labels (the centre readout still shows). */ disableLabels: boolean; /** * Curve labels to follow their ring (``) instead of drawing them * straight. Arcs too narrow for that still get straight radial labels. */ curvedLabels: boolean; /** Duration (ms) of data, weighting and zoom transitions. `0` snaps. Respects `prefers-reduced-motion`. */ animationDuration: number; /** * Node value. Swap it to change weighting scheme — the chart animates to * the new layout without rebuilding anything. Default: `item.weight`. * See `SunburstValueAccessor` for how missing values fall back. */ valueAccessor: SunburstValueAccessor; /** Formats values for the centre readout. */ valueFormatter: SunburstValueFormatter; selectedNode: TreeNode | undefined; private _selectedNodes; get selectedNodes(): ReadonlySet; filterPredicate: TreeFilterPredicate | undefined; disableKeyboardNavigation: boolean; registry: CommandRegistry | undefined; /** Space-separated subset of `navigate select filter`. See `docs/infra-incremental.md`. */ searchModes: string | undefined; /** Current zoom root. `undefined` when showing the full tree. Pure view-state. */ get focusedNode(): TreeNode | undefined; /** Id (key path) of the zoom node; `undefined` = the true root. */ private _zoomId; /** * Whether restoring a saved zoom may call `loadChildren` / `model` to load * the nodes along its path (one at a time). Default `true`. */ restoreLoads: boolean; private _size; readonly search: ListSearchController<{ node: TreeNode; depth: number; }>; private tickled; /** Set by every update request except animation frames — triggers a re-layout. */ private _layoutDirty; private _ticking; requestUpdate(...args: Parameters): void; connectedCallback(): void; disconnectedCallback(): void; protected willUpdate(changed: PropertyValues): void; protected updated(changed: PropertyValues): void; /** * Snapshot selection, zoom path and keyboard cursor as plain JSON, keyed by * `item.key`. Includes pending state for keys not currently loaded. */ getViewState(options?: GetViewStateOptions): SunburstViewState; /** * Apply saved view state. Fields present replace the current ones; keys * that aren't loaded yet are applied as they appear — including via * `loadChildren` / `model` down a saved zoom path when `restoreLoads`. */ setViewState(state: Partial): void; clearPendingViewState(): void; select(node: TreeNode): void; deselect(node: TreeNode): void; clearSelection(): void; selectAll(): void; deselectAll(): void; selectMany(nodes: Iterable): void; /** * Zoom so `node` becomes the centre, its children the first ring. Fires * `zoom` and `expand` (or `collapse` when `node` is an ancestor of the * current centre). Pure view-state — `root` is never mutated. */ zoomTo(node: TreeNode): void; /** Zoom out one level: the centre's parent becomes the centre. */ zoomUp(): void; /** Zoom all the way out to the full tree. */ zoomOut(): void; /** Zoom to reveal the node at `keys` (path from the root's children), then select it. */ navigateTo(keys: readonly string[]): boolean; /** Zoom + select the first node (depth-first) matching `predicate`. */ navigateToNode(predicate: (node: TreeNode) => boolean): boolean; /** Zoom to reveal the first node with `key` and move the cursor to it, without selecting. */ revealKey(key: string): boolean; /** Arcs currently drawn (centre excluded), ring-major, depth from the root's children. */ getNodes(): ReadonlyArray<{ node: TreeNode; depth: number; }>; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-sunbursttree-list': SunburstTreeListElement; } } export interface SunburstTreeListElement { addEventListener: ((type: K, listener: (this: SunburstTreeListElement, event: SunburstTreeListElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); removeEventListener: ((type: K, listener: (this: SunburstTreeListElement, event: SunburstTreeListElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void); } export type SwipeInputDetail = { readonly value: number; }; export type SwipeInputEvent = CustomEvent; export interface SwipeElementEventMap { input: SwipeInputEvent; } export interface SwipeElement { addEventListener: ((type: K, listener: (this: SwipeElement, event: SwipeElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } declare global { interface HTMLElementTagNameMap { 'ixfx-swipe': SwipeElement; } } declare const SwipeElement_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer); export declare class SwipeElement extends SwipeElement_base { #private; barSpacing: number; barWidth: number; debounceMs: number; retractDurationMs: number; private _startX; private _currentX; private _pointerId; private _componentWidth; private _isDragging; private _offset; private _width; private _height; private _animRafId; private _debounceTimer; private _animStartOffset; private _animStartTime; private _resizeObserver; /** * Wheel handler — installed by WheelNudgeMixin on the host. Emits `input` * synchronously on each tick (matching the user-confirmed "mirror drag" * semantic) and schedules the same retraction animation the drag releases * with, so the visual resets after a short idle. * * Step size: 10% of the [-1, 1] value range (= 0.1). Shift halves to 0.05. */ _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void; connectedCallback(): void; disconnectedCallback(): void; private _onPointerDown; private _onPointerMove; static styles: CSSResultGroup; render(): ReturnType; } export declare class TabPanelElement extends LitElement { render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { "ixfx-tab-panel": TabPanelElement; } } export declare class TabPanelsElement extends LitElement { #private; _listItems: TabPanelElement[]; /** * Triggered when a panel is being de-selected */ onUnselectedPanel?: (id: string, el: TabPanelElement) => void; /** * Triggered before panel is selected */ onSelectingPanel?: (id: string, el: TabPanelElement) => void; /** * Triggered after panel is selected */ onSelectedPanel?: (id: string, el: TabPanelElement) => void; render(): import("lit").TemplateResult<1>; getSelectedElement(): TabPanelElement | undefined; syncWithList(el: TabListElement): void; selectPanel(id: string): boolean | undefined; /** * Select a tab as if the user clicked it — activates the matching header in * the associated `ixfx-tab-list` (deactivating the others) and shows its * panel. * * `nameOrTitle` may be the label text of a tab (e.g. `'Home'`, matched * case-insensitively) or the panel id its `for` attribute points at * (e.g. `'panel-home'`). If no tab matches, `nameOrTitle` is tried directly * as a panel id. * * The tab list must first be associated via `syncWithList()` for the header * to be activated; panel selection works regardless. * * Returns true if a panel was found and selected. */ selectTab(nameOrTitle: string): boolean; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { "ixfx-tab-panels": TabPanelsElement; } } /** A single tab managed by a {@link TabController}. */ export type Tab = { /** id of the `ixfx-tab-list-item` */ readonly id: string; /** id of the `ixfx-tab-panel` (the item's `for` value) */ readonly forId: string; readonly item: TabListItemElement; readonly panel: TabPanelElement; label: string; iconName?: string; }; export type TabAddOptions = { label: string; /** id for the tab item; derived from the label if omitted */ id?: string; /** id for the panel (and the item's `for`); derived from the label if omitted */ forId?: string; iconName?: string; description?: string; closeable?: boolean; /** Elements to slot into the tab's `slot="toolbar"` */ toolbar?: HTMLElement[]; /** Panel content: a node, text, or a callback given the fresh panel element */ content?: Node | string | ((panel: TabPanelElement) => void); /** Select the new tab immediately (default `true`) */ select?: boolean; /** Insertion index among existing tabs (default: append) */ index?: number; }; export type TabControllerOptions = { /** * When provided, a command is registered per tab (id = tab id). Invoking * `commands.invoke(id)` selects the tab. */ commands?: CommandRegistry; /** Fired after a tab becomes selected (via click or programmatic select) */ onSelect?: (tab: Tab, previous: Tab | undefined) => void; onAdd?: (tab: Tab) => void; onRemove?: (tab: Tab) => void; onReorder?: (tabs: Tab[]) => void; }; /** * Connects an `ixfx-tab-list` to an `ixfx-tab-panels` container, handling the * wiring between them (header clicks show the matching panel, closing a tab * removes its panel, etc.) and offering an API to select, add, remove, rename * and reorder tabs. * * @example * ```ts * const ctrl = new TabController( * document.querySelector('ixfx-tab-list'), * document.querySelector('ixfx-tab-panels'), * ); * ctrl.connect(); * * ctrl.addTab({ label: 'Console', content: 'Console panel' }); * ctrl.selectTab('Console'); * ``` */ export declare class TabController { #private; constructor(list: TabListElement, panels: TabPanelsElement, options?: TabControllerOptions); connect(): void; disconnect(): void; /** * Select a tab as if it was clicked — activates the header (deactivating the * others) and shows its panel. * * `sel` may be a tab id, the panel id its `for` points at, its label text * (case-insensitive), or the tab item element itself. * * Returns true if a tab was found. */ selectTab(sel: string | TabListItemElement): boolean; selectNext(): boolean; selectPrevious(): boolean; getSelected(): Tab | undefined; getTabs(): Tab[]; getTab(id: string): Tab | undefined; addTab(opts: TabAddOptions): Tab; removeTab(sel: string | TabListItemElement): boolean; renameTab(sel: string | TabListItemElement, label: string): boolean; setTabIcon(sel: string | TabListItemElement, iconName?: string): boolean; } /** A tag as displayed in the list. */ type TagItem = { /** Unique (case-insensitive) identity of the tag. */ readonly value: string; /** Display text. Defaults to `value`. */ readonly label?: string; /** * Indeterminate tags represent "some of the data has this tag". Tapping one * turns it on (requires `editing` to allow adding). */ readonly indeterminate?: boolean; }; /** Tags and options may be given as plain strings or as full items. */ type TagInput = string | TagItem; /** An item of the suggestion list shown when adding a tag. */ type TagOption = string | { readonly value: string; readonly label?: string; }; /** * What the user may change: * - `readonly`: nothing * - `delete`: remove tags only * - `add`: add tags only (includes turning indeterminate tags on) * - `all`: add and remove */ type TagEditing = `readonly` | `delete` | `add` | `all`; /** * How tags are deleted: * - `button`: a small 'X' after each tag * - `menu`: tapping a tag opens a popover with Delete (and Rename, when * `editing="all"` and `allow-new` are set) */ type TagDeleteMode = `button` | `menu`; type TagValidationContext = { /** `add` for a newly typed tag, `rename` when an existing tag is being renamed. */ readonly kind: `add` | `rename`; /** The tag's current value, when renaming. */ readonly previous?: string; /** The tags currently shown. */ readonly tags: readonly TagItem[]; }; /** * Checks a typed-in tag name (already trimmed). Return `true` (or nothing) to * accept it, `false` to reject it, or a string to reject it with that message. * Empty and (when renaming) duplicate names are rejected before this is called. * Tags picked from `options` are not validated. */ type TagValidator = (value: string, context: TagValidationContext) => boolean | string | null | undefined; type TagAddDetail = { readonly value: string; readonly label: string; /** True if the tag was typed in rather than picked from the options. */ readonly isNew: boolean; }; type TagRemoveDetail = { readonly value: string; }; type TagRenameDetail = { readonly from: string; readonly to: string; }; type TagActivateDetail = { readonly value: string; }; type TagChangeDetail = { readonly tags: readonly TagItem[]; }; type TagAddEvent = CustomEvent; type TagRemoveEvent = CustomEvent; type TagActivateEvent = CustomEvent; type TagRenameEvent = CustomEvent; type TagChangeEvent = CustomEvent; interface TagListElementEventMap { 'tag-add': TagAddEvent; 'tag-remove': TagRemoveEvent; 'tag-activate': TagActivateEvent; 'tag-rename': TagRenameEvent; 'change': TagChangeEvent; } /** * — shows tags as a wrapping horizontal flow, and lets the user * add and remove them. * * Attributes: * editing — "all" (default) | "add" | "delete" | "readonly" * delete-mode — "button" (default; an X after each tag) | "menu" (tapping a tag opens a popover with Delete, and Rename when editing="all" and allow-new) * allow-new — let the user type tags that are not in `options` * search-placeholder — placeholder text of the add-tag search box * * Properties: * tags — tags shown: strings or { value, label?, indeterminate? } * options — suggestions offered when adding: strings or { value, label? } * validate — (value, { kind, previous, tags }) => true | false | error message; applied to typed-in new tags and renames * * Events: * tag-add — { value, label, isNew } * tag-remove — { value } * tag-activate — { value }: an indeterminate tag was tapped and is now on * tag-rename — { from, to } * change — { tags } after any of the above * * CSS custom properties: * --tag-list-gap, --tag-list-height, --tag-list-radius, --tag-list-bg, * --tag-list-text, --tag-list-indeterminate-text */ export declare class TagListElement extends LitElement { editing: TagEditing; deleteMode: TagDeleteMode; allowNew: boolean; searchPlaceholder: string; tags: readonly TagInput[]; options: readonly TagOption[]; validate: TagValidator | undefined; private _items; private _addOpen; private _query; private _cursor; private _menuTarget; private _menuMode; private _renameText; private _addPopup; private _menuPopup; private _input; private _search; private _available; private _menuAnchor; private get _canAdd(); private get _canDelete(); private get _canRename(); private get _menuDelete(); protected willUpdate(changed: PropertyValues): void; private _emit; private _commitTags; private _addTag; private _activate; private _remove; /** * Checks a typed-in tag name (new or renamed) and returns an error message, or * undefined if it's fine. `renaming` is the tag being renamed, which may keep its own name. */ private _check; private _rename; private _show; private _hide; private _openAdd; private _closeAdd; private _onAddToggle; private _openMenu; private _releaseMenuAnchor; private _closeMenu; private _onMenuToggle; private _menuDeleteClick; private _menuRenameClick; private _onRenameInput; private _onRenameKeydown; private _commitRename; private _rows; private _commitRow; private _onSearchInput; private _onSearchKeydown; protected updated(): void; private _onTagClick; private _onTagContextMenu; private _onTagKeydown; private _renderTag; private _renderLabel; private _renderAddPopup; private _renderMenuPopup; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-tag-list': TagListElement; } } export interface TagListElement { addEventListener(type: K, listener: (this: TagListElement, event: TagListElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void; addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void; } /** * `ixfx-text-shimmer` — a label whose text is dimmed at rest, with a band of * brighter colour that sweeps horizontally across it on a loop. Useful as a * lightweight "still working…" indicator (as seen in Claude Code / Codex). * * Content comes from the `text` property, or failing that the default slot: * ```html * * Reticulating splines… * ``` * * CSS variables (set on the element or an ancestor): * | Variable | Default | Purpose | * |---|---|---| * | `--text-shimmer-color` | `var(--surface-3-text)` | Resting / base text colour | * | `--text-shimmer-gradient-color` | `var(--surface-2-text)` | Colour of the moving highlight | * | `--text-shimmer-duration` | `2s` | Time for one sweep | * | `--text-shimmer-spread` | `15%` | Half-width of the highlight band along the sweep track (larger = wider, softer) | * * Add the `paused` attribute to stop the sweep and show flat base colour. * Respects `prefers-reduced-motion`. */ export declare class TextShimmerElement extends LitElement { /** Text to display. When empty, the default slot is used instead. */ text: string; /** When set, the sweep stops and the text shows flat base colour. */ paused: boolean; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { 'ixfx-text-shimmer': TextShimmerElement; } } export type TimelineTrack = { readonly key: string; readonly label: string; readonly color?: string; readonly hidden?: boolean; readonly height?: number; }; export type TimelineEvent = { readonly id: string; readonly trackKey: string; readonly start: number; readonly end: number; readonly label?: string; readonly color?: string; readonly data?: unknown; }; export type ViewRange = { min: number; max: number; }; export type GridMode = `adaptive` | `fixed`; export type GridResolution = { majorStep: number; minorDivisions: number; minorStep: number; }; export type TrackHeightMode = `none` | `fixed` | `free`; export type UserScale = `x-wide` | `wide` | `normal` | `slim` | `x-slim` | string; export type TrackLayout = { trackKey: string; y: number; height: number; }; export type DragTarget = { kind: `none`; } | { kind: `event-move`; eventId: string; originTrackKey: string; offsetX: number; } | { kind: `event-start`; eventId: string; } | { kind: `event-end`; eventId: string; } | { kind: `marquee`; startLogicalX: number; startY: number; currentLogicalX: number; currentY: number; } | { kind: `track-reorder`; trackKey: string; ghostY: number; } | { kind: `axis-zoom`; anchorUnit: number; startScreenX: number; startScreenY: number; startViewMin: number; startPpu: number; } | { kind: `v-axis-zoom`; anchorBaseY: number; startScreenX: number; startScreenY: number; startVMin: number; startVMax: number; startVScale: number; }; export type TimelineEventMoveDetail = { readonly eventId: string; readonly fromTrackKey: string; readonly toTrackKey: string; readonly start: number; readonly end: number; }; export type TimelineEventResizeDetail = { readonly eventId: string; readonly start: number; readonly end: number; }; export type TimelineSelectionChangeDetail = { readonly selectedIds: readonly string[]; }; export type TimelineTrackReorderDetail = { readonly keys: readonly string[]; }; export type TimelineTrackSelectDetail = { readonly trackKey: string; readonly shiftKey: boolean; }; export type TimelineTrackResizeDetail = { readonly trackKey: string; readonly height: number; }; export type TimelineTickleChangeDetail = { readonly event: TimelineEvent | null; }; export type TimelineDraggingCallbackDetail = { readonly eventId: string; readonly rawLogicalX: number; readonly rawY: number; readonly currentStart: number; readonly currentEnd: number; readonly currentTrackKey: string; readonly gridResolution: GridResolution; readonly originTrackKey: string; }; export type DragSnappingFn = (detail: TimelineDraggingCallbackDetail) => { start?: number; end?: number; trackKey?: string; }; export type TimelineDraggingDetail = { readonly eventId: string; readonly start: number; readonly end: number; readonly trackKey: string; readonly rawLogicalX: number; readonly rawY: number; readonly originTrackKey: string; }; export type TimelineEventMoveEvent = CustomEvent; export type TimelineEventResizeEvent = CustomEvent; export type TimelineSelectionChangeEvent = CustomEvent; export type TimelineTrackReorderEvent = CustomEvent; export type TimelineTrackSelectEvent = CustomEvent; export type TimelineTrackResizeEvent = CustomEvent; export type TimelineTickleChangeEvent = CustomEvent; export type TimelineDraggingEvent = CustomEvent; export interface TimelineElementEventMap { 'event-move': TimelineEventMoveEvent; 'event-resize': TimelineEventResizeEvent; 'selection-change': TimelineSelectionChangeEvent; 'track-reorder': TimelineTrackReorderEvent; 'track-select': TimelineTrackSelectEvent; 'track-resize': TimelineTrackResizeEvent; 'tickle-change': TimelineTickleChangeEvent; 'dragging': TimelineDraggingEvent; } /** * Configuration for the TimelineController external adapter. */ export type TimelineControllerConfig = { readonly logicalMin: number; readonly logicalMax: number; readonly labelFormatter?: (value: number) => string; readonly gridResolver?: (viewRange: ViewRange, userScale: UserScale) => GridResolution; }; /** * Minimal interface the controller expects from the timeline element. * Avoids coupling to the concrete element class. */ type TimelineHost = { formatLabel: (v: number) => string; setViewRange: (r: ViewRange) => void; min: number; max: number; userScale: string; getTrackEvents: (trackKey: string) => TimelineEvent[]; get selectedIds(): readonly string[]; set selectedIds(ids: readonly string[]); addEventListener: (type: string, listener: EventListener) => void; removeEventListener: (type: string, listener: EventListener) => void; }; /** * External adapter class that can configure a timeline element * with musical time, custom label formatting, etc. * * The controller has no import of any timeline element type. * Users create a controller, pass it the component instance, * and the controller calls the component's public API. */ export declare class TimelineController { #private; constructor(timeline: TimelineHost, config: TimelineControllerConfig); /** Update the tempo (BPM) for musical time calculations. */ setTempo(bpm: number): void; /** Update the time signature for musical time calculations. */ setTimeSignature(numerator: number, denominator: number): void; /** Set the visible view range on the timeline. */ setViewRange(range: ViewRange): void; /** Clean up any resources held by the controller. */ dispose(): void; } type CssVars = Record; type Rect = { x: number; y: number; width: number; height: number; }; /** * Dispatch to adaptive or fixed grid mode. */ export declare function resolveGrid(viewRange: ViewRange, userScale: UserScale, viewportWidth: number, mode?: GridMode, fixedMinorStep?: number, ppu?: number): GridResolution; export declare function resolveCssVars(host: HTMLElement): CssVars; /** * A single track tab in the timeline's left margin. * Displays the track label, optional drag handle for reordering, * and handles vertical resize via bottom-edge drag. * * Fires: * - `track-resize-move` (composed, bubbles) — live preview during drag * - `track-resize` (composed, bubbles) — final value on pointerup * * Both carry `TimelineTrackResizeDetail` in their `detail`. */ export declare class TimelineTrackTabElement extends LitElement { #private; static styles: import("lit").CSSResult[]; label: string; trackKey: string; selected: boolean; reorderable: boolean; resizable: boolean; connectedCallback(): void; disconnectedCallback(): void; protected render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-timeline-track-tab': TimelineTrackTabElement; } } type VCanvasElement$1 = HTMLElement & { logicalWidth: number; logicalHeight: number; logicalScrollLeft: number; logicalScrollTop: number; viewportWidth: number; viewportHeight: number; drawCallback: ((ctx: CanvasRenderingContext2D, region: Rect, signal: AbortSignal) => void) | null; invalidateAll: () => void; invalidateRegion: (x: number, y: number, w: number, h: number) => void; convertFromViewportToCanvas: (x: number, y: number) => { x: number; y: number; }; convertFromCanvasToViewport: (x: number, y: number) => { x: number; y: number; }; }; export declare class IxfxTimelineElement extends LitElement { #private; static styles: import("lit").CSSResult[]; tracks: TimelineTrack[]; events: TimelineEvent[]; min: number; max: number; trackHeight: TrackHeightMode; userScale: UserScale; reorderable: boolean; metaEnabled: boolean; altMajorBg: boolean; defaultTrackHeight: number; gridMode: GridMode; minorStep: number; onDragging: DragSnappingFn | null; /** Set by TimelineController — formats logical value to label string */ formatLabel: (v: number) => string; /** * _ppu (pixels per unit) is the PRIMARY horizontal zoom state. * _viewRange.min is the PRIMARY horizontal pan state. * _viewRange.max is DERIVED: min + viewportWidth / _ppu. */ _ppu: number; _viewRange: ViewRange; /** * Vertical zoom/pan state. Analogous to horizontal: * - _vViewRange is in "base height units" (pre-scale track pixels). * - _vScale = viewportHeight / (b - a). When range spans all base height, all tracks fit. * - _vScrollOffset = _vViewRange.min * _vScale — the pixel offset applied to content. */ _vViewRange: ViewRange; _vScale: number; _selectedIds: Set; _tickledId: string | undefined; _drag: DragTarget; _metaHeight: number; _trackHeightOverrides: Map; _trackLayout: TrackLayout[]; _internalEvents: TimelineEvent[]; _internalTracks: TimelineTrack[]; /** Pixels per logical unit — the zoom level */ get pxPerUnit(): number; /** Height of the axis header band in pixels */ get axisHeight(): number; /** Width of the track tab area in pixels (from --timeline-tab-width CSS var) */ get tabWidth(): number; /** Set the zoom level (pixels per logical unit) */ setPpu(ppu: number): void; /** * Set the view range. ppu is back-computed from the span. * Use for programmatic view changes (e.g. TimelineController). */ setViewRange(range: ViewRange): void; /** * Set zoom + pan atomically. Used by axis-zoom interaction. * viewMin is the left edge in timeline units; ppu is the new zoom level. */ setZoomPan(viewMin: number, ppu: number): void; /** * Set vertical zoom + pan atomically. Used by v-axis-zoom interaction. * vMin/vMax define the vertical view range in base-height units. */ setVerticalZoomPan(vMin: number, vMax: number): void; selectAll(): void; deselectAll(): void; getTrackEvents(trackKey: string): TimelineEvent[]; get selectedIds(): readonly string[]; set selectedIds(ids: readonly string[]); selectTrack(key: string, shiftKey?: boolean): void; /** Resets all track height overrides to the default height and resets vertical zoom. */ resetTrackHeights(): void; /** Default no-op snapping - no modification of drag values */ static defaultDragSnapping: DragSnappingFn; /** Grid-snapping - snaps start/end to nearest minor gridline */ static gridSnapping: DragSnappingFn; /** * Called by timeline-interactions during drag. * Applies onDragging callback if set, then fires 'dragging' event. * Returns constrained values. */ processDrag(eventId: string, rawLogicalX: number, rawY: number, currentStart: number, currentEnd: number, currentTrackKey: string, originTrackKey: string, gridResolution: GridResolution): { start: number; end: number; trackKey: string; }; /** Returns the vcanvas element (for timeline-interactions) */ getVCanvas(): VCanvasElement$1 | null; /** Returns the currently hovered (tickled) event, or null if none. */ get tickledEvent(): TimelineEvent | null; protected firstUpdated(): void; disconnectedCallback(): void; /** * willUpdate runs before render — safe to set @state() properties here * without triggering an additional update cycle. All state derivation * (internal copies, track layout, vertical zoom) happens here. */ protected willUpdate(changedProps: PropertyValues): void; /** * updated runs after render — for DOM side-effects only (syncing vcanvas, * scrolling, invalidating canvas, dispatching events). */ protected updated(changedProps: PropertyValues): void; protected render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-timeline': IxfxTimelineElement; } } export interface IxfxTimelineElement { addEventListener: ((type: K, listener: (this: IxfxTimelineElement, event: TimelineElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } type VCanvasElement = HTMLElement & { convertFromViewportToCanvas: (x: number, y: number) => { x: number; y: number; }; viewportWidth: number; viewportHeight: number; logicalScrollTop: number; invalidateAll: () => void; invalidateRegion: (x: number, y: number, w: number, h: number) => void; }; /** * Attaches pointer and keyboard interaction handlers to the timeline. * Returns a cleanup function. */ export declare function attachTimelineInteractions(host: IxfxTimelineElement, vcanvasEl: VCanvasElement): (() => void); export declare const timelineStyles: import("lit").CSSResult; export declare class ToolbarGroupElement extends LitElement { label: string; grow: boolean; /** * Set by the parent `ixfx-toolbar` when `allow-reorder` is present. * Shows the vertical grab handle; drag starts from the handle only. */ reorderable: boolean; static styles: import("lit").CSSResult[]; protected render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-toolbar-group': ToolbarGroupElement; } } export type ToolbarOrientation = `horizontal` | `vertical-left` | `vertical-right`; export type ToolbarLayout = `one-line` | `wrap`; export type ToolbarVerticalWriting = `auto` | `up` | `down` | `none`; export type ToolbarAlign = `near` | `far`; export interface ToolbarGroupReorderDetail { readonly fromIndex: number; readonly toIndex: number; readonly group: ToolbarGroupElement; } export type ToolbarGroupReorderEvent = CustomEvent; export interface ToolbarElementEventMap { reorder: ToolbarGroupReorderEvent; } /** * JSON-safe snapshot of toolbar group order, suitable for `localStorage` * or any other user-preference store. See `getLayoutSnapshot` / * `applyLayoutSnapshot`. */ export interface ToolbarLayoutSnapshot { readonly version: 1; readonly order: readonly string[]; } /** * Pure helper: nearest gap index for a pointer position along one axis. * `edges` are the [start, end] of each sibling (excluding the drag source), * in visual order. Returns 0..edges.length. */ export declare function toolbarGapIndex(edges: ReadonlyArray, pos: number): number; export declare class ToolbarElement extends LitElement { orientation: ToolbarOrientation; layout: ToolbarLayout; verticalWriting: ToolbarVerticalWriting; toolbarAlign: ToolbarAlign; showGroupLabels: boolean; invisibleGroups: boolean; allowReorder: boolean; private _overflowCount; private _popoverOpen; private _ro; private static _cnt; private _anchor; /** Natural size of items, captured while they are measurable in the main slot. */ private _sizes; private _measureQueued; private _dragState; private _suppressNextClick; private _inner; private _popover; private _slot; static styles: import("lit").CSSResult[]; connectedCallback(): void; protected firstUpdated(): void; protected updated(changed: Map): void; /** Groups in the main slot (not overflow) that can participate in reorder. */ private _mainGroups; /** * Stable key identifying a group across save/restore: its `id`, falling * back to `label`. Groups with neither get an empty key, which still * round-trips as long as the set of groups is unchanged. Give groups a * unique `id` for reliable preference persistence. */ private _groupKey; /** Keys of the main-slot groups in current DOM order. */ getGroupOrder(): string[]; /** * Reorder main-slot groups to match `order` (keys as returned by * `getGroupOrder`). Unknown keys are ignored; groups not mentioned keep * their relative order at the end. Each moved group fires a `reorder` * event, exactly as if dragged. */ setGroupOrder(order: readonly string[]): void; /** * Capture the current group order as a JSON-safe snapshot for preference * stores: `localStorage.setItem(key, JSON.stringify(toolbar.getLayoutSnapshot()))`. */ getLayoutSnapshot(): ToolbarLayoutSnapshot; /** * Restore a snapshot from `getLayoutSnapshot` (e.g. parsed from * `localStorage`). Unknown keys are ignored. Returns `false` when the * value is not a valid snapshot, leaving the toolbar untouched. */ applyLayoutSnapshot(snapshot: unknown): boolean; /** * Move `source` before `ref` (or append when `ref` is null), firing a * `reorder` event when the position actually changed. Returns whether a * move happened. Indices are measured against all light-DOM children, * matching the `reorder` detail of drag-reorder. */ private _insertAndEmit; private _updateGroups; disconnectedCallback(): void; private _onClickCapture; private _onKeyDown; /** * Walk composedPath for the nearest ixfx-toolbar-group, requiring the press * to have gone through its `.grab-handle`. Drag is handle-only so every * control inside the group (buttons, selects, inputs) keeps working. */ private _findDragTarget; private _onPointerDown; private _onPointerMove; private _onPointerUp; private _onPointerCancel; private _beginDrag; private _abortDrag; private _endDrag; private _commitDrag; private _createGhost; /** * Nearest group gap to the pointer, ignoring the drag source. * The perpendicular axis is ignored — the pointer always resolves to a gap. * Gaps are in visual order (reversed for `vertical-left`/column-reverse). */ private _computeGapIndex; private _computeCaretStyle; /** Coalesce measure passes into one per frame; prevents slotchange feedback loops. */ private _scheduleMeasure; private _measure; private _toggleOverflow; protected render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'ixfx-toolbar': ToolbarElement; } } export interface ToolbarElement { addEventListener: ((type: K, listener: (this: ToolbarElement, event: ToolbarElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } export type Effect = `slide-right` | `slide-left` | `slide-up` | `slide-down` | `fade` | `character-swap`; export declare class TransitoryLabelElement extends LitElement { #private; text: string; effect: Effect; duration: number; easing: string; private _currentText; private _outgoingText; private _activeEffect; private _transitionId; private _queue; private _pendingEffect; setText(msg: string, effect: Effect): void; protected updated(changed: PropertyValues): void; private _startTransition; private _onTransitionEnd; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult; } declare global { interface HTMLElementTagNameMap { 'ixfx-transitory-label': TransitoryLabelElement; } } export type TreeControllerOptions = { valueToItem: (value: T, node: TraversableTree) => TreeItem; }; export declare class TreeController { #private; constructor(root: TraversableTree, element: TreeBaseElement, options: TreeControllerOptions); connect(): void; disconnect(): void; /** * Re-derive children for every already-materialised node from the source tree * and patch them in place. Existing `TreeNode` objects are reused by key, so * expansion and selection survive; only added and removed nodes change. Calls * `invalidateStructure()` once. */ sync(): void; /** The source node whose item key is `key`, if it has been materialised. */ lookupByKey(key: string): TraversableTree | undefined; /** Navigate using item keys (root excluded), without searching the source tree. */ navigateToKeyPath(keys: readonly string[], options?: TreeNavigateOptions): boolean; /** Navigate to the source node with this identity, walking up via `getParent()`. */ navigateToIdentity(identity: unknown, options?: TreeNavigateOptions): boolean; navigateToValue(predicate: (value: T) => boolean, options?: TreeNavigateOptions): boolean; } export interface TreeDropVisibleRow { readonly key: string; readonly node: TreeNode; readonly depth: number; /** Index of this row in the full flat (visible) list — not in the `rows` array. */ readonly index: number; readonly rect: DOMRect; } /** Structural facts about a visible row, independent of geometry. */ export interface TreeDropRowInfo { readonly node: TreeNode; readonly depth: number; /** Parent key, or `undefined` for a root-level row. */ readonly parentKey: string | undefined; } /** What a `dragover` / `drop` DataTransfer resolved to for this tree. */ export interface TreeDropResolvedDrag { readonly source: `internal` | `external`; /** Keys of the dragged nodes (empty for external). */ readonly keys: readonly string[]; /** The dragged nodes — live nodes for internal, parsed payload for external. */ readonly nodes: readonly TreeNode[]; } export type TreeDropControllerConfig = { getDndMode: () => `none` | `internal` | `external` | `both`; getExpandHoverMs: () => number; /** * Measured rows in display order, each with a fresh viewport rect. May be * limited to the rows intersecting the scroll container — ancestors and * siblings are resolved through `getRowInfo` / `getChildren`, not from here. * Host may cache. */ getVisibleRows: () => TreeDropVisibleRow[]; /** Flat-list info for a visible key (no geometry), or `undefined` if not visible. */ getRowInfo: (key: string) => TreeDropRowInfo | undefined; /** Children of `parentKey`, or the root's children when undefined. */ getChildren: (parentKey: string | undefined) => readonly TreeNode[]; getIndentPx: () => number; getScrollContainer: () => HTMLElement | undefined; /** True when `key` is `ancestorKey` or a descendant of it. */ isSelfOrDescendant: (ancestorKey: string, key: string) => boolean; /** True when the node is currently expanded in the UI. */ isExpanded: (key: string) => boolean; /** * When `false`, an internal drop that would not change any dragged node's * parent (pure sibling reorder, or dropping back into the current parent) is * rejected outright — no indicator, no `tree-drop`. */ isReorderAllowed: () => boolean; /** Current parent key of `key`, or `undefined` for a root-level node. */ getParentKey: (key: string) => string | undefined; /** * Decide whether this DataTransfer is acceptable and resolve the dragged set. * `phase` is `hover` during dragenter/dragover (DataTransfer is read-protected — * resolve internal drags from the drag registry) and `drop` during drop * (getData is readable; external payloads may be parsed here). Return * `undefined` to reject (the tree will not become a drop target). */ resolveDrag: (dataTransfer: DataTransfer, phase: `hover` | `drop`) => TreeDropResolvedDrag | undefined; vet: (ctx: TreeDropContext) => boolean; expandKey: (key: string) => void; /** Fired whenever the resolved drop target changes (undefined = none / rejected). */ onDropStateChange: (state: TreeDropTarget | undefined) => void; /** Fired when a drag enters / leaves this tree. */ onActiveChange: (active: boolean) => void; commitDrop: (detail: TreeDropDetail) => boolean; onDragEnd: (dropped: boolean) => void; }; export declare class TreeDropController implements ReactiveController { #private; constructor(host: ReactiveControllerHost & HTMLElement, config: TreeDropControllerConfig); /** A drag is currently over this tree. */ get isDragging(): boolean; /** A drag is over this tree but the current position is not a valid drop. */ get isRejected(): boolean; get dropState(): TreeDropTarget | undefined; hostConnected(): void; /** Bind once the shadow `#container` exists (it does not yet at `hostConnected`). */ hostUpdated(): void; hostDisconnected(): void; } /** * Weight accessor — returns the area share of `item` within its siblings. * Non-finite or negative values are treated as `0`. * Default: `() => 1` (equal-area siblings). */ type TreemapValueAccessor = (item: TreeItem) => number; /** * Category accessor — returns the category name for `item`, or `undefined` * for "no category" (falls back to the default tile styling). The returned * string is slugified (non `[a-zA-Z0-9_-]` characters become `-`) and used to * look up `--treemap-category--bg` / `--treemap-category--text`, * CSS variables the consumer defines to colour that category's tiles. */ type TreemapCategoryAccessor = (item: TreeItem) => string | undefined; /** * Tiling algorithm used to subdivide a node's rectangle among its children. * - `'squarify'` — Bruls et al. squarified tiling; aims for near-square aspect * ratios (best-looking default). Sibling order is preserved (no sorting), so * output is deterministic for a given tree. * - `'slice'` — horizontal slices stacked vertically (each child spans the * full width, height proportional to share). * - `'dice'` — vertical slices side-by-side (each child spans the full height, * width proportional to share). * - `'slice-dice'` — alternates per depth: even `relativeDepth` levels dice * (side-by-side), odd levels slice (stacked). */ type TreemapTilingMethod = `squarify` | `slice` | `dice` | `slice-dice`; /** * How containment is presented. Orthogonal to {@link TreemapTilingMethod} * (following Lü & Fogarty, GI 2008 — any subdivision can be shown either way). * - `'nested'` — children fill their parent's rectangle (classic nesting; * visual separation comes from headers/`padding`). * - `'cascaded'` — children are shifted down+right by `cascadeOffsetX/Y` per * level, leaving the parent's top/left strips visible as a stack-of-cards * depth effect. Uses less space for the same containment and keeps structure * visible below labelled levels. */ type TreemapPresentation = `nested` | `cascaded`; /** * Pointer/keyboard gesture mapping (subset of `TreeInteractionMode`). * - `'implicit'` — click selects + zooms; single selection follows the pointer. * - `'standard'` — click selects + zooms; Ctrl/Cmd+click toggles, Shift+click range-selects. * - `'manual'` — click only zooms; selection is driven via `select()`/`deselect()`/`clearSelection()`. * * `checked` is deliberately unsupported — a checkbox per rectangle does not * hold up visually at small tile sizes. */ type TreemapInteractionMode = `implicit` | `standard` | `manual`; /** A single positioned rectangle produced by `computeTreemapLayout()`. */ type TreemapRect = { readonly node: TreeNode; /** Absolute depth from the true root (root's children are depth 0). */ readonly depth: number; /** Nesting level from the current zoom root (0-based). */ readonly relativeDepth: number; /** Left offset as a fraction of the viewport (0–1). */ readonly x: number; /** Top offset as a fraction of the viewport (0–1). */ readonly y: number; /** Width as a fraction of the viewport (0–1). */ readonly width: number; /** Height as a fraction of the viewport (0–1). */ readonly height: number; readonly parentKey: string | undefined; /** 0-based position among siblings. */ readonly index: number; /** Number of siblings (for `aria-setsize`). */ readonly setSize: number; readonly hasChildren: boolean; }; type ComputeTreemapLayoutOptions = { valueAccessor?: TreemapValueAccessor; /** How many nested levels to emit from the zoom root. Defaults to no limit. */ maxDepth?: number; /** Key of the node that acts as the visual root. Defaults to the true root. */ zoomKey?: string | undefined; /** Tiling algorithm. Defaults to `'squarify'`. */ tilingMethod?: TreemapTilingMethod; /** * Containment presentation. Defaults to `'nested'`. * See {@link TreemapPresentation} — orthogonal to `tilingMethod`. */ presentation?: TreemapPresentation; /** * Per-level cascade shift as a fraction of the viewport (0–1) along each * axis. Only applies when `presentation` is `'cascaded'`. The component * derives these from its pixel `cascade-offset` divided by host size; * layout-level callers can pass fractions directly. Defaults to `0`. */ cascadeOffsetX?: number; /** See `cascadeOffsetX` — vertical component. Defaults to `0`. */ cascadeOffsetY?: number; /** * When `true`, leaf nodes (`item.isLeaf === true`) are excluded before * layout — they are neither rendered nor counted towards their siblings' * area shares. A node whose children are all leaves behaves as if it has * none (it lays out with an empty interior). Default `false`. */ hideLeaves?: boolean; }; /** Depth-first search for the node with `key`. Returns `undefined` when absent. */ export declare function findTreemapNode(root: TreeNode | undefined, key: string): TreeNode | undefined; /** * Chain of nodes from `root` down to (and including) the node with `key`. * Returns `undefined` when the key is absent. The first entry is always `root`. */ export declare function findTreemapPath(root: TreeNode | undefined, key: string): TreeNode[] | undefined; /** * Compute the visible rectangles for a treemap view. * * The zoom node fills the whole viewport (`0,0,1,1`); its children subdivide * that rectangle by `valueAccessor` share, recursively, up to `maxDepth` * nested levels. The zoom node itself is never emitted as a rect (it is shown * in the breadcrumb strip instead — matching `TreeComponent.getNodes()`, * where the root is never listed). Siblings whose weights all normalise to * `0` split their parent's rectangle equally. * * @param root True tree root. `undefined` (or a root without children) yields `[]`. * @param options `valueAccessor` (default equal weights), `maxDepth` (nesting * levels, default unlimited), `zoomKey` (visual root, default true root; * unknown keys fall back to the true root), `tilingMethod` (default * `'squarify'`), `presentation` (default `'nested'`) plus `cascadeOffsetX/Y` * (per-level shift as a viewport fraction, cascaded only). */ export declare function computeTreemapLayout(root: TreeNode | undefined, options?: ComputeTreemapLayoutOptions): TreemapRect[]; /** * Pure view-state helpers for `ixfx-treemap-list`. The element re-runs * {@link reconcileTreemapViewState} whenever its structure changes (new * `root` / `model`, model invalidation, a lazy load), so state keyed to nodes * that left the tree goes pending and comes back when those keys reappear. */ /** * `ixfx-treemap-list` view state. * - `selected` / `focus` — the shared base fields. * - `zoom` — key path from the root's children down to the zoom root * (`[]` = the full tree). A path rather than a lone key so a deep zoom into * lazily-loaded data can be restored by loading each ancestor in turn. */ type TreemapListViewState = ViewStateBase & { readonly zoom?: readonly string[]; }; /** Fired when the zoom root changes. `node` is `undefined` on zoom-out to the full tree. */ export type TreemapZoomDetail = { readonly node: TreeNode | undefined; /** Absolute depth of the zoom node (root's children are depth 0); `-1` when fully zoomed out. */ readonly depth: number; }; export type TreemapZoomEvent = CustomEvent; export interface TreemapListElementEventMap extends TreeComponentEventMap { 'select': TreeSelectEvent; 'tickle': TreeTickleEvent; 'activate': TreeActivateEvent; 'item-click': TreeItemClickEvent; 'item-dblclick': TreeItemDblClickEvent; 'expand': TreeExpandEvent; 'collapse': TreeCollapseEvent; 'zoom': TreemapZoomEvent; } /** * `ixfx-treemap-list` — a nested-area (treemap) view over tree data. * * The zoom root fills the whole viewport; at each level a node's rectangle is * subdivided among its children by `valueAccessor` share (see `tilingMethod`), * recursively, up to `maxDepth` nested levels. Implements the shared * `TreeComponent` interface so existing infrastructure (`TreeDataModel`, * `IncrSearchTreeController`, `TreeComponent`-typed code) works unmodified. * * Differences from `ixfx-tree-list` (deliberate): * - **Expand/collapse is reinterpreted as zoom.** Clicking a branch zooms so it * becomes the visual root; ancestors collapse into the breadcrumb strip. * `expand`/`collapse` events fire on zoom-in/zoom-out with the same detail * shape so existing listeners keep working conceptually. * - **`interactionMode` drops `checked`** — a checkbox per rectangle does not * hold up at small tile sizes. * - **`exclusivity` is accepted but ignored** — nothing is independently "open". * - **`filterPredicate` dims** non-matching tiles instead of hiding rows. * - Drag-and-drop is out of scope. */ export declare class TreemapListElement extends LitElement implements TreeComponent, TreeSearchHost { #private; root: TreeNode | undefined; model: TreeDataModel | undefined; /** Callback to lazily load children for a node. Superseded by `model` when both are set. */ loadChildren: LoadChildrenCallback | undefined; /** * Accepted for `TreeComponent` compatibility but ignored — a treemap has no * independently open branches, so exclusivity is not meaningful. */ exclusivity: TreeExclusivity; selectionFilter: TreeSelectionFilter; /** * Gesture mapping. `checked` is unsupported (see class docs). * @default 'standard' */ interactionMode: TreemapInteractionMode; /** * Algorithm used to subdivide a node's rectangle among its children. * @default 'squarify' */ tilingMethod: TreemapTilingMethod; /** * How containment is shown. Orthogonal to `tilingMethod` (Lü & Fogarty 2008: * any subdivision can be shown either way). * - `'nested'` — children fill the parent (classic nesting). * - `'cascaded'` — children shift down+right by `cascadeOffset` per level, * leaving the parent's top/left strips visible (stack-of-cards depth). * @default 'nested' */ presentation: TreemapPresentation; /** * Per-level cascade shift (px) down+right applied when * `presentation === 'cascaded'`. Converted to viewport fractions using the * host size before layout. Ignored when nested. * @default 6 */ cascadeOffset: number; /** How many nested levels render at once from the current zoom root. */ maxDepth: number; /** * When `true`, leaf nodes (`item.isLeaf === true`) are excluded entirely — * neither rendered nor counted towards their siblings' area shares. Use * this to show branch structure only (e.g. folders, not files). */ hideLeaves: boolean; /** * Tiles whose pixel area falls below this (px²) hide their label. * Area is estimated from the tile's area share times the host size. */ minLabelArea: number; /** * Minimum on-screen width (px) a tile needs before its label is shown or * its own children are subdivided. A tall, narrow sliver can clear * `minLabelArea`/`minChildArea` on area alone while still being too narrow * to show even a truncated character — this catches that case so it * renders as a plain, unlabelled block instead of a clipped-to-nothing title. */ minTileWidth: number; /** * Inner padding (px) between a branch tile's border and its children, so * nested levels are visually distinguishable. */ padding: number; /** * Minimum on-screen area (px²) a tile must have before its own children are * subdivided and rendered. Below this, a tile renders as a flat block with * no nested detail — recursion stops by pixel size rather than by a fixed * node depth, so a branch with many descendants doesn't collapse into an * illegible cluster of near-zero-size rectangles. */ minChildArea: number; /** Weight per node. Default `() => 1` — equal-area siblings. */ valueAccessor: TreemapValueAccessor; /** * Category per node, or `undefined` for none. When set, a tile's * background/text colour come from `--treemap-category--bg` / * `--treemap-category--text` (the category name slugified — * non `[a-zA-Z0-9_-]` characters become `-`), falling back to the normal * `--treemap-tile-bg`/`--treemap-tile-text` when that pair isn't defined. * Default `undefined` — no categorisation. */ categoryAccessor: TreemapCategoryAccessor | undefined; selectedNode: TreeNode | undefined; private _selectedNodes; get selectedNodes(): ReadonlySet; filterPredicate: TreeFilterPredicate | undefined; disableKeyboardNavigation: boolean; registry: CommandRegistry | undefined; /** * Space-separated subset of `navigate select filter` — limits which * incremental-search modes are offered. Unset ⇒ all three; empty ⇒ search * disabled. See `docs/infra-incremental.md`. */ searchModes: string | undefined; /** Current zoom root. `undefined` when showing the full tree. Pure view-state — `root` is never mutated. */ get focusedNode(): TreeNode | undefined; private _zoomKey; /** * Whether restoring a saved `zoom` may call `loadChildren` / `model` to load * the ancestors on its path (one at a time, cascading down). Default `true`. */ restoreLoads: boolean; /** Incremental search (navigate / select / filter). See `docs/infra-incremental.md`. */ readonly search: ListSearchController<{ node: TreeNode; depth: number; }>; private tickled; connectedCallback(): void; disconnectedCallback(): void; protected willUpdate(changedProps: PropertyValues): void; protected updated(changedProps: PropertyValues): void; select(node: TreeNode): void; deselect(node: TreeNode): void; clearSelection(): void; selectAll(): void; deselectAll(): void; /** Replace the selection with `nodes` (subject to `selectionFilter`) — search "select" mode. */ selectMany(nodes: Iterable): void; /** * Drill down so `node` becomes the visual root (ancestors move to the * breadcrumb strip). Pure view-state — `root` is never mutated. * Fires `zoom` and the semantic `expand` event. */ zoomTo(node: TreeNode): void; /** * Zoom back out to the full tree. Fires `zoom` (with `node: undefined`) and * the semantic `collapse` event for the previous zoom root. */ zoomOut(): void; /** * Zoom so the node at `keys` (path from the root's children) is visible, * then select it. Returns `true` if the path was found. */ navigateTo(keys: readonly string[]): boolean; /** * Zoom + select the first node for which `predicate` returns `true`. * Returns `true` if a matching node was found. */ navigateToNode(predicate: (node: TreeNode) => boolean): boolean; /** * Zoom so the node with `key` is visible and move the keyboard cursor to it, * without changing the selection. Used by incremental-search "navigate" mode. */ revealKey(key: string): boolean; /** * All nodes currently visible as tiles, in render (pre-order) order, * with absolute depth (root's children are depth 0). */ getNodes(): ReadonlyArray<{ node: TreeNode; depth: number; }>; /** * Snapshot selection, zoom path and keyboard cursor as plain JSON, keyed by * `item.key`. Includes pending state for keys not currently loaded. */ getViewState(options?: GetViewStateOptions): TreemapListViewState; /** * Apply saved view state. Fields present replace the current ones; keys * that aren't loaded yet are applied as they appear — a deep `zoom` loads * its ancestors via `loadChildren` / `model` when `restoreLoads`. */ setViewState(state: Partial): void; clearPendingViewState(): void; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-treemap-list': TreemapListElement; } } export interface TreemapListElement { addEventListener: ((type: K, listener: (this: TreemapListElement, event: TreemapListElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); removeEventListener: ((type: K, listener: (this: TreemapListElement, event: TreemapListElementEventMap[K]) => void, options?: boolean | EventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions) => void); } /** One side of an `ixfx-twosplit-layout` in its view state. */ export type TwoSplitPanelViewState = { /** CSS size, as in `sizeA` / `sizeB` (e.g. `30%`, `200px`). */ readonly size: string; /** Collapsed by dragging to the edge. Absent ⇒ expanded. */ readonly collapsed?: boolean; }; /** `ixfx-twosplit-layout` view state (`kind: 'twosplit-layout'`), keyed by slot name. */ export type TwoSplitLayoutViewState = ViewStateBase & { readonly layout?: Readonly>>; }; /** * Lays out two elements within a container, with a bar to resize them * proportionally. * * Events * ixfx-split-collapsed: Dispatched when a panel is collapsed/uncollapsed via drag. * detail: { panel: 'A' | 'B', collapsed: boolean } * * Attributes * layout: `vertical`|`horizontal` * sizeA/B: CSS size of section A or B. Can use relative or absolute values * fixedA/B: If _true_ size will be calculated in pixels. By default (_false_) it uses % of whole * collapsible: If _true_, panels can be collapsed by dragging to edge (default: false) * minSizeA/B: Minimum size for panel A or B (e.g., "100px" or "20%"). Default: none * maxSizeA/B: Maximum size for panel A or B (e.g., "200px" or "80%"). Default: none * * CSS variables * --handle-size: 2px; // Width/height of split bar * --handle-colour: var(--surface-5); // Colour of split bar * --handle-hover-colour: var(--surface-6); // Split bar on hover * --handle-active-colour: var(--accent); // Split bar while dragging * --ixfx-handle-* // Grip look — shared handle primitive * // (see docs/infra-handle.md) */ export declare class TwoSplitLayoutElement extends LitElement { #private; layout: `vertical` | `horizontal`; sizeA: string; sizeB: string; fixedA: boolean; fixedB: boolean; collapsible: boolean; collapsedA: boolean; collapsedB: boolean; minSizeA: string; maxSizeA: string; minSizeB: string; maxSizeB: string; private _hasCorner; private get showGrabHandle(); disconnectedCallback(): void; firstUpdated(): void; updated(changedProperties: Map): void; /** Snapshot both sides' size and collapse. */ getViewState(options?: GetViewStateOptions): TwoSplitLayoutViewState; /** Restore sizes / collapse. A side missing from `layout` is left as it is. */ setViewState(state: Partial): void; /** Both slots always exist, so nothing is ever pending. */ clearPendingViewState(): void; getZone(): HTMLElement | undefined; render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { "ixfx-twosplit-layout": TwoSplitLayoutElement; } } export type UnitInputUnit = { /** Stable id, reported in events. */ readonly id: string; /** Text shown in the unit picker. */ readonly label: string; /** How many base units one of this unit is (default 1). */ readonly factor?: number; }; /** Byte sizes: base unit is the byte. */ export declare const SIZE_UNITS: readonly UnitInputUnit[]; /** Durations: base unit is the minute. */ export declare const AGE_UNITS: readonly UnitInputUnit[]; export type UnitInputChangeDetail = { /** The number as typed, or `null` when empty or not a number. */ readonly value: number | null; /** Id of the selected unit. */ readonly unit: string; /** `value` times the unit's `factor`, or `null` when `value` is. */ readonly baseValue: number | null; }; export type UnitInputChangeEvent = CustomEvent; /** `value` expressed in base units. */ export declare function toBase(value: number | null, unit: UnitInputUnit | undefined): number | null; /** * The largest unit in `units` that `baseValue` is a whole number of (or the * smallest unit when none fits), with the value in that unit. */ export declare function bestUnit(baseValue: number, units: readonly UnitInputUnit[]): { value: number; unit: string; } | undefined; /** * One control for a number with a unit: a number field joined to a unit * picker, styled as a single input. * * @fires {UnitInputChangeEvent} change — when the number or the unit changes * * @example * ```ts * el.units = SIZE_UNITS; * el.unit = 'MB'; * el.addEventListener('change', e => console.log(e.detail.baseValue)); * ``` */ export declare class UnitInputElement extends LitElement { #private; /** The number, in the selected unit. `null` for empty. */ value: number | null; /** Id of the selected unit. Defaults to the first of `units`. */ unit: string; /** Units to choose from. */ units: readonly UnitInputUnit[]; min: number | undefined; max: number | undefined; step: number | undefined; placeholder: string; disabled: boolean; /** The value in base units (see `UnitInputUnit.factor`), or `null` when empty. */ get baseValue(): number | null; /** Set the control from a base-unit amount, choosing the largest unit it divides into evenly. */ setBaseValue(baseValue: number | null): void; focus(options?: FocusOptions): void; protected render(): import("lit").TemplateResult<1>; static styles: import("lit").CSSResult[]; } declare global { interface HTMLElementTagNameMap { 'ixfx-unit-input': UnitInputElement; } } export interface UnitInputElementEventMap { change: UnitInputChangeEvent; } export interface UnitInputElement { addEventListener: ((type: K, listener: (this: UnitInputElement, event: UnitInputElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } export declare function monitorIndeterminate(targetElOrQuery: string | HTMLElement, watchedElsOrQueries: Array): () => void; declare const XyPad_base: typeof LitElement & (new (...args: any[]) => WheelNudgeConsumer); export declare class XyPad extends XyPad_base { static styles: import("lit").CSSResult[]; xMin: number; xMax: number; x: number; yMin: number; yMax: number; y: number; xScale: string; yScale: string; xSnapStep?: number; ySnapStep?: number; /** Explicit keyboard nudge step for X axis (absolute units). Overrides the 10% default. */ stepX?: number; /** Explicit keyboard nudge step for Y axis (absolute units). Overrides the 10% default. */ stepY?: number; xLabel: string; yLabel: string; showCrosshairs: boolean; showGrid: boolean; hideCursor: boolean; disabled: boolean; /** Number of quantised stops for both axes. Overridden by stops-x/stops-y if set. */ stops?: number; /** Number of quantised stops for X axis. If set, overrides the stops setting for X. */ stopsX?: number; /** Number of quantised stops for Y axis. If set, overrides the stops setting for Y. */ stopsY?: number; private _dragging; private _dragStartX; private _dragStartY; private _pressedKeys; private _onKeyDown; private _onKeyUp; private _handleKeyboardMove; /** * Apply a Y-axis nudge by direction. Wheel affects Y only (matches the * keyboard `ArrowUp`/`ArrowDown` semantic per `plans/mousewheel.md`). */ private _stepYByDelta; _applyWheelDelta(direction: WheelDirection, event: WheelEvent): void; private _onPointerDown; private _onPointerMove; private _onPointerUp; private _updateFromPointer; private _setPctVars; /** * Returns X position as a 0–1 fraction. */ getRelativeX(): number; /** * Returns Y position as a 0–1 fraction. */ getRelativeY(): number; /** * Returns polar coordinates. * - radius: 0–1 distance from center * - angle: radians, 0 = right, clockwise (0 to 2π) */ getPolar(): { radius: number; angle: number; }; updated(_changed: PropertyValues): void; disconnectedCallback(): void; render(): ReturnType; } export type XyPadInputDetail = { readonly x: number; readonly y: number; }; export type XyPadInputEvent = CustomEvent; declare global { interface HTMLElementTagNameMap { 'ixfx-xy-pad': XyPad; } } export interface XyPadEventMap { input: XyPadInputEvent; change: XyPadInputEvent; } export interface XyPad { addEventListener: ((type: K, listener: (this: XyPad, event: XyPadEventMap[K]) => void, options?: boolean | AddEventListenerOptions) => void) & ((type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions) => void); } /** * Enables the layer that renders `data-tooltip` (hover, focus, and while a * `data-tooltip-live` component is being dragged). Safe to call repeatedly. * See docs/infra-tooltips.md. */ export declare function initTooltips(options?: TooltipControllerOptions): void; /** Initialises the library: currently enables tooltips via `initTooltips()`. */ export declare function init(options?: { tooltips?: TooltipControllerOptions | false; }): void; export { type AcTokenAddDetail, type AcTokenAddEvent, type AcTokenElementEventMap, type AcTokenItem, type AcTokenRemoveDetail, type AcTokenRemoveEvent, type AcTokenStyle, type AcTokenStyleFn, type AcTokenizerFn, type AcTokensChangeDetail, type AcTokensChangeEvent, type AddedNode, type BridgeDeps, type BridgeResult, type BuiltInFormatterName, type BuiltInFormatterOptions, type CheckState, type CheckedSelectItem, type ColourPickerChangeEvent, type ColourPickerEventDetail, type ColourPickerInputEvent, type ComputeHyperbolicLayoutOptions, type ComputeTreemapLayoutOptions, type ContextKind, type ContextTarget, type CrumbNavigationViewState, type CssVars, type DataGridColumn, type DataGridColumnMenu, type DataGridColumnViewState, type DataGridDataType, type DataGridEditability, type DataGridEditorContext, type DataGridEditorFactory, type DataGridEditorType, type DataGridGetRowKey, type DataGridGroupBy, type DataGridGroupLabel, type DataGridInteractionMode, type DataGridRowLook, type DataGridRowUpdate, type DataGridSelectionMode, type DataGridSortDirection, type DataGridSortState, type DataGridViewState, type DataListSearchAdapterOptions, type DataListSearchItem, type DetailFormatter, type DetailGroupBy, type DetailListViewState, type DetailSortComparator, type DetailSortItem, type DetailSortMode, type DockDropZone, type DragSelectRect, type DraggableNode, type DrawerEdge, type ElementIncrSearch, type ElementIncrSearchOptions, type ElementListSearchAdapterOptions, type ElementListSearchHost, type FlatListActivateDetail, type FlatListActivateEvent, type FlatListBranchOrder, type FlatListContextMenuDetail, type FlatListContextMenuEvent, type FlatListDropDetail, type FlatListDropEvent, type FlatListEditCancelDetail, type FlatListEditCancelEvent, type FlatListEditCommitDetail, type FlatListEditCommitEvent, type FlatListElementEventMap, type FlatListNavigateDetail, type FlatListNavigateEvent, type FlatListSelectDetail, type FlatListSelectEvent, type FlatListViewState, type FuzzySearch, type FuzzySearchOptions, type GlobalFormatter, type GridListActivateDetail, type GridListActivateEvent, type GridListCaptionAlign, type GridListCaptionBackdrop, type GridListCaptionPosition, type GridListCaptionStyle, type GridListDataAdapter, type GridListElementEventMap, type GridListFullElementEventMap, type GridListItemClickDetail, type GridListItemClickEvent, type GridListItemEventDetail, type GridListItemUpdate, type GridListOrientation, type GridListSelectDetail, type GridListSelectEvent, type GridListTickleDetail, type GridListTickleEvent, type GridListViewState, type GridListViewportChangeDetail, type GridListViewportChangeEvent, type GroupedItemListerElementEventMap, type GroupedSelectDetail, type GroupedSelectEvent, type HighlightOptions, type HighlightTarget, type HyperbolicEdgeRenderContext, type HyperbolicEdgeRenderer, type HyperbolicFocusDetail, type HyperbolicFocusEvent, type HyperbolicInteractionMode, type HyperbolicLayoutEdge, type HyperbolicLayoutNode, type HyperbolicNodeShape, type Point as HyperbolicPoint, type HyperbolicTreeListViewState, type IGroupedSubComponent, type IGroupedSubComponentEventMap, type IcicleViewState, type IconChangedDetail, type IconChangedEvent, type IconEntry, type IncrSearch, type IncrSearchChangeCallback, IncrSearchTreeController as IncrSearchMillerController, type IncrSearchTreeOptions as IncrSearchMillerOptions, type IncrSearchTreeOptions, type IncrSearchOptions, type IncrSearchResult, type IncrSearchState, type InputMode, type ItemDisplay, type ItemOrientation, type ItemTagBehaviour, type ItemTagBehaviourFlags, type ItemTagKeys, type ListActivateDetail, type ListActivateEvent, type ListCanDrop, type ListCanReorder, type ListContextMenuDetail, type ListContextMenuEvent, type ListDragDataTransferWriter, type ListDragEntry, type ListDragLeaveDetail, type ListDragLeaveEvent, type ListDragOverEvent, type ListDragPreview, type ListDragPreviewContext, type ListDragPreviewRenderer, type ListDragPreviewSourceResolver, type ListDragSelectControllerConfig, type ListDragSource, type ListDropAnchor, type ListDropBetween, type ListDropControllerConfig, type ListDropDetail, type ListDropEvent, type ListDropHit, type ListDropIndicatorBox, type ListDropPositions, type ListDropResolution, type ListDropSide, type ListDropState, type ListDropTarget, type ListEditCancelDetail, type ListEditCancelEvent, type ListEditCommitDetail, type ListEditCommitEvent, type ListElementEventMap, type ListFullOrder, type ListGroupBy, type ListGroupChangeDetail, type ListGroupChangeEvent, type ListGroupEventMap, type ListGroupInfo, type ListGroupLabel, type ListGroupPartition, type ListGroupToggleDetail, type ListGroupToggleEvent, type ListInteractionMode, type ListItemClickDetail, type ListItemClickEvent, type ListItemEffect, type ListItemMotionOptions, type ListItemOutResult, type ListItemPositions, type ListMarqueeMode, type ListNativeDragControllerConfig, type ListNativeDragStartDetail, type ListNativeDragStartEvent, type ListReorderBlocked, type ListReorderDetail, type ListReorderEvent, type ListResolveInternalDrag, type ListSearchAdapter, type ListSearchControllerOptions, type ListSearchHost, type ListSearchMode, type ListSelectDetail, type ListSelectEvent, type ListSelectIntentDetail, type ListSelectIntentEvent, type ListSelectIntentKind, type ListSelectIntentSource, type ListSelectKeysDetail, type ListSelectionControllerConfig, type ListSelectionGesture, type ListSelectionMode, type ListSelectionModes, type ListTargetDropDetail, type ListTargetDropEvent, type ListTickleDetail, type ListTickleEvent, type ListViewportChangeDetail, type ListViewportChangeEvent, type ListVisibleOrder, type MarqueeConfig, index_d_exports as Menu, type TreeActivateDetail as MillerActivateDetail, type TreeActivateEvent as MillerActivateEvent, type TreeCollapseDetail as MillerCollapseDetail, type TreeCollapseEvent as MillerCollapseEvent, type TreeExpandDetail as MillerExpandDetail, type TreeExpandEvent as MillerExpandEvent, type TreeItem as MillerItem, type TreeItemClickDetail as MillerItemClickDetail, type TreeItemClickEvent as MillerItemClickEvent, type MillerListViewState, type TreeNode as MillerNode, type TreeSelectDetail as MillerSelectDetail, type TreeSelectEvent as MillerSelectEvent, type TreeTickleDetail as MillerTickleDetail, type TreeTickleEvent as MillerTickleEvent, type MulticolCategory, type MulticolColumnState, type MulticolColumnsChangeReason, type MulticolItem, type MulticolListViewState, type MulticolQuery, type MulticolSelectDetail, type NodeDragConfig, type NodeFactory, type NodeFactoryContext, type OklchValue, type OpenableMenu, type PanZoomConfig, Point$1 as Point, type ProximityPair, type ProximityQuery, type Rect, type RegisterListSearchCommandsOptions, type ResolvedItemTagFlags, type ScrollHoverGuard, type ScrollHoverGuardConfig, type SortDirection, type SubComponentActivateDetail, type SubComponentActivateEvent, type SubComponentFactory, type SubComponentItemClickDetail, type SubComponentItemClickEvent, type SubComponentSelectDetail, type SubComponentSelectEvent, type SubComponentTickleDetail, type SubComponentTickleEvent, type SunburstViewState, type TagActivateDetail, type TagActivateEvent, type TagAddDetail, type TagAddEvent, type TagChangeDetail, type TagChangeEvent, type TagDeleteMode, type TagEditing, type TagInput, type TagItem, type TagListElementEventMap, type TagOption, type TagRemoveDetail, type TagRemoveEvent, type TagRenameDetail, type TagRenameEvent, type TagValidationContext, type TagValidator, type TickledControllerConfig, type TickledItem, type TooltipControllerOptions, type TreeCheckboxState, type TreeKeyboardNavCallbacks, type TreeKeyboardNavControllerConfig, type TreeKeyboardNavItemId, type TreeListSearchAdapterOptions, type TreeListViewState, type TreemapInteractionMode, type TreemapListViewState, type TreemapRect, type TreemapTilingMethod, type TreemapValueAccessor, type VerticalListViewState, type WheelMode, type WireDragConfig, type WireDragMode, type WireDragPort, type WirePath };