import type { GetSessionOptions, Session } from "@opengeni/sdk"; /** * `useSession` reads a conversation's detail fresh (`getSession` with * `fresh: true`), and `useSessionEvents` reads the same detail for the durable * head once its first window lands, to join the live stream there. When both * open one conversation through one client object, the head read joins the * detail read started since the stream began loading (in flight or settled) * instead of reading the session a second time. * * A joined head can only be older than a new read would be; the stream then * replays the difference from its cursor, which is always correct. A failed * read is never kept. */ type SessionDetailSource = { getSession: (workspaceId: string, sessionId: string, options?: GetSessionOptions) => Promise; }; /** A mark: `joinSessionDetailRead` accepts only reads started after it. */ export declare function sessionDetailReadMark(): number; /** Read the detail fresh, so a head read started later can join it. */ export declare function readFreshSessionDetail(client: SessionDetailSource, workspaceId: string, sessionId: string, options?: Omit): Promise; /** The newest fresh detail read started after `mark`, or null. */ export declare function joinSessionDetailRead(client: object, workspaceId: string, sessionId: string, mark: number): Promise | null; export {};