import { Key } from 'react'; import { FormInstance } from 'antd/es/form'; import { NamePath } from 'antd/es/form/interface'; /** * 生成随机字符串 * @returns 随机字符串 */ export declare const getRandom: () => string; /** * 构建 AntD Table 的 rowKey 函数,支持字符串/函数两种形式, * 当用户指定字段值无效时(新增行尚未填写业务 key),自动降级到内部 record.rowKey。 * @param rowKey 用户传入的 rowKey prop * @returns AntD Table 可用的 rowKey 字符串或函数 */ export declare const buildTableRowKey: (rowKey?: string | number | symbol | ((record: any) => any)) => (record: any) => string; /** * 深层次对比两个对象且取出来差异值 * @param object 比较对象 * @param base 基准对象 * @returns 差异对象 */ export declare const difference: , U extends Record>(object: T, base: U) => Record; /** * 数组字段循环校验,解决validateFields无法批量校验的问题 * @param validateKeys 校验键数组 * @param form 表单实例 * @param rowName 行名称路径 * @returns 校验结果Promise */ export declare const customValidate: (validateKeys: string[], form: FormInstance, rowName: NamePath) => Promise; /** * 拆解数组names * @param names 名称数组 * @returns 拆解后的字符串 */ export declare const splitNames: (names: any[]) => string; /** * 获取中间formItem的name * @param name 名称路径 * @param virtualKey 虚拟键 * @returns 完整名称路径数组 */ export declare const getNamePath: (name: NamePath, virtualKey?: string) => (string | number)[]; /** * 删除操作 * @param params 删除参数 */ export declare const onDelete: ({ name, form, virtualKey, selectedRowKeys, }: { name: NamePath; form: FormInstance; virtualKey?: string; selectedRowKeys: Key[]; }) => void; /** * 获取最终的disabled, 两种模式【子级优先,全局优先】 * 全局优先:globalControl为true时,全局控制 * 子级优先:globalControl为false时,子级控制 * @param params 禁用参数 * @returns 是否禁用 */ export declare const getDisabled: ({ globalControl, formDisabled, column, tabledDisabled, columnFieldProps, params, rowDisabled, }: { globalControl: boolean; formDisabled?: boolean | ((record: any) => boolean); column: any; tabledDisabled?: boolean; columnFieldProps?: any; params: any[]; rowDisabled?: any; }) => boolean; /** * 表格自动滚动到报错位置 */ export declare const handleScrollToError: () => void; /** * 深copy一个对象,并过滤掉其中的React节点 * @param value 需要深拷贝的对象 * @returns 深拷贝后的对象,其中的React节点会被保留 */ export declare function cloneDeepFilterNode(value: T): T; /** * 分页校验 */ export declare const onPageCheck: ({ form, name, value, columns, setState, page, pagination, isView, disabled, }: { form: any; name: any; value: any; columns: any; setState: any; page: any; pagination: any; isView: any; disabled: any; }) => Promise;