Iterator for type T which gives page in each iteration.

interface PageIterator<T> {
    items: readonly T[];
    getPageSize(): number;
    hasNext(): boolean;
    hasPrevious(): boolean;
    next(): Promise<readonly T[]>;
    previous(): Promise<readonly T[]>;
}

Type Parameters

  • T

Properties

items: readonly T[]

Get the items in current page.

List of items of type T in current page.

Methods

  • Get the page size.

    Returns number

    10

  • Returns boolean

  • Returns boolean

  • Get the items in next page.

    Returns Promise<readonly T[]>

    List of items of type T in next page and set that as current page.

  • Get the items in previous page.

    Returns Promise<readonly T[]>

    List of items of type T in previous page and set that as current page.