import type { Ref } from 'vue'; import type { TablePaginationProps } from '../types/pagination'; import type { DefaultRow, TableProps, Sort } from 'element-plus/es/components/table/src/table/defaults'; import type { TableColumnCtx } from 'element-plus/es/components/table/src/table-column/defaults'; import type { Writeable } from 'pagoda-shared'; export type TableSortable = Sort & { column: TableColumnCtx; }; export interface useTableRequestParams { initialPagination: Writeable; onRequest: TableRequestHandler; } export type TableRequestHandler = (currentPage: number, pageSize: number, sortable?: Sort | null) => Promise<{ data: TableProps['data']; total: number; }> | void; export interface UseTableRequestReturn { tableData: Ref['data']>; pagination: Writeable & { currentPage: number; pageSize: number; total: number; }; refresh: () => Promise; refreshCurrentPage: () => Promise; setTableSortable: (sortable: Sort) => void; setPaginationSize: (pageSize: number) => void; setPaginationCurrentPage: (currentPage: number) => void; } export declare function useTableRequest({ initialPagination, onRequest, }: useTableRequestParams): UseTableRequestReturn;