import { TemplateResult } from 'lit'; export declare const LISTBOX_EVENTS: readonly ["dds-option-change", "dds-option-deselect", "dds-current-change", "dds-list-changed", "dds-keydown", "dds-cancel"]; export declare const HOST_EVENTS: readonly ["dds-change", "dds-input", "dds-search", "dds-clear", "dds-opened", "dds-closed", "dds-keydown"]; export type AnyEl = HTMLElement & Record; /** * open-wc only auto-cleans fixtures under mocha; register cleanup for vitest so * elements (and focus) never leak between tests. Call once per spec file. */ export declare function useFixtureCleanup(): void; /** Mount a template and wait until it has fully settled. */ export declare function mount(template: TemplateResult | string): Promise; /** Wait for Lit updates of the host and its option-list plus two frames. */ export declare function settle(el: AnyEl): Promise; export declare function getList(el: AnyEl): AnyEl | null; /** The innermost focused element, following shadow roots. */ export declare function deepActive(): Element | null; /** Short, stable description of a value for snapshots. */ export declare function normalize(v: unknown, depth?: number): unknown; export interface TraceEvent { from: 'list' | 'host'; type: string; detail: unknown; } /** Records listbox events on the option-list and host-originated events on the host. */ export declare function recordEvents(host: AnyEl): { take(): TraceEvent[]; }; /** Observable state of the option-list: what a user / caller can see. */ export declare function listState(list: AnyEl | null): { value: any; selectedIndex: any; available: any; active: any; rendered: string; source: any; } | null; /** Host-level observable state per component kind. */ export declare function hostState(host: AnyEl): { ariaMultiselectable: string | null; focus: string | null; value?: undefined; opened?: undefined; text?: undefined; ariaExpanded?: undefined; activedescendant?: undefined; validity?: undefined; input?: undefined; selectedText?: undefined; status?: undefined; chips?: undefined; } | { value: any; opened: boolean; text: string | null; ariaExpanded: string | null; activedescendant: string | null; validity: any; focus: string | null; ariaMultiselectable?: undefined; input?: undefined; selectedText?: undefined; status?: undefined; chips?: undefined; } | { value: any; opened: boolean; input: string | null; selectedText: any; ariaExpanded: string | null; activedescendant: string | null; status: string | null; chips: string | null; validity: any; focus: string | null; ariaMultiselectable?: undefined; text?: undefined; }; export type Step = [label: string, run: (ctx: Ctx) => unknown]; export interface Ctx { host: AnyEl; list: () => AnyEl | null; input: () => HTMLInputElement | null; trigger: () => AnyEl | null; } export interface TraceEntry { step: string; events: TraceEvent[]; host: unknown; list: unknown; } /** Compact, reviewable rendering of a trace (one line per event / state). */ export declare function formatTrace(entries: TraceEntry[]): string; /** Mount + run steps, returning the compact trace string for snapshots. */ export declare function traceText(template: TemplateResult | string, steps: Step[]): Promise; /** Mount a template, then run steps; returns the full trace. */ export declare function trace(template: TemplateResult | string, steps: Step[]): Promise; /** Press a key on the deep-focused element (falls back to `fallback`). */ export declare const press: (key: string, mods?: KeyboardEventInit) => (ctx: Ctx) => void; /** Press a key on a specific target regardless of focus. */ export declare const pressOn: (pick: (ctx: Ctx) => Element | null, key: string) => (ctx: Ctx) => void; /** Type characters into the combobox/search input like a user would. */ export declare const type: (text: string) => (ctx: Ctx) => Promise; /** Delete one character from the end of the input. */ export declare const backspace: () => (ctx: Ctx) => Promise; /** * Click a rendered option (the clone inside option-list's shadow root). * No-op when the option is not rendered (e.g. filtered out); the trace's * rendered-list line shows that, so a change in availability still diffs. */ export declare const clickOption: (value: string, mods?: MouseEventInit) => (ctx: Ctx) => void; /** Click the trigger (select button / combobox input). */ export declare const clickTrigger: () => (ctx: Ctx) => void; export declare const clickOutside: () => () => void; export declare const setProp: (name: string, value: unknown) => (ctx: Ctx) => void; export declare const setAttr: (name: string, value: string | null) => (ctx: Ctx) => void; /** Append option items to the host (async/remote options). */ export declare const appendOptions: (items: Array<[value: string, text: string, attrs?: string]>) => (ctx: Ctx) => void; export declare const removeAllOptions: () => (ctx: Ctx) => void; /** Advance the (fake) clock, e.g. past the 500ms typeahead reset. */ export declare const wait: (ms: number) => () => void; /** Focus a rendered option directly (e.g. Tab into a standalone list). */ export declare const focusOption: (value: string) => (ctx: Ctx) => void; /** Click the combobox/search clear (×) button. */ export declare const clickClear: () => (ctx: Ctx) => void; /** Click the search (magnifier) button. */ export declare const clickSearchButton: () => (ctx: Ctx) => void; /** Click the remove button of a multiselect chip. */ export declare const removeChip: (value: string) => (ctx: Ctx) => void; export declare const focusTrigger: () => (ctx: Ctx) => void;