@amsterdam/design-system-react
Version:
All React components from the Amsterdam Design System. Use it to compose pages in your website or application.
17 lines (16 loc) • 558 B
TypeScript
/**
* This returns an array of the range, including spacers
*
* @example
* currentPage = 4, totalPages = 7, maxVisiblePages = 7
* // returns [1, 2, 3, 4, 5, 6, 7]
*
* @example
* currentPage = 5, totalPages = 100, maxVisiblePages = 7
* // returns [1, 'firstSpacer', 4, 5, 6, 'lastSpacer', 100]
*
* @example
* currentPage = 97, totalPages = 100, maxVisiblePages = 7
* // returns [1, 'firstSpacer', 96, 97, 98, 99, 100]
*/
export declare function getRange(currentPage: number, totalPages: number, maxVisiblePages: number): Array<string | number>;