UNPKG

vulcain-corejs

Version:
20 lines (19 loc) 750 B
import { Domain, SchemaDescription, ErrorMessage } from './schema'; import { IContainer } from '../di/resolvers'; import { RequestContext } from '../servers/requestContext'; export declare class Validator { private domain; private container; constructor(domain: Domain, container: IContainer); validateAsync(ctx: RequestContext, schemaDesc: SchemaDescription, val: any): Promise<ErrorMessage[]>; private validateReferenceAsync(ctx, formatContext, schema, val, entity); private validatePropertyAsync(ctx, formatContext, schema, val, entity); /** * Format an error message * @param message * @param ctx * @returns {string} * @private */ private __formatMessage(message, ctx, validator?); }