UNPKG

@ably/chat

Version:

Ably Chat is a set of purpose-built APIs for a host of chat features enabling you to create 1:1, 1:Many, Many:1 and Many:Many chat rooms for any scale. It is designed to meet a wide range of chat use cases, such as livestreams, in-game communication, cust

40 lines (34 loc) 1.02 kB
/** * Represents the result of a paginated query. */ export interface PaginatedResult<T> { /** * The items returned by the query. */ items: T[]; /** * Whether there are more items to query. * @returns `true` if there are more items to query, `false` otherwise. */ hasNext(): boolean; /** * Whether this is the last page of items. * @returns `true` if this is the last page of items, `false` otherwise. */ isLast(): boolean; /** * Fetches the next page of items. * @returns A promise that resolves with the next page of items or `null` if there are no more items. */ next(): Promise<PaginatedResult<T> | null>; /** * Fetches the first page of items. * @returns A promise that resolves with the first page of items. */ first(): Promise<PaginatedResult<T>>; /** * Fetches the current page of items (the same as the current page). * @returns A promise that resolves with the current page of items. */ current(): Promise<PaginatedResult<T>>; }