declare type BaseType = { new (...args: any[]): any; } | true | "*"; interface TypeInfo { type?: TypeDescription; optional?: boolean; validate?: Function; shape?: Schema; element?: TypeDescription; values?: TypeDescription; } declare type ValueType = { value: any; }; declare type TypeDescription = BaseType | TypeInfo | ValueType | TypeDescription[]; declare type SimplifiedSchema = string[]; declare type NormalizedSchema = { [key: string]: TypeDescription; }; export declare type Schema = SimplifiedSchema | NormalizedSchema; export declare function isOptional(t: TypeDescription): Boolean; /** * Main validate function */ export declare function validate(obj: { [key: string]: any; }, spec: Schema): void; /** * Helper validate function, to get the list of errors. useful if one want to * manipulate the errors without parsing an error object */ export declare function validateSchema(obj: { [key: string]: any; }, schema: Schema): string[]; export declare function validateType(key: string, value: any, descr: TypeDescription): string | null; export {};