import React from 'react'; import { FormInstance } from 'antd/lib/form'; import { TableRowSelection } from 'antd/lib/table/interface'; export interface DomSize { width?: number; height?: number; } export declare function useWindowSize(): DomSize; export declare const useDomSize: (dom?: HTMLElement) => DomSize; /** * @description: 防抖 * @param {*} T * @return {*} */ export declare const usePreventShake: (v: T, t?: number) => T; export declare type RecursivePartial = T extends object ? { [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial[] : T[P] extends object ? RecursivePartial : T[P]; } : any; /** * @description: 动态的获取表单中的值,实现表单的双向绑定 * @param {*} T * @return {*} * formValues:表单的值; * onValuesChange赋值到
* upDateFormValues:更新表单的值,注意在业务代码中不要使用form.setFieldsValue赋值数据了 * resetForm:重置表单的值 */ export declare const useFormGetFieldsValue: (form: FormInstance) => { formValues: Partial | undefined; onValuesChange: (v: Partial, obj: T) => void; upDateFormValues: (values: Partial) => void; resetForm: () => void; }; /** * @description: 判断点击的位置是否在某个dom里面 * @param {string} domId * @return {*} */ export declare const useClickOutSide: (domId: string) => boolean; /** * @description: 发送验证码自定义hooks * @param {number} _seconds 多少秒后重新发送 * @param {function} getAsyncCallBack 获取验证码的异步请求 Promise ture代码发送成功 false发送失败 * @param {string} _codeTips 获取验证码的提示文字 * @return {*} */ export declare const useGetVerificationCode: (_seconds: number, getAsyncCallBack: () => Promise, _codeTips?: string) => { /**发送验证码按钮是否可以点击 */ canClick: boolean; /**发送验证码按钮文字;可以通过surplusTime、canClick自定义文字 */ codeTips: string; /**发送验证码事件 */ handleClickVerificationCode: () => Promise; /**剩余倒计时 是响应式数据 需要通过 surplusTime.current 获取数据 */ surplusTime: React.MutableRefObject; /**是否正在获取验证码 */ isSending: boolean; }; /** * * @returns proTable 多选框 */ export declare const useTableSelect: () => { setselectedRowKeys: React.Dispatch>; selectedRowKeys: React.Key[]; privateRowSelection: TableRowSelection; };