///
///
///
///
///
///
///
import { EventEmitter } from 'events';
import { PassEncrypt } from '../dbs';
import IModel from '../models/model';
export declare abstract class Database {
protected table: string;
protected db: PouchDB.Database;
emitter: EventEmitter;
databaseVersion: string | undefined;
protected refEnDb: PassEncrypt | undefined;
protected secretFields: string[];
protected fieldIndexMap: Map;
protected indexedFields: string[];
constructor(table: string, options: {
databaseVersion: string;
indexedFields?: string[];
enDb?: PassEncrypt;
});
emit(event: string, payload?: any): void;
intialise(): Promise;
private createdDBObject;
protected buildIndexString(...fields: any[]): string;
insert(doc: T): Promise;
insertMany(docs: T[]): Promise;
getById(id: string): Promise | null>;
getOne(query: Partial): Promise | null>;
getAll(query?: Partial): Promise[]>;
findAndUpdate(query: Partial, doc: Partial): Promise;
update(doc: T & PouchDB.Core.IdMeta & PouchDB.Core.GetMeta): Promise;
delete(query: Partial): Promise;
protected deleteTruly(query: Partial): Promise;
deleteById(id: string): Promise;
executeQuery(dbQuery: any, sorting?: {
field: string;
order: 'asc' | 'desc';
limit?: number;
skip?: number;
}): Promise[]>;
protected syncAndResync(runner?: () => Promise, filter?: PouchDB.Replication.ReplicateOptions['filter']): Promise;
encryptSecrets(singleHash: string): Promise;
decryptSecrets(): Promise;
hasIncompatableData(): Promise;
}