Interface Validator<This, Value>

Validator metadata type definition.

This interface define how a validator decorator will be stored in the metadata of the class definition.

interface Validator<This, Value> {
    id: number;
    metadata: DecoratorMetadataObject;
    name: string;
    options: ValidatorOptions;
    propertyName: keyof This;
    type: symbol;
    validator: ValidatorFunction<This, Value>;
}

Type Parameters

  • This
  • Value

Hierarchy

  • PropertyMetaDescriptor<This>
    • Validator

Properties

id: number

Unique ID

metadata: DecoratorMetadataObject

Metadata object to which this decorator is applied.

name: string

Name of the decorator.

propertyName: keyof This

Property name of the object the decorator is applied.

type: symbol

Type symbol

Function that perform the validation.