mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
pouchdb-core improvements [bulkDocs, changes, get with open revs] (#13410)
* pouchdb-core [BulkDocsOptions, GetOpenRevisions, query, changes promise] * Removed query function to be added in mapreduce. * Added _conflicts to ChangesMeta.
This commit is contained in:
Vendored
+11
-3
@@ -201,7 +201,12 @@ declare namespace PouchDB {
|
||||
}[];
|
||||
}
|
||||
|
||||
interface BulkDocsOptions extends PutOptions {
|
||||
new_edits?: boolean;
|
||||
}
|
||||
|
||||
interface ChangesMeta {
|
||||
_conflicts?: RevisionId[];
|
||||
_deleted?: boolean;
|
||||
_attachments?: Attachments;
|
||||
}
|
||||
@@ -286,7 +291,7 @@ declare namespace PouchDB {
|
||||
results: ChangesResponseChange<Content>[];
|
||||
}
|
||||
|
||||
interface Changes<Content extends Core.Encodable> extends EventEmitter {
|
||||
interface Changes<Content extends Core.Encodable> extends EventEmitter, Promise<ChangesResponse<Content>> {
|
||||
on(event: 'change', listener: (value: ChangesResponseChange<Content>) => any): this;
|
||||
on(event: 'complete', listener: (value: ChangesResponse<Content>) => any): this;
|
||||
on(event: 'error', listener: (value: any) => any): this;
|
||||
@@ -320,6 +325,9 @@ declare namespace PouchDB {
|
||||
* revisions specified in open_revs array. Leaves will be returned
|
||||
* in the same order as specified in input array. */
|
||||
open_revs: 'all' | Core.RevisionId[];
|
||||
|
||||
/** Include revision history of the document. */
|
||||
revs?: boolean;
|
||||
}
|
||||
|
||||
/** @todo does this have any other properties? */
|
||||
@@ -465,7 +473,7 @@ declare namespace PouchDB {
|
||||
* Finally, to delete a document, include a _deleted parameter with the value true.
|
||||
*/
|
||||
bulkDocs(docs: Core.PutDocument<Content>[],
|
||||
options: Core.PutOptions | null,
|
||||
options: Core.BulkDocsOptions | null,
|
||||
callback: Core.Callback<Core.Error, Core.Response[]>): void;
|
||||
|
||||
/**
|
||||
@@ -476,7 +484,7 @@ declare namespace PouchDB {
|
||||
* Finally, to delete a document, include a _deleted parameter with the value true.
|
||||
*/
|
||||
bulkDocs(docs: Core.PutDocument<Content>[],
|
||||
options?: Core.PutOptions): Promise<Core.Response[]>;
|
||||
options?: Core.BulkDocsOptions): Promise<Core.Response[]>;
|
||||
|
||||
/** Compact the database */
|
||||
compact(options?: Core.CompactOptions): Promise<Core.Response>;
|
||||
|
||||
@@ -175,5 +175,7 @@ namespace PouchDBCoreTests {
|
||||
heartbeat: false,
|
||||
filter: (doc: any, params: any) => {}
|
||||
});
|
||||
|
||||
db.changes({ limit: 50 }).then(() => {});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user