import { FormItem, FormType, FunBol, PowerfulFormData } from '../index'; import { FormItemRule } from 'element-plus'; import { LangKey } from '../locale/lang'; /** * 校验规则 */ export declare const verify: { phone: { pattern: RegExp; message: LangKey; trigger: string; }; email: { type: string; message: LangKey; trigger: string; }; code: { pattern: RegExp; message: LangKey; trigger: string; }; https: { pattern: RegExp; message: LangKey; trigger: string; }; ip: { pattern: RegExp; message: LangKey; trigger: string; }; number: { pattern: RegExp; message: LangKey; trigger: string; }; english: { pattern: RegExp; message: LangKey; trigger: string; }; chinese: { pattern: RegExp; message: LangKey; trigger: string; }; }; export declare const verifyFormItemRule: { [s: string]: FormItemRule; }; /** * @description 类型保护 * @see https://www.tslang.cn/docs/handbook/advanced-types.html 搜索 “自定义类型保护” * @param {T} obj 值,它必须是联合类型 * @param {(obj: T) => boolean} cb 回调函数,返回一个布尔值 * @example * const a = [] | string * a.push() // 报错 * if (isTypeProtect(a, (a) => Array.isArray(a))) { * a.push() // 正常 * } * @returns {boolean} */ export declare const isTypeProtect: (obj: T, cb: (obj: T) => boolean) => obj is P; /** * 匹配组件 * @param {Exclude} type 类型 * @returns 组件名称 */ export declare const matchComponents: (type: Exclude) => string; /** * 是否是boolean 还是 fun 函数类型 * @param val 值 * @param params val 为函数类型时 参数 * @returns {boolean} true 为禁用 */ export declare const isBolOrFun: (val: FunBol, params: { formData: PowerfulFormData["formData"]; formItem: FormItem; index: number; }) => boolean; /** * 清除:和 空格 */ export declare const clearSymbol: (v: string | undefined) => string | undefined;