import React from 'react'; import { TableUpdateMethods } from '@/types'; import { HttpMethod } from '@/constants'; import { CacheReturn } from './use-cache'; interface TableUpdateResult extends Required { data: Array>; modifiedData: Array>; updateData: (data: Array>) => void; initData: (data: Array>, onLoaded?: (data: Array>) => void) => Array>; setData: (data: Record[], modifiedData?: Record[]) => void; updateRow: (page: number | false, row: Record) => void; addRows: (page: number | false, rows: Array>, head?: boolean, rowIndex?: number) => Record | undefined; removeRows: (page: number | false, existedKeys: React.Key[], newKeys: React.Key[], url?: string, _method?: HttpMethod) => Promise; initModifiedData: (data: Array>) => void; } /** * 使用表格数据 hook,包括数据初始化和更新等 * - 表格数组操作维护一个内部 `INTERNAL_ROW_ID` 来进行增删改操作,因此提供通用的增删改的方法 * - 维护一个内部记录修改了的数据的记录:`modifiedData` * @param rowKey 行键,默认为 `UUID` 即 `uuId` * @param initialData 初始数据 * @param tableCache 表格缓存 */ export declare const useTableData: (rowKey: string, tableCache?: CacheReturn, onChange?: (action: string, rows: Array> | undefined) => void) => TableUpdateResult; export {};