mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-26 11:12:19 +08:00
Added an interface for the object returned during synchronous validations.
This commit is contained in:
Vendored
+6
-2
@@ -61,6 +61,11 @@ declare module 'joi' {
|
||||
options?: ValidationOptions;
|
||||
}
|
||||
|
||||
export interface ValidationResult<T> {
|
||||
error: ValidationError;
|
||||
value: T;
|
||||
}
|
||||
|
||||
export interface SchemaMap {
|
||||
[key: string]: Schema;
|
||||
}
|
||||
@@ -461,8 +466,7 @@ declare module 'joi' {
|
||||
*/
|
||||
export function validate<T>(value: T, schema: Schema, callback: (err: ValidationError, value: T) => void): void;
|
||||
export function validate<T>(value: T, schema: Object, callback: (err: ValidationError, value: T) => void): void;
|
||||
export function validate<T>(value: T, schema: Schema, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void;
|
||||
export function validate<T>(value: T, schema: Object, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): void;
|
||||
export function validate<T>(value: T, schema: Object, options?: ValidationOptions, callback?: (err: ValidationError, value: T) => void): ValidationResult<T>;
|
||||
|
||||
/**
|
||||
* Converts literal schema definition to joi schema object (or returns the same back if already a joi schema object).
|
||||
|
||||
Reference in New Issue
Block a user