import type { VxeGridProps, VxeGridPropTypes, VxeGridEventProps } from 'vxe-table'; import type { Ref } from 'vue'; /** * 表格分页器配置参数 */ export declare type TablePagerProps = VxeGridPropTypes.PagerConfig & { /** * 页码键名 */ pageKey?: string; /** * 每页数据量别名 */ pageSizeKey?: string; }; /** * 表格API接口配置参数 */ export interface TableApiProps { /** * 接口函数 */ fn: () => Promise; /** * 接口调用前后的钩子 */ hooks?: { /** * 调用前钩子 * @return 重构后将传递的接口参数 */ before?: = any, BR extends Record>(params: T) => BR; /** * 接口调用成功后的钩子 * @param result 接口调用成功后返回的值 * @param $options 表格选项, 响应式对象, 解构将失去响应性 */ success?: (result: R, $options: T) => void; /** * 接口调用失败后的钩子 * @param result 接口调用失败后的响应结果 * @param $options 表格选项, 响应式对象, 解构将失去响应性 */ error?: (result: any, $options: T) => void; }; } /** * 表格API接口 */ export interface TableApi { /** * 查询接口 */ query: TableApiProps; /** * 更新接口 */ update: TableApiProps; /** * 删除接口 */ delete: TableApiProps; /** * 新增接口 */ create: TableApiProps; } export declare type BaseTableApi = Partial, 'query'>>; /** * 表格基础选项 */ export declare type BaseOptions = VxeGridProps & VxeGridEventProps & { pagerConfig?: TablePagerProps; filters?: Ref; }; /** * 基础查询表格选项 */ export interface BaseTableOptions extends BaseOptions { api?: BaseTableApi; } export interface CrudTableOptions extends BaseOptions { api?: Partial>; } /** * 表格默认选项配置 */ export declare const defaultOptions: BaseOptions;