import { Fail, Runtype } from './runtype'; /** * Create a validation error for custom runtypes */ export declare function createError(msg: string): Fail; /** * Construct a custom runtype from a validation function. */ export declare function runtype(fn: (v: unknown) => T | Fail): Runtype; /** * Explicit validation result containing the wrapped result or error. */ export declare type ValidationResult = { ok: true; result: T; } | { ok: false; error: Fail; }; /** * Execute a runtype but do not throw Errors * * Return a ValidationResult instead. * When its an Error, use `getFormattedError` on it to get a well formatted * message for logging or reporting. * * Useful when writing your own runtypes and when the bad performance of * exceptions and try-catch for error handling is of concern. */ export declare function use(r: Runtype, v: unknown): ValidationResult;