/** Search and highlighting helpers for rendered conversation lines. */ /** A substring match in a rendered line's plain-text representation. */ export type ConversationMatch = { lineIdx: number; col: number; len: number; }; type ConversationLine = { plain: string; }; type HighlightMatch = ConversationMatch & { current?: boolean; }; /** * Remove ANSI CSI/OSC control sequences from a string. * * This deliberately follows the escape-sequence grammar used by the terminal * renderer, rather than stripping only colour codes: hyperlinks and other * styled output must not affect plain-text search columns either. */ export declare function stripAnsi(text: string): string; /** * Find all non-overlapping substring matches using smartcase semantics. * Lowercase queries match case-insensitively; queries containing uppercase * characters match case-sensitively. */ export declare function findConversationMatches(lines: ConversationLine[], query: string): ConversationMatch[]; /** * Inject match backgrounds into an ANSI-styled line without counting escape * sequences as plain-text columns. Existing foreground/style sequences are * copied verbatim, so syntax highlighting remains intact. */ export declare function highlightConversationLine(text: string, matches: HighlightMatch[], openMatch: string, openCurrent: string, close: string): string; /** Find the first match at or after a line, wrapping to the first match. */ export declare function nearestConversationMatchAfter(matches: ConversationMatch[], lineIdx: number): number; /** Find the last match at or before a line, wrapping to the last match. */ export declare function nearestConversationMatchBefore(matches: ConversationMatch[], lineIdx: number): number; export {}; //# sourceMappingURL=conversation-search.d.ts.map