mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Merge pull request #15711 from spaulg/pouchdb-6.1.2
Upgrade PouchDB support to v6.1.2 (applies to all pouchdb-* packages)
This commit is contained in:
4
types/pouchdb-adapter-fruitdown/index.d.ts
vendored
4
types/pouchdb-adapter-fruitdown/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// 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 <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
|
||||
4
types/pouchdb-adapter-http/index.d.ts
vendored
4
types/pouchdb-adapter-http/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for pouchdb-http v5.4.4
|
||||
// Type definitions for pouchdb-http v6.1.2
|
||||
// Project: https://pouchdb.com/
|
||||
// Definitions by: Andy Brown <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
|
||||
4
types/pouchdb-adapter-idb/index.d.ts
vendored
4
types/pouchdb-adapter-idb/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// 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 <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
|
||||
4
types/pouchdb-adapter-leveldb/index.d.ts
vendored
4
types/pouchdb-adapter-leveldb/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// 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 <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 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 <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
|
||||
4
types/pouchdb-adapter-memory/index.d.ts
vendored
4
types/pouchdb-adapter-memory/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// 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 <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
|
||||
4
types/pouchdb-adapter-node-websql/index.d.ts
vendored
4
types/pouchdb-adapter-node-websql/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// 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 <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
|
||||
4
types/pouchdb-adapter-websql/index.d.ts
vendored
4
types/pouchdb-adapter-websql/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// 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 <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
|
||||
5
types/pouchdb-browser/index.d.ts
vendored
5
types/pouchdb-browser/index.d.ts
vendored
@@ -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 <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
/// <reference types="pouchdb-adapter-idb" />
|
||||
/// <reference types="pouchdb-adapter-websql" />
|
||||
/// <reference types="pouchdb-adapter-http" />
|
||||
/// <reference types="pouchdb-mapreduce" />
|
||||
/// <reference types="pouchdb-replication" />
|
||||
|
||||
48
types/pouchdb-core/index.d.ts
vendored
48
types/pouchdb-core/index.d.ts
vendored
@@ -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 <https://github.com/trubit>, Andy Brown <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// 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>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -55,6 +55,16 @@ declare namespace PouchDB {
|
||||
rev: RevisionId;
|
||||
status: Availability;
|
||||
}
|
||||
interface RevisionDiffOptions {
|
||||
[DocumentId : string]: string[];
|
||||
}
|
||||
interface RevisionDiff {
|
||||
missing?: string[];
|
||||
possible_ancestors?: string[];
|
||||
}
|
||||
interface RevisionDiffResponse {
|
||||
[DocumentId : string]: RevisionDiff
|
||||
}
|
||||
|
||||
interface IdMeta {
|
||||
_id: DocumentId;
|
||||
@@ -206,6 +216,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 +337,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 +352,6 @@ declare namespace PouchDB {
|
||||
revs?: boolean;
|
||||
}
|
||||
|
||||
/** @todo does this have any other properties? */
|
||||
interface PutOptions extends Options {
|
||||
}
|
||||
interface PostOptions extends PutOptions {
|
||||
@@ -342,9 +361,6 @@ declare namespace PouchDB {
|
||||
interval?: number;
|
||||
}
|
||||
|
||||
interface InfoOptions extends Options {
|
||||
}
|
||||
|
||||
interface RemoveAttachmentResponse extends BasicResponse {
|
||||
rev: Core.RevisionId;
|
||||
}
|
||||
@@ -563,8 +579,6 @@ declare namespace PouchDB {
|
||||
* see inconsistent results.
|
||||
*/
|
||||
put(doc: Core.PutDocument<Content>,
|
||||
id: Core.DocumentId | null,
|
||||
revision: Core.RevisionId | null,
|
||||
options: Core.PutOptions | null,
|
||||
callback: Core.Callback<Core.Error, Core.Response>): void;
|
||||
|
||||
@@ -577,8 +591,6 @@ declare namespace PouchDB {
|
||||
* see inconsistent results.
|
||||
*/
|
||||
put(doc: Core.PutDocument<Content>,
|
||||
id?: Core.DocumentId,
|
||||
revision?: Core.RevisionId,
|
||||
options?: Core.PutOptions): Promise<Core.Response>;
|
||||
|
||||
/** Remove a doc from the database */
|
||||
@@ -602,11 +614,10 @@ declare namespace PouchDB {
|
||||
options?: Core.Options): Promise<Core.Response>;
|
||||
|
||||
/** Get database information */
|
||||
info(options: Core.InfoOptions | null,
|
||||
callback: Core.Callback<any, Core.DatabaseInfo>): void;
|
||||
info(callback: Core.Callback<any, Core.DatabaseInfo>): void;
|
||||
|
||||
/** Get database information */
|
||||
info(options?: Core.InfoOptions): Promise<Core.DatabaseInfo>;
|
||||
info(): Promise<Core.DatabaseInfo>;
|
||||
|
||||
/**
|
||||
* A list of changes made to documents in the database, in the order they were made.
|
||||
@@ -711,11 +722,18 @@ declare namespace PouchDB {
|
||||
rev: Core.RevisionId): Promise<Core.RemoveAttachmentResponse>;
|
||||
|
||||
/** 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<any, any>): 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<any>;
|
||||
bulkGet(options: Core.BulkGetOptions): Promise<any>;
|
||||
|
||||
/** 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.RevisionDiffOptions,
|
||||
callback: Core.Callback<Core.Error, Core.RevisionDiffResponse>): 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.RevisionDiffOptions): Promise<Core.RevisionDiffResponse>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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('*');
|
||||
|
||||
4
types/pouchdb-http/index.d.ts
vendored
4
types/pouchdb-http/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for pouchdb-http v5.4.4
|
||||
// Type definitions for pouchdb-http v6.1.2
|
||||
// Project: https://pouchdb.com/
|
||||
// Definitions by: Andy Brown <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
|
||||
8
types/pouchdb-mapreduce/index.d.ts
vendored
8
types/pouchdb-mapreduce/index.d.ts
vendored
@@ -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 <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
@@ -76,7 +76,7 @@ declare namespace PouchDB {
|
||||
* to take up space on disk. viewCleanup() removes these unnecessary
|
||||
* index files.
|
||||
*/
|
||||
viewCleanup(callback: PouchDB.Core.Callback<any,void>): void;
|
||||
viewCleanup(callback: PouchDB.Core.Callback<any,Core.BasicResponse>): 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<void>;
|
||||
viewCleanup(): Promise<Core.BasicResponse>;
|
||||
|
||||
/**
|
||||
* Invoke a map/reduce function, which allows you to perform more complex queries
|
||||
|
||||
4
types/pouchdb-node/index.d.ts
vendored
4
types/pouchdb-node/index.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
// Type definitions for pouchdb-node v5.4.4
|
||||
// Type definitions for pouchdb-node v6.1.2
|
||||
// Project: https://pouchdb.com/
|
||||
// Definitions by: Andy Brown <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions by: Simon Paulger <https://github.com/spaulg>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="pouchdb-core" />
|
||||
|
||||
2
types/pouchdb-replication/index.d.ts
vendored
2
types/pouchdb-replication/index.d.ts
vendored
@@ -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 <https://github.com/trubit>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
2
types/pouchdb/index.d.ts
vendored
2
types/pouchdb/index.d.ts
vendored
@@ -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 <https://github.com/AGBrown>, Brian Geppert <https://github.com/geppy>, Frederico Galvão <https://github.com/fredgalvao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user