UNPKG

evtstore

Version:

Event Sourcing with Node.JS

15 lines (14 loc) 714 B
import { Collection, Timestamp } from 'mongodb'; import { Event, StoreEvent, Provider, ErrorCallback } from '../src/types'; export type Bookmark = { bookmark: string; position: Timestamp; }; export type Options<E extends Event> = { limit?: number; events: Collection<StoreEvent<E>> | Promise<Collection<StoreEvent<E>>>; bookmarks: Collection<Bookmark> | Promise<Collection<Bookmark>>; onError?: ErrorCallback; }; export declare function createProvider<E extends Event>(opts: Options<E>): Provider<E>; export declare function migrate(events: Collection<StoreEvent<any>> | Promise<Collection<StoreEvent<any>>>, bookmarks: Collection<Bookmark> | Promise<Collection<Bookmark>>): Promise<void>;