UNPKG

@ne1410s/codl

Version:

Indulge your apps with codl: a component model library

28 lines (27 loc) 1.15 kB
import 'reflect-metadata'; import { Ctor } from '../../types'; import { ValidationSummary } from './models'; /** Reflects validation decoration. */ export declare abstract class ReflectValidation { /** * Performs validation - for objects with decorated members. * @param target The object to validate. * @param type The strong type (to supply prototype data). */ static validate<T extends Object>(target: Object, type?: Ctor<T>): ValidationSummary; /** * Gets all available tests and their associated validator. There is expected * duplication where one validator is used to perform multiple tests. */ private static getValidators; /** Gets the validator function for a given key. */ private static getValidator; /** Prepares a sequence of validation instructions. */ private static getTestInstructions; /** Reduces a full set of instructions into a condensed test plan. */ private static prepareTestPlan; /** Executes test plan, mapping to a result. */ private static executeTestPlan; /** Summarises a sequence of results. */ private static summarise; }