export interface Pagination { /** Page to display, default to 1. */ page ? : number ; /** Number of items per page, default to 50. */ perPage ? : number ; } export const DEFAULT_PAGE = 1 ; export const DEFAULT_PER_PAGE = 50 ; internal export function paginate ( options ? ) { const { page = DEFAULT_PAGE , perPage = DEFAULT_PER_PAGE } = options || { } ; return { page : Math . max ( DEFAULT_PAGE , page ) , per_page : perPage <= 0 || perPage > 100 ? DEFAULT_PER_PAGE : perPage , } ; }