mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-28 16:45:10 +08:00
@@ -38,6 +38,23 @@ namespace PouchDBCoreTests {
|
||||
});
|
||||
}
|
||||
|
||||
function testBulkDocs() {
|
||||
const db = new PouchDB<MyModel>();
|
||||
type MyModel = { property: 'someProperty '};
|
||||
let model: PouchDB.Core.Document<MyModel>;
|
||||
let model2: PouchDB.Core.Document<MyModel>;
|
||||
|
||||
db.bulkDocs([model, model2]).then((result) => {
|
||||
result.forEach(({ ok, id, rev }) => {
|
||||
isString(id);
|
||||
isString(rev);
|
||||
});
|
||||
});
|
||||
|
||||
db.bulkDocs([model, model2], null, (error, response) => {
|
||||
});
|
||||
}
|
||||
|
||||
function testCompact() {
|
||||
const db = new PouchDB<{}>();
|
||||
// Promise version
|
||||
|
||||
6
pouchdb-core/pouchdb-core.d.ts
vendored
6
pouchdb-core/pouchdb-core.d.ts
vendored
@@ -268,6 +268,12 @@ declare namespace PouchDB {
|
||||
allDocs(options?: Core.AllDocsOptions):
|
||||
Promise<Core.AllDocsResponse<Content>>;
|
||||
|
||||
bulkDocs(docs: Core.Document<Content>[],
|
||||
options: Core.PutOptions | void,
|
||||
callback: Core.Callback<Core.Error, Core.Response[]>): void;
|
||||
bulkDocs(docs: Core.Document<Content>[],
|
||||
options?: Core.PutOptions): Promise<Core.Response[]>;
|
||||
|
||||
/** Compact the database */
|
||||
compact(options?: Core.CompactOptions): Promise<Core.Response>;
|
||||
compact(options: Core.CompactOptions,
|
||||
|
||||
Reference in New Issue
Block a user