mute-structs
Version:
NodeJS module providing an implementation of the LogootSplit CRDT algorithm
20 lines (19 loc) • 724 B
TypeScript
import { Ordering } from "../ordering";
import { Epoch } from "./epoch";
import { EpochId } from "./epochid";
export interface EpochStoreJSON {
readonly epochs: Array<[string, Epoch]>;
}
export declare function compareEpochFullIds(id1: number[], id2: number[]): Ordering;
export declare class EpochStore {
static fromPlain(o: unknown): EpochStore | null;
private epochs;
constructor(origin: Epoch);
addEpoch(epoch: Epoch): void;
hasEpoch(epoch: Epoch): boolean;
getEpoch(epochId: EpochId): Epoch | undefined;
getEpochFullId(epoch: Epoch): number[];
getEpochPath(epoch: Epoch): Epoch[];
getPathBetweenEpochs(from: Epoch, to: Epoch): [Epoch[], Epoch[]];
toJSON(): EpochStoreJSON;
}