import type { Rule as AntdRule, RuleObject as AntdRuleObject } from 'antd/lib/form'; import type { FormInstance, ValidateMessages } from 'rc-field-form/lib/interface'; import { schema, validator } from '@baic/yolk'; export type ValidatorKeys = 'required' | 'mobile' | 'idcard' | 'cn' | 'en' | 'email' | 'int' | 'float' | 'number' | 'url' | 'trim' | 'len' | 'maxLen' | 'minLen' | 'max' | 'min' | 'maxEqual' | 'minEqual' | 'checked' | 'maxDecimalDigits' | 'minDecimalDigits' | 'maxEqualDecimalDigits' | 'minEqualDecimalDigits' | 'ip' | 'emoji' | 'nonEmoji'; export type ValidatorLibs = { [name in ValidatorKeys]: ValidatorBooleanFunction; }; export type ValidatorRuleObject = AntdRuleObject | ((form: FormInstance, lib: { validator: typeof validator; schema: typeof schema; }) => ValidatorRule); export type ValidatorRule = ValidatorRuleObject & { [name in ValidatorKeys]?: any; } & { message?: string; }; export type ValidatorRules = ValidatorKeys | ValidatorRule | (ValidatorKeys | ValidatorRule)[]; export type ValidatorBooleanFunction = (v: any, rv?: any) => boolean; export type ValidatorMessages = { [name in ValidatorKeys]: string | ((v: any, rv: any) => string); }; export declare const defaultValidateMessages: ValidateMessages; export declare const validateMessages: ValidatorMessages; export declare function wrapRules(rules?: ValidatorRules): [AntdRule[], boolean, string];