UNPKG

computed-types

Version:

Runtime validation types for TypeScript.

19 lines (18 loc) 1.23 kB
import Validator, { ValidatorProxy } from './Validator'; import { StringValidator } from './string'; import { ErrorLike } from './schema/errors'; import FunctionType, { FunctionParameters } from './schema/FunctionType'; import { NumberValidator } from './number'; export declare class DateValidator<P extends FunctionParameters = [Date]> extends Validator<FunctionType<Date, P>> { toISOString(...args: Parameters<Date['toISOString']>): ValidatorProxy<StringValidator<P>>; getTime(...args: Parameters<Date['getTime']>): ValidatorProxy<NumberValidator<P>>; min(min: Date, error?: ErrorLike<[Date]>): ValidatorProxy<this>; max(max: Date, error?: ErrorLike<[Date]>): ValidatorProxy<this>; gte: (min: Date, error?: ErrorLike<[Date]> | undefined) => ValidatorProxy<this>; lte: (max: Date, error?: ErrorLike<[Date]> | undefined) => ValidatorProxy<this>; gt(boundary: Date, error?: ErrorLike<[Date]>): ValidatorProxy<this>; lt(boundary: Date, error?: ErrorLike<[Date]>): ValidatorProxy<this>; between(min: Date, max: Date, error?: ErrorLike<[Date]>): ValidatorProxy<this>; } declare const DateType: ValidatorProxy<DateValidator<[input: Date]>, FunctionType<Date, [input: Date]>>; export default DateType;