UNPKG

datatypes-validation

Version:

![](https://img.shields.io/npm/v/datatypes-validation.svg) ![](https://img.shields.io/npm/dm/datatypes-validation.svg) ![](coverage/badge-lines.svg) ![](coverage/badge-functions.svg) ![](coverage/badge-statements.svg) ![](coverage/badge-branches.svg)

26 lines 1.4 kB
import { Field } from "../data/Field"; import { Rules } from "../data/Rules/Rules"; import { IFieldsObject } from "./FieldInterface"; export declare type IRuleFunction = (field: Field, fields?: IFieldsObject) => Promise<IFieldsObject | void>; export interface IRulesSchema { [key: string]: Rules | IRulesSchema; } export declare type IRuleConditionalFunction = (field: Field, fields: IFieldsObject) => Promise<IFieldsObject>; export declare type IRuleConditionalCallbackArgSync = (fields: IFieldsObject) => Rules; export declare type IRuleConditionalCallbackArgAsync = (fields: IFieldsObject) => Promise<Rules>; export declare type IRuleConditionalCallbackArg = IRuleConditionalCallbackArgSync | IRuleConditionalCallbackArgAsync; export interface IRulesObject { [key: string]: IRuleFunction | IRuleConditionalFunction; } export interface IRuleOptions { longMessage?: string; shortMessage?: string; } export interface IDateRuleOptions extends IRuleOptions { mask?: "BR" | "EN"; format?: string; withTime?: boolean; } export declare type IRulesTypesString = "required" | "objectOf" | "string" | "email" | "equalTo" | "conditional" | "arrayOf" | "date" | "number" | "safeNumber" | "custom" | "alternatives" | "minLength" | "maxLength"; export declare type IRulesErrorTypes = IRulesTypesString | "invalidValue" | "dateFormat"; //# sourceMappingURL=RulesInterface.d.ts.map