import { type RefObject } from "react"; import type { TimelineItem } from "../timeline/types.js"; export type TimelineSearchTarget = { sequence: number; eventId?: string | undefined; /** Literal, case-insensitive text. No regex interpretation. */ query: string; /** Zero-based occurrence within the source message. Defaults to zero. */ occurrence?: number | undefined; /** * Zero-based UTF-16 offset of the match in the original message text, as * reported by backend all-occurrence search (messageMatchOffset). When set * it takes precedence over `occurrence` and is validated against `query`, * so a stale offset degrades to no highlight rather than a wrong one. */ offset?: number | undefined; }; /** Scoped to the target's group; disclosure expansion persists after closing find. */ export declare const TimelineSearchRevealContext: import("react").Context; export declare const useTimelineSearchReveal: () => string | null; export declare function isTimelineSearchTarget(item: TimelineItem, target: TimelineSearchTarget): boolean; /** Scan without allocating an offset array proportional to a huge message. */ export declare function literalSearchOffset(text: string, query: string, occurrence?: number): number; /** * Validate a caller-supplied UTF-16 offset against the text and query. The * sticky flag pins the match to exactly `offset`; like literalSearchOffset, * regex escaping keeps offsets in UTF-16 units even for length-changing case * folds. Returns -1 when the offset is stale or the text no longer matches. */ export declare function matchAtOffset(text: string, query: string, offset: number): number; /** Resolve a target to a UTF-16 offset: explicit offset wins, else the ordinal scan. */ export declare function searchMatchOffset(text: string, target: TimelineSearchTarget): number; /** Range highlighting does not mutate React-owned text or its layout. */ export declare function useTimelineSearchNavigation(root: RefObject, itemId: string | undefined, target: TimelineSearchTarget | null | undefined, releasePin: () => void, revision: unknown): void;