react-use-pagination
Version:
A React hook to help manage pagination state
23 lines (22 loc) • 658 B
TypeScript
import { PaginationState } from "./getPaginationMeta";
declare type CurrentPageActions = {
type: "NEXT_PAGE";
} | {
type: "PREVIOUS_PAGE";
} | {
type: "SET_PAGE";
page: number;
};
declare type TotalItemsActions = {
type: "SET_TOTALITEMS";
totalItems: number;
nextPage?: number;
};
declare type PageSizeActions = {
type: "SET_PAGESIZE";
pageSize: number;
nextPage?: number;
};
declare type PaginationStateReducerActions = CurrentPageActions | TotalItemsActions | PageSizeActions;
export declare function paginationStateReducer(state: PaginationState, action: PaginationStateReducerActions): PaginationState;
export {};