You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/02/27 01:43:51 UTC

[GitHub] [couchdb-nano] dobesv commented on issue #203: TypeScript types for database.fetch do not allow for error responses

dobesv commented on issue #203: TypeScript types for database.fetch do not allow for error responses
URL: https://github.com/apache/couchdb-nano/issues/203#issuecomment-591734530
 
 
   Patch:
   
   ```
   diff --git a/node_modules/nano/lib/nano.d.ts b/node_modules/nano/lib/nano.d.ts
   index 4175bb1..7351032 100644
   --- a/node_modules/nano/lib/nano.d.ts
   +++ b/node_modules/nano/lib/nano.d.ts
   @@ -749,6 +749,11 @@ declare namespace nano {
      // Document scope request and response
      // -------------------------------------
    
   +  interface DocumentLookupFailure {
   +    key: string;
   +    error: string;
   +  }
   +
      interface DocumentResponseRowMeta {
        id: string;
        key: string;
   @@ -976,14 +981,14 @@ declare namespace nano {
    
      interface DocumentFetchResponse<D> {
        offset: number;
   -    rows: Array<DocumentResponseRow<D>>;
   +    rows: Array<DocumentResponseRow<D> | DocumentLookupFailure>;
        total_rows: number;
        update_seq?: number;
      }
    
      interface DocumentFetchRevsResponse {
        offset: number;
   -    rows: DocumentResponseRowMeta[];
   +    rows: Array<DocumentResponseRowMeta | DocumentLookupFailure>;
        total_rows: number;
        update_seq?: number;
      }
   
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services