mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
29 lines
580 B
TypeScript
29 lines
580 B
TypeScript
// Type definitions for is-my-json-valid
|
|
// Project: https://github.com/mafintosh/is-my-json-valid
|
|
// Definitions by: kruncher <https://github.com/kruncher>
|
|
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
|
|
|
|
|
|
interface ValidationError {
|
|
field: string;
|
|
message: string;
|
|
value: any;
|
|
type: string;
|
|
}
|
|
|
|
interface ValidateFunction {
|
|
(data: any): boolean;
|
|
|
|
errors: ValidationError[];
|
|
}
|
|
|
|
interface Validator {
|
|
(schema: any, options?: any): ValidateFunction;
|
|
|
|
filter(schema: any): any;
|
|
}
|
|
|
|
declare var validator: Validator;
|
|
export = validator;
|