From 1eb7cdd9157fbe022736bc7b645987927d913f5e Mon Sep 17 00:00:00 2001 From: Simon Paulger Date: Fri, 7 Apr 2017 14:12:24 +0100 Subject: [PATCH 1/5] Upgrade PouchDB support to v6.1.2 --- types/pouchdb-adapter-fruitdown/index.d.ts | 2 +- types/pouchdb-adapter-http/index.d.ts | 2 +- types/pouchdb-adapter-idb/index.d.ts | 2 +- types/pouchdb-adapter-leveldb/index.d.ts | 2 +- types/pouchdb-adapter-localstorage/index.d.ts | 2 +- types/pouchdb-adapter-memory/index.d.ts | 2 +- types/pouchdb-adapter-node-websql/index.d.ts | 2 +- types/pouchdb-adapter-websql/index.d.ts | 2 +- types/pouchdb-browser/index.d.ts | 5 +- types/pouchdb-core/index.d.ts | 47 +++++++++++++------ types/pouchdb-core/pouchdb-core-tests.ts | 16 ++++++- types/pouchdb-http/index.d.ts | 2 +- types/pouchdb-mapreduce/index.d.ts | 8 ++-- types/pouchdb-node/index.d.ts | 2 +- types/pouchdb-replication/index.d.ts | 2 +- types/pouchdb/index.d.ts | 2 +- 16 files changed, 65 insertions(+), 35 deletions(-) diff --git a/types/pouchdb-adapter-fruitdown/index.d.ts b/types/pouchdb-adapter-fruitdown/index.d.ts index e1323d55bf..cb759cd3ed 100644 --- a/types/pouchdb-adapter-fruitdown/index.d.ts +++ b/types/pouchdb-adapter-fruitdown/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb-adapter-fruitdown v5.4.4 +// Type definitions for pouchdb-adapter-fruitdown v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/pouchdb-adapter-http/index.d.ts b/types/pouchdb-adapter-http/index.d.ts index 44eeb955ac..65b56312c0 100644 --- a/types/pouchdb-adapter-http/index.d.ts +++ b/types/pouchdb-adapter-http/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb-http v5.4.4 +// Type definitions for pouchdb-http v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/pouchdb-adapter-idb/index.d.ts b/types/pouchdb-adapter-idb/index.d.ts index 196739f486..059ad35ab4 100644 --- a/types/pouchdb-adapter-idb/index.d.ts +++ b/types/pouchdb-adapter-idb/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb-adapter-idb v5.4.4 +// Type definitions for pouchdb-adapter-idb v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/pouchdb-adapter-leveldb/index.d.ts b/types/pouchdb-adapter-leveldb/index.d.ts index b335754619..ebe8ed915c 100644 --- a/types/pouchdb-adapter-leveldb/index.d.ts +++ b/types/pouchdb-adapter-leveldb/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb-adapter-leveldb v5.4.4 +// Type definitions for pouchdb-adapter-leveldb v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/pouchdb-adapter-localstorage/index.d.ts b/types/pouchdb-adapter-localstorage/index.d.ts index 207cda4899..2dcb08743a 100644 --- a/types/pouchdb-adapter-localstorage/index.d.ts +++ b/types/pouchdb-adapter-localstorage/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb-adapter-localstorage v5.4.4 +// Type definitions for pouchdb-adapter-localstorage v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/pouchdb-adapter-memory/index.d.ts b/types/pouchdb-adapter-memory/index.d.ts index ae14dfdef8..22c31fa0b0 100644 --- a/types/pouchdb-adapter-memory/index.d.ts +++ b/types/pouchdb-adapter-memory/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb-adapter-memory v5.4.4 +// Type definitions for pouchdb-adapter-memory v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/pouchdb-adapter-node-websql/index.d.ts b/types/pouchdb-adapter-node-websql/index.d.ts index f77a1ebd57..79d7d54172 100644 --- a/types/pouchdb-adapter-node-websql/index.d.ts +++ b/types/pouchdb-adapter-node-websql/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb-adapter-node-websql v5.4.4 +// Type definitions for pouchdb-adapter-node-websql v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/pouchdb-adapter-websql/index.d.ts b/types/pouchdb-adapter-websql/index.d.ts index 4e0ee1cfe9..1fe9fb7809 100644 --- a/types/pouchdb-adapter-websql/index.d.ts +++ b/types/pouchdb-adapter-websql/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb-adapter-websql v5.4.4 +// Type definitions for pouchdb-adapter-websql v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/pouchdb-browser/index.d.ts b/types/pouchdb-browser/index.d.ts index cab27f1e94..aaf72036bc 100644 --- a/types/pouchdb-browser/index.d.ts +++ b/types/pouchdb-browser/index.d.ts @@ -1,10 +1,11 @@ -// Type definitions for pouchdb-browser v5.4.4 +// Type definitions for pouchdb-browser v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// /// +/// /// /// /// diff --git a/types/pouchdb-core/index.d.ts b/types/pouchdb-core/index.d.ts index f591e521ca..ec555101e6 100644 --- a/types/pouchdb-core/index.d.ts +++ b/types/pouchdb-core/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for pouchdb-core v6.0.7 +// Type definitions for pouchdb-core v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Jakub Navratil , Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Jakub Navratil , Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -55,6 +55,15 @@ declare namespace PouchDB { rev: RevisionId; status: Availability; } + interface RevisionDiffList { + [documentId : string]: string[]; + } + interface RevisionDiff { + [change : string]: string[]; + } + interface RevisionDiffResponse { + [documentId : string]: RevisionDiff + } interface IdMeta { _id: DocumentId; @@ -206,6 +215,13 @@ declare namespace PouchDB { new_edits?: boolean; } + interface BulkGetOptions extends Options { + docs: any, + revs?: boolean, + attachments?: boolean, + binary?: boolean + } + interface ChangesMeta { _conflicts?: RevisionId[]; _deleted?: boolean; @@ -320,6 +336,9 @@ declare namespace PouchDB { /** Return attachment data as Blobs/Buffers, instead of as base64-encoded strings. */ binary?: boolean; + + /** Forces retrieving latest “leaf” revision, no matter what rev was requested. */ + latest?: boolean; } interface GetOpenRevisions extends Options { @@ -332,7 +351,6 @@ declare namespace PouchDB { revs?: boolean; } - /** @todo does this have any other properties? */ interface PutOptions extends Options { } interface PostOptions extends PutOptions { @@ -342,9 +360,6 @@ declare namespace PouchDB { interval?: number; } - interface InfoOptions extends Options { - } - interface RemoveAttachmentResponse extends BasicResponse { rev: Core.RevisionId; } @@ -563,8 +578,6 @@ declare namespace PouchDB { * see inconsistent results. */ put(doc: Core.PutDocument, - id: Core.DocumentId | null, - revision: Core.RevisionId | null, options: Core.PutOptions | null, callback: Core.Callback): void; @@ -577,8 +590,6 @@ declare namespace PouchDB { * see inconsistent results. */ put(doc: Core.PutDocument, - id?: Core.DocumentId, - revision?: Core.RevisionId, options?: Core.PutOptions): Promise; /** Remove a doc from the database */ @@ -602,11 +613,10 @@ declare namespace PouchDB { options?: Core.Options): Promise; /** Get database information */ - info(options: Core.InfoOptions | null, - callback: Core.Callback): void; + info(callback: Core.Callback): void; /** Get database information */ - info(options?: Core.InfoOptions): Promise; + info(): Promise; /** * A list of changes made to documents in the database, in the order they were made. @@ -711,11 +721,18 @@ declare namespace PouchDB { rev: Core.RevisionId): Promise; /** Given a set of document/revision IDs, returns the document bodies (and, optionally, attachment data) for each ID/revision pair specified. */ - bulkGet(options: any, + bulkGet(options: Core.BulkGetOptions, callback: Core.Callback): void; /** Given a set of document/revision IDs, returns the document bodies (and, optionally, attachment data) for each ID/revision pair specified. */ - bulkGet(options: any): Promise; + bulkGet(options: Core.BulkGetOptions): Promise; + + /** Given a set of document/revision IDs, returns the subset of those that do not correspond to revisions stored in the database */ + revsDiff(diff : Core.RevisionDiffList, + callback: Core.Callback): void; + + /** Given a set of document/revision IDs, returns the subset of those that do not correspond to revisions stored in the database */ + revsDiff(diff : Core.RevisionDiffList): Promise; } } diff --git a/types/pouchdb-core/pouchdb-core-tests.ts b/types/pouchdb-core/pouchdb-core-tests.ts index 2f047d40d2..fd8ac57359 100644 --- a/types/pouchdb-core/pouchdb-core-tests.ts +++ b/types/pouchdb-core/pouchdb-core-tests.ts @@ -53,6 +53,18 @@ namespace PouchDBCoreTests { }); } + function testBulkGet() { + const db = new PouchDB<{}>(); + db.bulkGet({docs: [{id: 'a', rev: 'b'}, {id: 'b', rev: 'c'}, {id: 'c', rev: 'd'}]}).then((result) => {}); + db.bulkGet({docs: [{id: 'a', rev: 'b'}, {id: 'b', rev: 'c'}, {id: 'c', rev: 'd'}]}, (error, response) => {}); + } + + function testRevsDiff() { + const db = new PouchDB<{}>(); + db.revsDiff({'a': ['1-a', '2-b']}).then((result) => {}); + db.revsDiff({'a': ['1-a', '2-b']}, (error, response) => {}); + } + function testCompact() { const db = new PouchDB<{}>(); // Promise version @@ -92,12 +104,12 @@ namespace PouchDBCoreTests { db.put(model).then((error) => { }); - db.put(model, null, null, null, (error) => { + db.put(model, null, (error) => { }); db.info().then((info) => { }); - db.info({ ajax: { cache: true }}, (error, result) => { + db.info((error, result) => { }); PouchDB.debug.enable('*'); diff --git a/types/pouchdb-http/index.d.ts b/types/pouchdb-http/index.d.ts index e2e6043138..4c4226f3a3 100644 --- a/types/pouchdb-http/index.d.ts +++ b/types/pouchdb-http/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb-http v5.4.4 +// Type definitions for pouchdb-http v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/pouchdb-mapreduce/index.d.ts b/types/pouchdb-mapreduce/index.d.ts index 9d60fa40ef..41b79da1ac 100644 --- a/types/pouchdb-mapreduce/index.d.ts +++ b/types/pouchdb-mapreduce/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for pouchdb-mapreduce v5.4.4 +// Type definitions for pouchdb-mapreduce v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Andy Brown , Brian Geppert , Frederico Galvão , Simon Paulger // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -76,7 +76,7 @@ declare namespace PouchDB { * to take up space on disk. viewCleanup() removes these unnecessary * index files. */ - viewCleanup(callback: PouchDB.Core.Callback): void; + viewCleanup(callback: PouchDB.Core.Callback): void; /** * Cleans up any stale map/reduce indexes. * @@ -85,7 +85,7 @@ declare namespace PouchDB { * to take up space on disk. viewCleanup() removes these unnecessary * index files. */ - viewCleanup(): Promise; + viewCleanup(): Promise; /** * Invoke a map/reduce function, which allows you to perform more complex queries diff --git a/types/pouchdb-node/index.d.ts b/types/pouchdb-node/index.d.ts index fe25d5d7b3..10345db296 100644 --- a/types/pouchdb-node/index.d.ts +++ b/types/pouchdb-node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb-node v5.4.4 +// Type definitions for pouchdb-node v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/pouchdb-replication/index.d.ts b/types/pouchdb-replication/index.d.ts index b1f30a0360..057653bada 100644 --- a/types/pouchdb-replication/index.d.ts +++ b/types/pouchdb-replication/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb-replication v6.0.7 +// Type definitions for pouchdb-replication v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Jakub Navratil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/pouchdb/index.d.ts b/types/pouchdb/index.d.ts index 5822e631a8..e14e4c421f 100644 --- a/types/pouchdb/index.d.ts +++ b/types/pouchdb/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pouchdb v5.4.4 +// Type definitions for pouchdb v6.1.2 // Project: https://pouchdb.com/ // Definitions by: Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From ed4dfea46ece311c63902d59c5573a8821fdac1f Mon Sep 17 00:00:00 2001 From: Simon Paulger Date: Fri, 7 Apr 2017 14:33:36 +0100 Subject: [PATCH 2/5] Fix pouchdb preset tests. --- types/pouchdb/pouchdb-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/pouchdb/pouchdb-tests.ts b/types/pouchdb/pouchdb-tests.ts index 89f1c002db..3d580b9bff 100644 --- a/types/pouchdb/pouchdb-tests.ts +++ b/types/pouchdb/pouchdb-tests.ts @@ -92,12 +92,12 @@ namespace PouchDBTests { db.put(model).then((error) => { }); - db.put(model, null, null, null, (error) => { + db.put(model, null, (error) => { }); db.info().then((info) => { }); - db.info({ ajax: { cache: true }}, (error, result) => { + db.info((error, result) => { }); db.viewCleanup().catch((error) => { From 4f295732c51ea42cd2dcc6d545b746936518edf0 Mon Sep 17 00:00:00 2001 From: Simon Paulger Date: Fri, 7 Apr 2017 14:49:27 +0100 Subject: [PATCH 3/5] Remove duplicated author --- types/pouchdb-mapreduce/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/pouchdb-mapreduce/index.d.ts b/types/pouchdb-mapreduce/index.d.ts index 41b79da1ac..8c1fe7d905 100644 --- a/types/pouchdb-mapreduce/index.d.ts +++ b/types/pouchdb-mapreduce/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-mapreduce v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Simon Paulger , Andy Brown , Brian Geppert , Frederico Galvão , Simon Paulger +// Definitions by: Simon Paulger , Andy Brown , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 807d95e4b510e7e97bce679c9d404c7d582e4c37 Mon Sep 17 00:00:00 2001 From: Simon Paulger Date: Thu, 13 Apr 2017 14:01:03 +0100 Subject: [PATCH 4/5] Remove AGBrown from the authors list on his request. Rename RevisionDiffList RevisionDiffOptions. Rename documentId DocumentId. --- types/pouchdb-adapter-fruitdown/index.d.ts | 2 +- types/pouchdb-adapter-http/index.d.ts | 2 +- types/pouchdb-adapter-idb/index.d.ts | 2 +- types/pouchdb-adapter-leveldb/index.d.ts | 2 +- types/pouchdb-adapter-localstorage/index.d.ts | 2 +- types/pouchdb-adapter-memory/index.d.ts | 2 +- types/pouchdb-adapter-node-websql/index.d.ts | 2 +- types/pouchdb-adapter-websql/index.d.ts | 2 +- types/pouchdb-browser/index.d.ts | 2 +- types/pouchdb-core/index.d.ts | 12 ++++++------ types/pouchdb-http/index.d.ts | 2 +- types/pouchdb-mapreduce/index.d.ts | 2 +- types/pouchdb-node/index.d.ts | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/types/pouchdb-adapter-fruitdown/index.d.ts b/types/pouchdb-adapter-fruitdown/index.d.ts index cb759cd3ed..89fcd9d95b 100644 --- a/types/pouchdb-adapter-fruitdown/index.d.ts +++ b/types/pouchdb-adapter-fruitdown/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-adapter-fruitdown v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/pouchdb-adapter-http/index.d.ts b/types/pouchdb-adapter-http/index.d.ts index 65b56312c0..f0125baf7c 100644 --- a/types/pouchdb-adapter-http/index.d.ts +++ b/types/pouchdb-adapter-http/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-http v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/pouchdb-adapter-idb/index.d.ts b/types/pouchdb-adapter-idb/index.d.ts index 059ad35ab4..a62cef3654 100644 --- a/types/pouchdb-adapter-idb/index.d.ts +++ b/types/pouchdb-adapter-idb/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-adapter-idb v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/pouchdb-adapter-leveldb/index.d.ts b/types/pouchdb-adapter-leveldb/index.d.ts index ebe8ed915c..6c89d0161e 100644 --- a/types/pouchdb-adapter-leveldb/index.d.ts +++ b/types/pouchdb-adapter-leveldb/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-adapter-leveldb v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/pouchdb-adapter-localstorage/index.d.ts b/types/pouchdb-adapter-localstorage/index.d.ts index 2dcb08743a..9e71c05a77 100644 --- a/types/pouchdb-adapter-localstorage/index.d.ts +++ b/types/pouchdb-adapter-localstorage/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-adapter-localstorage v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/pouchdb-adapter-memory/index.d.ts b/types/pouchdb-adapter-memory/index.d.ts index 22c31fa0b0..647ce5b434 100644 --- a/types/pouchdb-adapter-memory/index.d.ts +++ b/types/pouchdb-adapter-memory/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-adapter-memory v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/pouchdb-adapter-node-websql/index.d.ts b/types/pouchdb-adapter-node-websql/index.d.ts index 79d7d54172..bec01a6d8b 100644 --- a/types/pouchdb-adapter-node-websql/index.d.ts +++ b/types/pouchdb-adapter-node-websql/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-adapter-node-websql v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/pouchdb-adapter-websql/index.d.ts b/types/pouchdb-adapter-websql/index.d.ts index 1fe9fb7809..7148d65ea2 100644 --- a/types/pouchdb-adapter-websql/index.d.ts +++ b/types/pouchdb-adapter-websql/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-adapter-websql v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/pouchdb-browser/index.d.ts b/types/pouchdb-browser/index.d.ts index aaf72036bc..94f942302c 100644 --- a/types/pouchdb-browser/index.d.ts +++ b/types/pouchdb-browser/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-browser v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Simon Paulger , Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/pouchdb-core/index.d.ts b/types/pouchdb-core/index.d.ts index ec555101e6..522a2e70a6 100644 --- a/types/pouchdb-core/index.d.ts +++ b/types/pouchdb-core/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-core v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Simon Paulger , Jakub Navratil , Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Jakub Navratil , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -55,14 +55,14 @@ declare namespace PouchDB { rev: RevisionId; status: Availability; } - interface RevisionDiffList { - [documentId : string]: string[]; + interface RevisionDiffOptions { + [DocumentId : string]: string[]; } interface RevisionDiff { [change : string]: string[]; } interface RevisionDiffResponse { - [documentId : string]: RevisionDiff + [DocumentId : string]: RevisionDiff } interface IdMeta { @@ -728,11 +728,11 @@ declare namespace PouchDB { bulkGet(options: Core.BulkGetOptions): Promise; /** Given a set of document/revision IDs, returns the subset of those that do not correspond to revisions stored in the database */ - revsDiff(diff : Core.RevisionDiffList, + revsDiff(diff : Core.RevisionDiffOptions, callback: Core.Callback): void; /** Given a set of document/revision IDs, returns the subset of those that do not correspond to revisions stored in the database */ - revsDiff(diff : Core.RevisionDiffList): Promise; + revsDiff(diff : Core.RevisionDiffOptions): Promise; } } diff --git a/types/pouchdb-http/index.d.ts b/types/pouchdb-http/index.d.ts index 4c4226f3a3..8dde8993e9 100644 --- a/types/pouchdb-http/index.d.ts +++ b/types/pouchdb-http/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-http v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/pouchdb-mapreduce/index.d.ts b/types/pouchdb-mapreduce/index.d.ts index 8c1fe7d905..401f70afb0 100644 --- a/types/pouchdb-mapreduce/index.d.ts +++ b/types/pouchdb-mapreduce/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-mapreduce v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Simon Paulger , Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// diff --git a/types/pouchdb-node/index.d.ts b/types/pouchdb-node/index.d.ts index 10345db296..aed20c7192 100644 --- a/types/pouchdb-node/index.d.ts +++ b/types/pouchdb-node/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for pouchdb-node v6.1.2 // Project: https://pouchdb.com/ -// Definitions by: Andy Brown , Brian Geppert , Frederico Galvão +// Definitions by: Simon Paulger , Brian Geppert , Frederico Galvão // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 431f4cd20d49b62813489b4038146f0c051a623b Mon Sep 17 00:00:00 2001 From: Simon Paulger Date: Fri, 14 Apr 2017 08:34:46 +0100 Subject: [PATCH 5/5] Express possible keys in type. --- types/pouchdb-core/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/pouchdb-core/index.d.ts b/types/pouchdb-core/index.d.ts index 522a2e70a6..eccc2e00fb 100644 --- a/types/pouchdb-core/index.d.ts +++ b/types/pouchdb-core/index.d.ts @@ -59,7 +59,8 @@ declare namespace PouchDB { [DocumentId : string]: string[]; } interface RevisionDiff { - [change : string]: string[]; + missing?: string[]; + possible_ancestors?: string[]; } interface RevisionDiffResponse { [DocumentId : string]: RevisionDiff