import { TablePaginationConfig } from 'ant-design-vue'; import { FilterValue, SorterResult } from 'ant-design-vue/es/table/interface'; import { Key } from 'ant-design-vue/es/vc-table/interface'; import { AxiosResponse } from 'axios'; import { Ref } from 'vue'; import { PageAjax, PageInterFace } from '../types'; interface UsePage { AJAXFunc: (params: any) => Promise>; params?: PageInterFace; runOnMounted?: boolean; watchParams?: boolean; callBackFunc?: (data: T[] | undefined, res: AxiosResponse>) => void; dataField?: string[]; totalField?: string[]; } interface UsePageReturn { rowskeys: Ref; tableLoading: Ref; pagination: Ref; getData: (paramData?: TablePaginationConfig) => void; tableData: Ref; changeParamsCleanPage: (cleanParams?: any) => void; handleTableChange: (page: TablePaginationConfig, filters: Record, sorter: SorterResult | SorterResult[]) => void; } /** * * @param AJAXFunc 请求的方法 * @param params 请求参数,可选 * @param runOnMounted 是否在开始就请求 * @param watchParams 是否监听参数,变化就请求 * @param callBackFunc callBackFunc 成功回调 */ declare const usePage: ({ AJAXFunc, params, runOnMounted, callBackFunc, watchParams, dataField, totalField, }: UsePage) => UsePageReturn; export default usePage;