import { Validated, CombinedValidated, ValueOfValidated, ErrorOfValidated } from './Validated'; import { IsUndefined } from './Undefineds'; export declare class ValidationRule { readonly apply: (p: P, ...meta: M) => Validated; static compose(left: ValidationRule, right: ValidationRule): ValidationRule; static combine; }>(o: O): ValidationRule, ErrorOfValidated>>, ValueOfValidated>>, MetaOfCombinedValidationRule>; static test(predicate: (p: P, ...meta: M) => Validated): ValidationRule; static create(apply: (p: P, ...meta: M) => Validated): ValidationRule; constructor(apply: (p: P, ...meta: M) => Validated); map(fn: (a: A) => B): ValidationRule; mapError(fn: (e: E) => F): ValidationRule; composeWith(other: ValidationRule): ValidationRule; filter(pred: (a: A) => boolean, toError: (error: A) => F): ValidationRule; recover(f: (error: E) => B): ValidationRule; orElse(alternative: ValidationRule): ValidationRule

; mapMeta(fn: (mm: MM) => M): ValidationRule; mapInput(fn: (q: Q) => P): ValidationRule; upcastMeta(): ValidationRule; required(): ValidationRule

; optional(): ValidationRule

; many(): ValidationRule, A[], M>; of(this: ValidationRule, validationRule: ValidationRule): ValidationRule, C[], M>; test(...validationRules: Array>): ValidationRule; } declare type UnionToIntersection = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; declare type ParameterOfValidationRule = V extends ValidationRule ? P : never; declare type ParameterOfCombinedValidationRule = { [K in keyof O]: ParameterOfValidationRule; }; declare type MetaOfValidationRule = V extends ValidationRule ? M : never; declare type MetaOfCombinedValidationRule = UnionToIntersection<({ [K in keyof O]: MetaOfValidationRule; })[keyof O]> & any[]; declare type ErrorOfValidationRule = V extends ValidationRule ? E : never; declare type ValueOfValidationRule = V extends ValidationRule ? A : never; declare type ValidatedOfCombinedValidationRule = { [K in keyof O]: Validated, ValueOfValidationRule>; }; export {};