type RuleKey = 'password' | 'phone' | 'email' | 'en' | 'enname'

/**
* 验证规则
*/
export type ValidateRules = {
    [key in RuleKey]: {
        reg: RegExp,
        message: string,
    }
}

/**
* 表单规则
*/
export type FormRules<T = unknown> = {
    [key in keyof T]?: Rules[]
}

/**
* 数据规则
*/
export type Rules = {
    rule?: keyof ValidateRules,
    required?: boolean,
    type?: 'string' | 'number' | 'array',
    min?: number,
    max?: number,
    message?: string
}