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

The key in DocumentViewResponse type has only string type #346

Open
moheb2000 opened this issue Aug 3, 2024 · 0 comments
Open

The key in DocumentViewResponse type has only string type #346

moheb2000 opened this issue Aug 3, 2024 · 0 comments

Comments

@moheb2000
Copy link

Expected Behavior

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

This will not work:

interface IPostViewResponseByTag extends DocumentViewResponse<{ title: string }, Post> {
    rows: {
      id: string;
      key: string[]; // Error here
      value: { title: string };
    }[],
}

Possible Solution

Add other types to key like key: string | string[] | etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant