/** * this file contains typings that are pouchdb-specific * most of it is copied from @types/pouchdb * because it is outdated and strange */ export interface PouchReplicationOptions { live?: boolean, retry?: boolean, filter?: Function, doc_ids?: string[], query_params?: any, view?: any, since?: number, heartbeat?: number, timeout?: number, batch_size?: number, batches_limit?: number, back_off_function?: Function, checkpoint?: false | 'source' | 'target' } /** * possible pouch-settings * @link https://pouchdb.com/api.html#create_database */ export interface PouchSettings { auto_compaction?: boolean; revs_limit?: number; ajax?: any; fetch?: any; auth?: any; skip_setup?: boolean; storage?: any; size?: number; location?: string; iosDatabaseLocation?: string; } export type PouchSyncHandlerEvents = 'change' | 'paused' | 'active' | 'error' | 'complete'; export type PouchSyncHandler = { on(ev: PouchSyncHandlerEvents, fn: (el: any) => void): void; cancel(): void; }; declare type Debug = { enable(what: string): void; disable(): void; }; export type PouchdbQuery = { selector: any; sort?: any[]; limit?: number; skip?: number; } export declare class PouchDB { constructor(name: string, options: { adapter: string }); info(): Promise; allDocs(options?: any): Promise; bulkDocs( docs: Array, options?: any ): Promise; compact(options?: any): Promise; destroy(options?: any): Promise; get( docId: string, options?: any ): Promise; put( doc: any, options?: any, ): Promise; remove( doc: any | string, options?: any, ): Promise; changes(options?: PouchReplicationOptions): any; sync(options?: PouchReplicationOptions): PouchSyncHandler; close(): Promise; putAttachment( docId: string, attachmentId: string, rev: string, attachment: any, type: string ): Promise; getAttachment( docId: string, attachmentId: string, options: { rev?: string }, ): Promise; removeAttachment( docId: string, attachmentId: string, rev: string ): Promise; bulkGet(options?: any): Promise; revsDiff(diff: any): Promise; static plugin(p: any): void; static debug: Debug; }