Improve z-schema.d.ts (#9427)

- add `validateSchema` function to the definitions.
This commit is contained in:
Dhananjay Balan
2016-05-26 22:45:38 +09:00
committed by Masahiro Wakame
parent 3a5e413626
commit e8377d3d50
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -21,6 +21,7 @@ var schema: any = {
},
};
validator.validateSchema(schema);
validator.validate(json, schema);
validator.validate(json, schema, function (err: any, valid: boolean) {
if (err) {
+6
View File
@@ -39,6 +39,12 @@ declare namespace ZSchema {
export class Validator {
constructor(options: Options);
/**
* @param schema - JSON object representing schema
* @returns {boolean} true if schema is valid.
*/
validateSchema(schema: any): boolean;
/**
* @param json - either a JSON string or a parsed JSON object
* @param schema - the JSON object representing the schema