import { Doc, MinimongoCollectionFindOneOptions, MinimongoLocalCollection, MinimongoLocalDb } from "./types"; /** Replicates data into a both a master and a replica db. Assumes both are identical at start * and then only uses master for finds and does all changes to both * Warning: removing a collection removes it from the underlying master and replica! */ export default class ReplicatingDb implements MinimongoLocalDb { collections: { [collectionName: string]: Collection; }; masterDb: MinimongoLocalDb; replicaDb: MinimongoLocalDb; constructor(masterDb: MinimongoLocalDb, replicaDb: MinimongoLocalDb); addCollection(name: any, success: any, error: any): any; removeCollection(name: any, success: any, error: any): any; getCollectionNames(): string[]; } declare class Collection implements MinimongoLocalCollection { name: string; masterCol: MinimongoLocalCollection; replicaCol: MinimongoLocalCollection; constructor(name: string, masterCol: MinimongoLocalCollection, replicaCol: MinimongoLocalCollection); find(selector: any, options: any): { fetch(success: (docs: T[]) => void, error: (err: any) => void): void; fetch(): Promise; }; findOne(selector: any, options?: MinimongoCollectionFindOneOptions): Promise; findOne(selector: any, options: MinimongoCollectionFindOneOptions, success: (doc: T | null) => void, error: (err: any) => void): void; findOne(selector: any, success: (doc: T | null) => void, error: (err: any) => void): void; upsert(doc: T): Promise; upsert(doc: T, base: T | null | undefined): Promise; upsert(docs: T[]): Promise<(T | null)[]>; upsert(docs: T[], bases: (T | null | undefined)[]): Promise<(T | null)[]>; upsert(doc: T, success: (doc: T | null) => void, error: (err: any) => void): void; upsert(doc: T, base: T | null | undefined, success: (doc: T | null) => void, error: (err: any) => void): void; upsert(docs: T[], success: (docs: (T | null)[]) => void, error: (err: any) => void): void; upsert(docs: T[], bases: (T | null | undefined)[], success: (item: (T | null)[]) => void, error: (err: any) => void): void; remove(id: any): Promise; remove(id: any, success: () => void, error: (err: any) => void): void; cache(docs: any, selector: any, options: any, success: any, error: any): void; pendingUpserts(success: any, error: any): void; pendingRemoves(success: any, error: any): void; resolveUpserts(upserts: any, success: any, error: any): void; resolveRemove(id: any, success: any, error: any): void; seed(docs: any, success: any, error: any): void; cacheOne(doc: any, success: any, error: any): void; cacheList(docs: any, success: any, error: any): void; uncache(selector: any, success: any, error: any): void; uncacheList(ids: any, success: any, error: any): void; } export {};