Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add head response type #304

Merged
merged 1 commit into from
Nov 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/nano.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ declare namespace nano {
get(docname: string, params?: DocumentGetParams, callback?: Callback<DocumentGetResponse & D>): Promise<DocumentGetResponse & D>;
/** Fetch document meta data, useful for fetching a document's current revision.
* @see Docs: {@link http://docs.couchdb.org/en/latest/api/document/common.html#head--db-docid} */
head(docname: string, callback?: Callback<any>): Promise<any>;
head(docname: string, callback?: Callback<DocumentHeadResponseHeaders>): Promise<DocumentHeadResponseHeaders>;
/** Delete a document from this database.
* @see Docs: {@link http://docs.couchdb.org/en/latest/api/document/common.html#delete--db-docid} */
destroy(docname: string, rev: string, callback?: Callback<DocumentDestroyResponse>): Promise<DocumentDestroyResponse>;
Expand Down Expand Up @@ -1249,6 +1249,13 @@ declare namespace nano {
_revisions?: any;
}

/** Document head response headers:
* @see docs: {@link https://docs.couchdb.org/en/latest/api/document/common.html#head--db-docid} */
interface DocumentHeadResponseHeaders {
/** Double quoted document’s revision token. */
etag: string;
}

/** _all_docs parameters
* @see Docs: {@link http://docs.couchdb.org/en/latest/api/database/bulk-api.html#get--db-_all_docs} */
interface DocumentListParams {
Expand Down