UNPKG

docschema

Version:

Schema declaration and validation library using JsDoc comments

55 lines (54 loc) 1.82 kB
export class DocSchemaValidator { /** * @returns {CheckResult} */ get lastError(): CheckResult; /** * @param {Ast} ast * @param {any} value * @param {boolean} [forceStrict] Force strict recursively * @returns {CheckResult} */ check(ast: Ast, value: any, forceStrict?: boolean): CheckResult; /** * @param {Ast} ast * @param {any} value * @param {boolean} [forceStrict] Force strict recursively * @returns {CheckResult} */ validate(ast: Ast, value: any, forceStrict?: boolean): CheckResult; /** * @param {Ast} ast * @param {any[]} args * @param {boolean} [forceStrict] Force strict recursively * @returns {CheckResult} */ checkFunctionArguments(ast: Ast, args: any[], forceStrict?: boolean): CheckResult; /** * @param {Ast} ast * @param {any[]} args * @param {boolean} [forceStrict] Force strict recursively * @returns {CheckResult} * @throws {ValidationError} * Throws ValidationError if the validation is not successful */ validateFunctionArguments(ast: Ast, args: any[], forceStrict?: boolean): CheckResult; /** * @param {Ast} ast * @param {any} value * @param {boolean} [forceStrict] Force strict recursively * @returns {CheckResult} */ checkReturns(ast: Ast, value: any, forceStrict?: boolean): CheckResult; /** * @param {Ast} ast * @param {any} value * @param {boolean} [forceStrict] Force strict recursively * @returns {CheckResult} * @throws {ValidationError | Error} * Throws ValidationError if the validation is not successful. * Throws Error if the input AST is not valid. */ validateReturns(ast: Ast, value: any, forceStrict?: boolean): CheckResult; #private; }