import { type PaginationMenuProps } from "../PaginationMenu/PaginationMenu.types"; import { type TableFieldText, type TableFieldAction, type TableFieldContent } from "./Table.types"; export declare function isTableFieldText(content: TableFieldContent): content is TableFieldText; export declare function isTableFieldAction(content: TableFieldContent): content is [TableFieldAction?, TableFieldAction?]; export declare const shouldShowPagination: (paginationMenuProps: PaginationMenuProps | undefined) => paginationMenuProps is PaginationMenuProps; /** * This function is to be used when the data we need can be completely on the client side. * By doing so we have a centralized way to deal with pagination. * * For server side data (e.g.: pagination on the API), do not use this and rely on the API instead. * * @example * const chunkSize = 17; * const totalItems = 200; * * // Create an array with 200 items [0, 1, 2, ..., 199] * const array = Array.from(Array(totalItems).keys()); * * // Split array into chunks of 17, where the least one will have only 13 items. * const chunks = chunkArray(array, chunkSize); * * console.log(chunks); * // Output: * // [ * // [0, 1, 2, ..., 16], * // [17, 18, 19, ..., 33], * // ... * // [187, 188, 189, ..., 199] * // ] */ export declare function prepareClientSidePagination({ /** * The array to be split into chunks. */ items, /** * The size of each page. */ pageSize, }: { items: Array; pageSize: number; }): { pageSlices: Array>; /** * The size of the collection. */ totalItems: number; /** * The amount of pages based on the number of items. */ pages: number; /** * Utility function to help getting items from a specific page. * @param pageNumber - the page being seeked * @returns - the array containing the items of a specific page. */ getItemsFromPage: (pageNumber: number) => Array; };