moheb2000 opened a new issue, #346:
URL: https://github.com/apache/couchdb-nano/issues/346

   ## Expected Behavior
   <!--- If you're describing a bug, tell us what should happen -->
   <!--- If you're suggesting a change/improvement, tell us how it should work 
-->
   If we want to create an interface and extends `DocumentViewResponse` for the 
result of `db.view` function, we can't provide other types other than string 
for key property of view. Suppose I use an array as my key like `[date, tag]` 
or a number as my key. So I need to define other types than string for my key 
in interface.
   
   ## Current Behavior
   <!--- If describing a bug, tell us what happens instead of the expected 
behavior -->
   <!--- If suggesting a change/improvement, explain the difference from 
current behavior -->
   
   This will not work:
   ```
   interface IPostViewResponseByTag extends DocumentViewResponse<{ title: 
string }, Post> {
       rows: {
         id: string;
         key: string[]; // Error here
         value: { title: string };
       }[],
   }
   ```
   
   ## Possible Solution
   <!--- Not obligatory, but suggest a fix/reason for the bug, -->
   <!--- or ideas how to implement the addition or change -->
   Add other types to key like `key: string | string[] | etc`


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to