import type { OpenGeniBrowserClient } from "@opengeni/sdk/browser"; /** One occurrence in a session: the durable event plus its UTF-16 offset. */ export type SessionFindMatch = { sequence: number; eventId: string; offset: number; }; /** Matches counted in the background before further pages wait for navigation. */ export declare const SESSION_FIND_BACKGROUND_MATCHES = 2000; export declare function compareSessionFindMatch(a: Pick, b: Pick): number; /** * What is known about a newest-first traversal. `matches` are in conversation * order (oldest first). Pages visit messages newest first, so every message * newer than the oldest one reached is complete; that oldest message may still * have later occurrences on the next page, so its matches are not yet settled. */ export type SessionFindProgress = { matches: SessionFindMatch[]; exhausted: boolean; /** Cumulative occurrences seen, exact once exhausted. */ total: number; /** The oldest match, when asked for before the newest-first pages reach it. */ first?: SessionFindMatch | null; }; /** Index of the first settled match: everything from it to the end is complete. */ export declare function settledFrom(progress: SessionFindProgress): number; export declare function settledCount(progress: SessionFindProgress): number; /** * The match one step from `from` (Next = newer, Previous = older), wrapping at * either end like browser find. Returns what must load first when the answer * is not known yet: `more` (one more older page) or `first` (the oldest match). */ export declare function resolveSessionFindMove(progress: SessionFindProgress, from: Pick, direction: 1 | -1): SessionFindMatch | "more" | "first" | null; /** * Find in one session: newest matches first, all of the history reachable. * Retains only compact occurrence keys, never message text. Pages continue in * the background until the count is exact (or many matches are known), and * on demand when navigation needs older matches or the oldest one. */ export declare function useSessionFind(input: { client: OpenGeniBrowserClient; authority: string; workspaceId: string; sessionId: string; query: string; enabled: boolean; backgroundMatches?: number | undefined; }): { matches: SessionFindMatch[]; exhausted: boolean; total: number; first: SessionFindMatch | null; loading: boolean; error: string | null; accessDenied: boolean; /** Request one more older page, or the oldest match. */ load: (kind: "more" | "first") => void; retry: () => void; };