import { Ref, ComputedRef } from 'vue'; import { ProTableFormActionType, ProTableFormColumn, ProTableFormColumnChild, ProTableFormProps, FormInstance } from '../types'; export interface ProTableFormOptions { props: Readonly; emit: (event: 'update:modelValue', value: Record[]) => void; /** 新增行事件 */ emitAddRow?: () => void; /** 删除行事件 */ emitRemoveRow?: (index: number) => void; } /** useProTableForm 返回 */ export interface UseProTableFormReturn { register: (formAction: ProTableFormActionType) => void; currentModelValue: ComputedRef[]>; formModelRef: ComputedRef<{ rows: Record[]; }>; mergedRules: ComputedRef>; tableRows: ComputedRef; rowKeyFn: (row: TableRow) => string; spanMethodAdapter: (params: { row: TableRow; column: { property: string; label: string; }; rowIndex: number; columnIndex: number; }) => [number, number] | { rowspan: number; colspan: number; } | void; allLeafColumnKeys: ComputedRef; formRef: Ref; /** 获取 el-form 实例 */ getFormRef: () => FormInstance | null; cellComponent: (col: ProTableFormColumn | ProTableFormColumnChild) => unknown; cellBind: (col: ProTableFormColumn | ProTableFormColumnChild) => Record; slotUpdateHandler: (slotProps: { row: TableRow; }, col: ProTableFormColumn, childKey?: string) => (v: unknown) => void; getCellProp: (tableRow: TableRow, col: ProTableFormColumn, childKey?: string) => string; getCellValue: (row: TableRow, col: ProTableFormColumn, childKey?: string) => unknown; setCellValue: (tableRow: TableRow, col: ProTableFormColumn, childKey: string | undefined, val: unknown) => void; handleAddRow: () => void; handleRemoveRow: (index: number) => void; getRow: (index: number) => Record; setRow: (index: number, row: Record) => void; validate: () => Promise; clearValidate: (propsArg?: string | string[]) => void; } type TableRow = { _index: number; }; export declare function useProTableForm(options: ProTableFormOptions): UseProTableFormReturn; export {};