@dstanesc/o-o-o-o-o-o-o
Version:
O-O-O-O-O-O-O is a collection of content addressed persistent data structures
66 lines • 2.29 kB
TypeScript
import { LinkCodec, ValueCodec } from './codecs';
import { Edge, Index, Link, Part, Prop, RootIndex, Vertex } from './types';
import { BlockStore } from './block-store';
interface BaselineDelta {
({ baseRoot, baseIndex, baseStore, currentRoot, currentIndex, currentStore, }: {
baseRoot: Link;
baseIndex: RootIndex;
baseStore: BlockStore;
currentRoot: Link;
currentIndex: RootIndex;
currentStore: BlockStore;
}): Promise<{
vertices: {
added: Map<number, Vertex>;
updated: Map<number, Vertex>;
updateBaseline: Map<number, Vertex>;
};
edges: {
added: Map<number, Edge>;
updated: Map<number, Edge>;
updateBaseline: Map<number, Edge>;
};
props: {
added: Map<number, Prop>;
updated: Map<number, Prop>;
updateBaseline: Map<number, Prop>;
};
indices: {
added: Map<number, Index>;
updated: Map<number, Index>;
updateBaseline: Map<number, Index>;
};
}>;
}
interface DeltaFactory {
baselineDelta: BaselineDelta;
baselineChangesRecords: <T extends Part>({ recordSize, baseRoot, baseIndex, baseStore, baseValueRoot, baseValueIndex, currentRoot, currentIndex, currentStore, currentValueRoot, currentValueIndex, recordsDecode, }: {
recordSize: number;
baseRoot: Link;
baseIndex: any;
baseStore: BlockStore;
baseValueRoot?: Link;
baseValueIndex?: any;
currentRoot: Link;
currentIndex: any;
currentStore: BlockStore;
currentValueRoot: Link;
currentValueIndex: any;
recordsDecode: ({ bytes, valueRoot, valueIndex, blockStore, }: {
bytes: Uint8Array;
valueRoot: Link;
valueIndex: any;
blockStore: BlockStore;
}) => Promise<T[]>;
}) => Promise<{
added: Map<number, T>;
updated: Map<number, T>;
updateBaseline: Map<number, T>;
}>;
}
declare const deltaFactory: ({ linkCodec, valueCodec, }: {
linkCodec: LinkCodec;
valueCodec: ValueCodec;
}) => DeltaFactory;
export { deltaFactory, DeltaFactory, BaselineDelta };
//# sourceMappingURL=delta.d.ts.map