import { type CredentialStore } from "./keystore"; import { type ChooseDevice, type Credentials, SignInError } from "./protocol"; export declare class SessionEnded extends SignInError { readonly deviceRevoked: boolean; readonly code: string; constructor(message: string, deviceRevoked: boolean, code: string); } export declare function createSession(options: { readonly api: string; readonly store: CredentialStore; readonly home?: string; readonly signal?: AbortSignal; readonly now?: () => number; }): { request: (path: string, init: RequestInit) => Promise; signal: AbortSignal | undefined; transaction: (action: () => Promise) => Promise; ready(): Promise; save(value: Credentials): Promise; /** The marker an explicit `omo logout` left, or null; only an empty store makes it meaningful. */ signedOutMarker: () => Promise<{ device: string | null; at: string; } | null>; clearSignedOutMarker: () => Promise; update(action: (current: Credentials | null) => Promise, options?: { readonly replaceInvalid?: boolean; }): Promise; forget(): Promise; accessSnapshot: () => Promise; logout(): Promise; /** `expect` rejects a stored credential that is no longer the caller's captured identity before any refresh. */ accessToken(expect?: (current: Credentials) => boolean): Promise; removeForLimit(error: unknown, choose: ChooseDevice): Promise; }; export type Session = ReturnType;