mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge pull request #25598 from tiangolo/pouchdb-changes-selector
PouchDB: update options with find selector and others
This commit is contained in:
Vendored
+38
-2
@@ -1,12 +1,13 @@
|
||||
// Type definitions for pouchdb-core 6.1
|
||||
// Type definitions for pouchdb-core 6.4
|
||||
// Project: https://pouchdb.com/
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Jakub Navratil <https://github.com/trubit>,
|
||||
// Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>,
|
||||
// Tobias Bales <https://github.com/TobiasBales>
|
||||
// Tobias Bales <https://github.com/TobiasBales>, Sebastián Ramírez <https://github.com/tiangolo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="debug" />
|
||||
/// <reference types="pouchdb-find" />
|
||||
|
||||
interface Buffer extends Uint8Array {
|
||||
write(string: string, offset?: number, length?: number, encoding?: string): number;
|
||||
@@ -412,6 +413,41 @@ declare namespace PouchDB {
|
||||
* Note: options.filter must be set to '_view' for this option to work.
|
||||
*/
|
||||
view?: string;
|
||||
|
||||
/**
|
||||
* Filter using a query/pouchdb-find selector. Note: Selectors are not supported in CouchDB 1.x.
|
||||
* Cannot be used in combination with the filter option.
|
||||
*/
|
||||
selector?: Find.Selector;
|
||||
|
||||
/**
|
||||
* (previously options.returnDocs): Is available for non-http databases and defaults to true.
|
||||
* Passing false prevents the changes feed from keeping all the documents in memory – in other
|
||||
* words complete always has an empty results array, and the change event is the only way to get the event.
|
||||
* Useful for large change sets where otherwise you would run out of memory.
|
||||
*/
|
||||
return_docs?: boolean;
|
||||
|
||||
/**
|
||||
* Only available for http databases, this configures how many changes to fetch at a time.
|
||||
* Increasing this can reduce the number of requests made. Default is 25.
|
||||
*/
|
||||
batch_size?: number;
|
||||
|
||||
/**
|
||||
* Specifies how many revisions are returned in the changes array.
|
||||
* The default, 'main_only', will only return the current “winning” revision;
|
||||
* 'all_docs' will return all leaf revisions (including conflicts and deleted former conflicts).
|
||||
* Most likely you won’t need this unless you’re writing a replicator.
|
||||
*/
|
||||
style?: 'main_only' | 'all_docs';
|
||||
|
||||
/**
|
||||
* Only available for http databases. Specifies that seq information only be generated every N changes.
|
||||
* Larger values can improve changes throughput with CouchDB 2.0 and later.
|
||||
* Note that last_seq is always populated regardless.
|
||||
*/
|
||||
seq_interval?: number;
|
||||
}
|
||||
|
||||
interface ChangesResponseChange<Content extends {}> {
|
||||
|
||||
Vendored
+8
-2
@@ -1,10 +1,11 @@
|
||||
// Type definitions for pouchdb-replication 6.1
|
||||
// Type definitions for pouchdb-replication 6.4
|
||||
// Project: https://pouchdb.com/
|
||||
// Definitions by: Jakub Navratil <https://github.com/trubit>
|
||||
// Definitions by: Jakub Navratil <https://github.com/trubit>, Sebastián Ramírez <https://github.com/tiangolo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
/// <reference types="pouchdb-find" />
|
||||
|
||||
declare namespace PouchDB {
|
||||
namespace Replication {
|
||||
@@ -43,6 +44,11 @@ declare namespace PouchDB {
|
||||
*/
|
||||
view?: string;
|
||||
|
||||
/**
|
||||
* Filter using a query/pouchdb-find selector. Note: Selectors are not supported in CouchDB 1.x.
|
||||
*/
|
||||
selector?: Find.Selector;
|
||||
|
||||
/** Replicate changes after the given sequence number. */
|
||||
since?: any;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user