trex-hooks
Version:
Common hooks used for antd 4.0
20 lines (19 loc) • 608 B
TypeScript
declare type TableInfoType<Col> = {
dataSource: Col[];
total?: number;
};
interface UseTableProps<Col> {
defaultPagination?: any;
getTableInfo: (current: number, pageSize: number, newFilters: any, newSorter: any) => Promise<TableInfoType<Col> | false>;
}
declare function useTable<Col = any>(props: UseTableProps<Col>): {
tableProps: {
dataSource: Col[];
pagination: any;
onChange: (newPagination: any, filters: any, sorter: any) => void;
};
query: () => void;
refresh: () => void;
clear: () => void;
};
export default useTable;