import IQueryOptions from '../../Interfaces/Query/IProductQueryOptions'; import BaseProvider from './BaseProvider'; import { IBatchAction } from './BatchUtils'; import { IDatabaseRef, ISaveOption } from './DatabaseService'; export interface IProviderDocument { id: string; snapshotTimestamp: number; data: any; } declare enum operationEnum { QUERY = "query", QUERY_ONE = "queryOne", ADD = "add", SET = "set", BULK = "bulk", DELETE = "delete", BULKDELETE = "bulkdelete" } export default class NotFirebaseProvider extends BaseProvider { private static listners; private static _ws; static getDocs: (path: string, query: IQueryOptions) => Promise; static saveDoc: (path: string, id: string, timestamp: number, obj: any, options?: ISaveOption) => Promise; static addDoc: (path: string, obj: any, noEvent?: boolean) => Promise; static deleteDoc: (path: string, id: string, noEvent?: boolean) => Promise; static processBatch: (batch: IBatchAction[], noEvent?: boolean) => Promise; /**listner section * TODO - rethink with websocket */ /** * Register a call back on data change * @param callback the function to call with the new data * @param path the collection path to watch * @param query the query for the data to be returned */ static registerListener: (callback: (_: IDatabaseRef[]) => void, path: string, query?: IQueryOptions) => string; /** * Remove a listner * * @param id id of the previously created listner */ static unregisterListener: (id: string) => void; static callDbServiceEndpoint: (operation: operationEnum, body: any, options?: ISaveOption, retry?: boolean) => Promise; private static runListenerCallback; private static setupWebSocket; private static closeWebSocket; private static sendWebSocketCommand; } export {};