import { type Identity } from "../crypto/identity"; import type { SignedOp } from "../model/types"; export interface Profile { identity: Identity; name: string; } /** Where a browser keeps ops and the reviewer's profile. Implementations must not leave the machine. */ export interface OpStore { load(doc: string): Promise; append(doc: string, ops: SignedOp[]): Promise; loadProfile(): Promise; saveProfile(profile: Profile): Promise; /** Saves `profile` only if none is stored yet, atomically, and returns whichever profile is stored afterwards. */ saveProfileIfAbsent(profile: Profile): Promise; } export declare class MemoryStore implements OpStore { private readonly docs; private profile; load(doc: string): Promise; append(doc: string, ops: SignedOp[]): Promise; loadProfile(): Promise; saveProfile(profile: Profile): Promise; saveProfileIfAbsent(profile: Profile): Promise; } /** A new reviewer has no name: they show as their animal until they add one. */ export declare const DEFAULT_PROFILE_NAME = ""; /** The reviewer's profile, created with a new identity the first time. */ export declare function loadOrCreateProfile(store: OpStore, name?: string): Promise;