Pular para o conteúdo principal

externalStarlightListResponse <T>

This interface represents an API response that returns a list of entities, like a list of Entries or a list of items from a Collection.

It contains a data parameter, which is an array of items with a generic type that depends on the kind of request that was made, and two metadata objects: links and meta. Metadata is useful for pagination.

All SDK request methods that return a list of entities will return this interface.

Index

Properties

Properties

externaldata

data: T[]

The list of entities returned by the API request. Its type depends on which request was made. SDK methods will generally type this parameter automatically.

externallinks

links: { first: string; last: string; next?: string; prev?: string }

An object containing useful links for easier pagination. All links points to the same list requested, but with a varying page parameter.


Type declaration

  • externalfirst: string

    A link for the first page of the list.

  • externallast: string

    A link for the last page of the list.

  • externaloptionalnext?: string

    A link to the next page of the list, if there’s any.

  • externaloptionalprev?: string

    A link to the previous page of the list, if there’s any.

externalmeta

meta: { current_page: number; from: number; last_page: number; per_page: number; to: number; total: number }

An object with useful metadata related to the current list. It can be used in applications to create pagination logic and interfaces.

from and to are indexes indicating which items start and finish the current page of the list. For instance, in a list with 100 items with 15 items per page, on the first page, from and to will be 1 and 15 respectively.


Type declaration

  • externalcurrent_page: number

    The number of the current page.

  • externalfrom: number

    The index of the first item on this page out of all list items.

  • externallast_page: number

    The number of the last page for the current list.

  • externalper_page: number

    The number of items per page.

  • externalto: number

    The index of the last item on this page out of all list items.

  • externaltotal: number

    The total number of items in the current list.