import type { DOMElement } from '../dom.js'; import type { MatchPosition } from '../render-to-screen.js'; /** * Set the search highlight query on the Ink instance. Non-empty → all * visible occurrences are inverted on the next frame (SGR 7, screen-buffer * overlay, same damage machinery as selection). Empty → clears. * * This is a screen-space highlight — it matches the RENDERED text, not the * source message text. Works for anything visible (bash output, file paths, * error messages) regardless of where it came from in the message tree. A * query that matched in source but got truncated/ellipsized in rendering * won't highlight; that's acceptable — we highlight what you see. * @returns an object controlling the search highlight: `setQuery` sets the * query, `scanElement` scans a DOM subtree for matches, and `setPositions` * drives the position-based highlight. */ export declare function useSearchHighlight(): { setQuery: (query: string) => void; /** Paint an existing DOM subtree (from the MAIN tree) to a fresh * Screen at its natural height, scan. Element-relative positions * (row 0 = element top). Zero context duplication — the element * IS the one built with all real providers. */ scanElement: (el: DOMElement) => MatchPosition[]; /** Position-based CURRENT highlight. Every frame writes yellow at * positions[currentIdx] + rowOffset. The scan-highlight (inverse on * all matches) still runs — this overlays on top. rowOffset tracks * scroll; positions stay stable (message-relative). null clears. */ setPositions: (state: { positions: MatchPosition[]; rowOffset: number; currentIdx: number; } | null) => void; }; //# sourceMappingURL=use-search-highlight.d.ts.map