Skip to content

Extends functionality for BaseResponse  #134

@amirhmk

Description

@amirhmk

Is there any way to define a BaseResponse in the api-types.ts file so that it can be used in the rest of the responces?

Something like:

interface BaseResponse {
  total: number;
  page_size: number;
  page: number;
  prev_page: string;
  next_page: string;
}

interface ApiResponse extends BaseResponse {
  // BaseResponse would get destructure here implicitly 
  data: SpecificRecordsResponse[]
}

I tried the above approach, but it does not work out of the box. Not sure if there is another way or a config change that can make this happen?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions