import type { Identity } from "../crypto/identity"; import type { OpBody, OpKind, SignedOp, Thread } from "./types"; type Fields = Omit; /** * What a caller supplies for a new op. The id is always derived from the op's content, so callers * never choose it; a create starts its own thread, so it takes no `thread` either. */ export type NewOp = (Omit & { kind: "create"; }) | (Fields & { kind: Exclude; }); /** The verified set of ops for one document, plus its Lamport clock. */ export declare class OpLog { readonly doc: string; private readonly ops; private clock; /** Latest `at` of each author's creates, and of each thread, so new ops follow what came before. */ private readonly createAt; private readonly threadAt; constructor(doc: string); get size(): number; all(): SignedOp[]; threads(): Thread[]; /** * Adds ops that are well formed, for this document, carry the id their content derives, are * authentically signed and are new. Returns those added. */ add(incoming: unknown[]): Promise; /** Creates, signs and adds a new op written by `identity`. */ append(identity: Identity, name: string, fields: NewOp): Promise; } export {};