UNPKG

ts-cast

Version:
4 lines (3 loc) 438 B
import { CasterFn, ValidationResult, ErrorMessage, NonEmptyArray } from './types'; export declare const validate: <T>(casterFn: CasterFn<T>) => (value: unknown, context?: string) => ValidationResult<T>; export declare const validation: <T, Valid, Invalid>(casterFn: CasterFn<T>, invalidFactory: (errors: NonEmptyArray<ErrorMessage>) => Invalid, validFactory: (value: T) => Valid) => (value: unknown, context?: string) => Valid | Invalid;