import IQueryOptions from '../../Interfaces/Query/IProductQueryOptions'; import { IBatchAction } from './BatchUtils'; import { IDatabaseRef, ISaveOption } from './DatabaseService'; export interface IQuery { readonly id?: string; readonly limit?: number; readonly orderBy?: IQueryOrder; readonly startAfter?: string; readonly where?: IQueryWhere[]; } export interface IQueryOrder { readonly field: string; readonly direction: string; readonly cast?: 'string' | 'number' | 'boolean'; } export interface IQueryWhere { readonly field: string; readonly operator: '<' | '<=' | '==' | '>' | '>=' | '!=' | 'array-contains' | 'array-contains-any' | 'in'; readonly value: any; } export default class BaseProvider { 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; static registerListener: (_callback: (_: IDatabaseRef[]) => void, _path: string, _query?: IQueryOptions) => string; static unregisterListener: (_id: string) => void; }