export interface LWWField { value: T; lamport: number; clientId: string; } export type LWWDocument = Record; /** * Merge two LWW documents — field-level last-write-wins. * The field with the higher lamport wins; on ties, higher clientId wins. */ export declare function mergeLWW(local: LWWDocument, remote: LWWDocument): LWWDocument; /** Convert a plain record to an LWW document */ export declare function toDocument(data: Record, lamport: number, clientId: string): LWWDocument; /** Extract plain data from an LWW document */ export declare function fromDocument(doc: LWWDocument): Record; export interface ORSetElement { value: T; uid: string; removed: boolean; } export type ORSet = ORSetElement[]; export declare function orSetAdd(set: ORSet, value: T): ORSet; export declare function orSetRemove(set: ORSet, uid: string): ORSet; export declare function orSetMerge(local: ORSet, remote: ORSet): ORSet; export declare function orSetValues(set: ORSet): T[]; export declare class LamportClock { private value; private readonly clientId; constructor(clientId: string, initial?: number); /** Increment and return the new value */ tick(): number; /** Update from a received timestamp, then increment */ update(received: number): number; get current(): number; get id(): string; } //# sourceMappingURL=crdt.d.ts.map