Skip to content

Commit d45b2ee

Browse files
authored
Add head response type (#304)
1 parent 3c153b1 commit d45b2ee

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/nano.d.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ declare namespace nano {
338338
get(docname: string, params?: DocumentGetParams, callback?: Callback<DocumentGetResponse & D>): Promise<DocumentGetResponse & D>;
339339
/** Fetch document meta data, useful for fetching a document's current revision.
340340
* @see Docs: {@link http://docs.couchdb.org/en/latest/api/document/common.html#head--db-docid} */
341-
head(docname: string, callback?: Callback<any>): Promise<any>;
341+
head(docname: string, callback?: Callback<DocumentHeadResponseHeaders>): Promise<DocumentHeadResponseHeaders>;
342342
/** Delete a document from this database.
343343
* @see Docs: {@link http://docs.couchdb.org/en/latest/api/document/common.html#delete--db-docid} */
344344
destroy(docname: string, rev: string, callback?: Callback<DocumentDestroyResponse>): Promise<DocumentDestroyResponse>;
@@ -1249,6 +1249,13 @@ declare namespace nano {
12491249
_revisions?: any;
12501250
}
12511251

1252+
/** Document head response headers:
1253+
* @see docs: {@link https://docs.couchdb.org/en/latest/api/document/common.html#head--db-docid} */
1254+
interface DocumentHeadResponseHeaders {
1255+
/** Double quoted document’s revision token. */
1256+
etag: string;
1257+
}
1258+
12521259
/** _all_docs parameters
12531260
* @see Docs: {@link http://docs.couchdb.org/en/latest/api/database/bulk-api.html#get--db-_all_docs} */
12541261
interface DocumentListParams {

0 commit comments

Comments
 (0)