UNPKG

@worldbrain/storex-sync

Version:

Offline-first syncing between multiple databases using Storex

24 lines (23 loc) 764 B
import { StorageMiddleware } from "@worldbrain/storex/lib/types/middleware"; import { StorageRegistry } from "@worldbrain/storex"; export declare type CustomPkGenerator = () => string; export declare class CustomAutoPkMiddleware implements StorageMiddleware { private _collections; private _pkGenerator; private _storageRegistry; constructor({ pkGenerator }: { pkGenerator: CustomPkGenerator; }); setup({ storageRegistry, collections }: { storageRegistry: StorageRegistry; collections: string[]; }): void; process({ next, operation }: { next: { process: ({ operation }: { operation: any; }) => any; }; operation: any[]; }): Promise<any>; }