UNPKG

altheia-async-data-validator

Version:

A very simple, fast and customizable async data validator

51 lines (50 loc) 1.01 kB
import { TypeBase } from './base'; import { LangList } from '../types/lang'; export declare const messages: LangList; /** * Date class */ export declare class TypeDate extends TypeBase { /** * Constructor */ constructor(); /** * Try to cast value * * @param {mixed} value * @return {Date|mixed} */ _cast(value: any): Date | any; /** * Test to validate the type of the value * * @return {this} */ typeof(): this; /** * Force a date to be a valid ISO-8601. * * @return {this} */ iso(): this; /** * Force a date to be a at least or bigger than value passed * * @param {Date} min * @return {this} */ min(min: Date): this; /** * Force a date to be less or equal than value passed * * @param {Date} max * @return {this} */ max(max: Date): this; } declare const def: { Class: typeof TypeDate; messages: LangList; }; export default def;