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

TS error in PaginatedResponse interface #62

Open
aneeven opened this issue Jul 19, 2019 · 1 comment
Open

TS error in PaginatedResponse interface #62

aneeven opened this issue Jul 19, 2019 · 1 comment

Comments

@aneeven
Copy link

aneeven commented Jul 19, 2019

Current Behavior

This interface definition

export interface PaginatedResponse<T> {
    pagination?: Pagination;
    [key: string]: T[] | Pagination;
}

causes

Property 'pagination' of type 'Pagination | undefined' is not assignable to string index type 'Pagination | T[]'

since pagination can be undefined.

Expected Behavior

No TS errors.

Possible Solution

Change pagination in PaginatedResponse interface to required.

  • SDK version: 1.2.1
  • Node version: 10.14.1
  • TS version: 3.5.3
@danielepolencic
Copy link
Contributor

Same here with TS 3.6.2

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

2 participants