UNPKG

2.25 kBTypeScriptView Raw
1import { ValidationError } from './validation/ValidationError';
2import { ValidatorOptions } from './validation/ValidatorOptions';
3import { ValidationSchema } from './validation-schema/ValidationSchema';
4export * from './container';
5export * from './decorator/decorators';
6export * from './decorator/ValidationOptions';
7export * from './validation/ValidatorConstraintInterface';
8export * from './validation/ValidationError';
9export * from './validation/ValidatorOptions';
10export * from './validation/ValidationArguments';
11export * from './validation/ValidationTypes';
12export * from './validation/Validator';
13export * from './validation-schema/ValidationSchema';
14export * from './register-decorator';
15export * from './metadata/MetadataStorage';
16/**
17 * Validates given object.
18 */
19export declare function validate(object: object, validatorOptions?: ValidatorOptions): Promise<ValidationError[]>;
20/**
21 * Validates given object by a given validation schema.
22 */
23export declare function validate(schemaName: string, object: object, validatorOptions?: ValidatorOptions): Promise<ValidationError[]>;
24/**
25 * Validates given object and reject on error.
26 */
27export declare function validateOrReject(object: object, validatorOptions?: ValidatorOptions): Promise<void>;
28/**
29 * Validates given object by a given validation schema and reject on error.
30 */
31export declare function validateOrReject(schemaName: string, object: object, validatorOptions?: ValidatorOptions): Promise<void>;
32/**
33 * Performs sync validation of the given object.
34 * Note that this method completely ignores async validations.
35 * If you want to properly perform validation you need to call validate method instead.
36 */
37export declare function validateSync(object: object, validatorOptions?: ValidatorOptions): ValidationError[];
38/**
39 * Validates given object by a given validation schema.
40 * Note that this method completely ignores async validations.
41 * If you want to properly perform validation you need to call validate method instead.
42 */
43export declare function validateSync(schemaName: string, object: object, validatorOptions?: ValidatorOptions): ValidationError[];
44/**
45 * Registers a new validation schema.
46 */
47export declare function registerSchema(schema: ValidationSchema): void;