nano - add missing db.attachment.get signature that returns a ReadableStream (#19634)

* Added a missing db.attachment.get signature

* nano package version number bumped to 6.4 in index.d.ts
This commit is contained in:
Gyula Szalai
2017-09-08 19:19:41 +02:00
committed by Andy
parent e97c0d882b
commit 502c2546c4
2 changed files with 9 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
// Type definitions for nano 6.2
// Type definitions for nano 6.4
// Project: https://github.com/apache/couchdb-nano
// Definitions by: Tim Jacobi <https://github.com/timjacobi>
// Kovács Vince <https://github.com/vincekovacs>
@@ -282,6 +282,7 @@ declare namespace nano {
params: any,
callback?: Callback<any>
): Request;
get(docname: string, attname: string): NodeJS.ReadableStream;
get(docname: string, attname: string, callback?: Callback<any>): Request;
get(
docname: string,

View File

@@ -127,8 +127,15 @@ mydb.attachment.insert(
"text/plain",
(error: any, att: any) => {}
);
const attInsert: NodeJS.WritableStream = mydb.attachment.insert(
"new",
"att",
null,
"text/plain"
);
mydb.attachment.destroy("new", "att", { rev: "123" }, (err, response) => {});
mydb.attachment.get("new_string", "att", (error: any, helloWorld: any) => {});
const attGet: NodeJS.ReadableStream = mydb.attachment.get("new_string", "att");
/*
* Multipart