Skip to content

TS error in PaginatedResponse interface #62

@aneeven

Description

@aneeven

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions