/** * A model that represents a paginable response from a list endpoint. * @module Paginable * @version 4.3.1 */ export default class Paginable { /** * Constructs a Paginable from a plain Javascript object, optionally creating a new instance. * Copies all relevant properties from data to obj if supplied or a new instance if not. * @param {Object} metadata The plain Javascript object bearing properties of interest. * @param {module:Paginable} obj Optional instance to populate. * @return {module:Paginable} The populated Paginable instance. */ static constructFromObject(metadata: any, obj: any): any; /** * Get the first page of the set, if any * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable * or rejects with error message if any issue (link not available, ...) */ getFirstPage(): Promise; /** * Get the previous page of the set, if any * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable * or rejects with error message if any issue (link not available, ...) */ getPrevPage(): Promise; /** * Get the next page of the set, if any * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable * or rejects with error message if any issue (link not available, ...) */ getNextPage(): Promise; /** * Get the last page of the set, if any * @return {Promise} a {@link https://www.promisejs.org/|Promise}, resolves with another Paginable * or rejects with error message if any issue (link not available, ...) */ getLastPage(): Promise; /** * Get the current page number * @return {Number} the current page number, starts at 0 */ currentPage(): number; /** * Get the total number of pages * @return {Number} the total number of pages available */ countPages(): number; /** * Check if current page is first page * @return {Boolean} True if current page is 0, false otherwise */ isFirstPage(): boolean; /** * Check if current page is last page * @return {Boolean} True if current page is countPages()-1, false otherwise */ isLastPage(): boolean; populatePaginationMetadata(apiClient: any, page: any, resultsPerPage: any): void; apiClient: ApiClient; page: number; resultsPerPage: number; _getLink(path: any): Promise; /** * The link to first page, if any * @type {String} * @memberOf Paginable */ linkFirst: string; /** * The link to previous page, if any * @type {String} * @memberOf Paginable */ linkPrev: string; /** * The link to next page, if any * @type {String} * @memberOf Paginable */ linkNext: string; /** * The link to last page, if any * @type {String} * @memberOf Paginable */ linkLast: string; /** * Number of total results available * @type {Number} * @memberOf Paginable */ resultsTotal: number; } import { ApiClient } from "./ApiClient";