diff --git a/types/pouchdb-core/index.d.ts b/types/pouchdb-core/index.d.ts index 4b1d56d860..7534ad902c 100644 --- a/types/pouchdb-core/index.d.ts +++ b/types/pouchdb-core/index.d.ts @@ -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 , Jakub Navratil , // Brian Geppert , Frederico Galvão , -// Tobias Bales +// Tobias Bales , Sebastián Ramírez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// +/// 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 { diff --git a/types/pouchdb-replication/index.d.ts b/types/pouchdb-replication/index.d.ts index b0611b840a..a0f581b40a 100644 --- a/types/pouchdb-replication/index.d.ts +++ b/types/pouchdb-replication/index.d.ts @@ -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 +// Definitions by: Jakub Navratil , Sebastián Ramírez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// +/// 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;