/** * The `ctrl-r` history-search surface. * * An overlay rather than a slot view, unlike completion: a search owns the * keyboard while it is up — every printable character is query text, and `↑` * and `↓` walk results rather than the composer's own rows — so the ownership * the registry already models is exactly right. It also means the composer * underneath is never written to while searching, which is what makes `esc` * restore the draft AND its cursor for free: there is nothing to restore, * because nothing was taken. * * Everything drawn here is submitted input, so it is untrusted terminal text: * escaped before it is measured, measured in display columns, and bounded to * the live region by a viewport, exactly as the shared picker is. * @module dshline/history-search-overlay */ import type { HistorySearch } from './history-search.ts'; import type { TuiOverlay } from './slots.ts'; /** What the search overlay renders and how it reports its answer. */ export interface HistorySearchSpec { /** The live search model: query, matches, and selection. */ readonly search: HistorySearch; /** * Report the answer, exactly once. * @param index - the chosen historical position, or undefined on cancellation. */ settle(index: number | undefined): void; /** Asks the runner to redraw after a query edit or a selection move. */ invalidate(): void; } /** * Build the history-search overlay. * @param spec - the search model and how to settle. * @returns the overlay to push onto the slot registry. */ export declare function createHistorySearchOverlay(spec: HistorySearchSpec): TuiOverlay; //# sourceMappingURL=history-search-overlay.d.ts.map