UNPKG

opt-table

Version:

A Responsive and Customizable Rich Table

17 lines (16 loc) 652 B
import React, { Ref } from "react"; import { CustomPaginationProps, OptTableInterface, OptTableRefProps } from "../types"; type useTAbleProps<T> = { props: OptTableInterface<T>; ref: Ref<OptTableRefProps>; }; declare function useTable<T>({ props, ref }: useTAbleProps<T>): { order: "desc" | "asc"; handleRequestSort: (event: React.MouseEvent<unknown>, property: keyof T) => void; visibleRows: T[]; orderBy: keyof T | undefined; pagination_props: CustomPaginationProps; set_pagination_props: React.Dispatch<React.SetStateAction<CustomPaginationProps>>; total_data: number; }; export default useTable;