UNPKG

nestjs-feature-config

Version:

A powerful NestJS Dynamic Module for type-safe feature configuration management with conditional validation. Build robust, scalable applications with validated configuration schemas that adapt to your deployment environment.

29 lines 1.43 kB
import { ValidationArguments, ValidationOptions, ValidatorConstraintInterface } from 'class-validator'; export type ConditionFunction = (object: any) => boolean; export declare enum LogicalOperator { AND = "AND", OR = "OR" } export interface IsRequiredIfOptions { condition: ConditionFunction | ConditionFunction[]; operator?: LogicalOperator; message?: string; } export declare class IsRequiredIfConstraint implements ValidatorConstraintInterface { validate(value: any, args: ValidationArguments): boolean; defaultMessage(args: ValidationArguments): string; private evaluateConditions; private isNotEmpty; } export declare function IsRequiredIf(options: IsRequiredIfOptions, validationOptions?: ValidationOptions): PropertyDecorator; export declare const ConditionHelpers: { propertyEquals: (propertyName: string, value: any) => ConditionFunction; propertyIn: (propertyName: string, values: any[]) => ConditionFunction; propertyIsTruthy: (propertyName: string) => ConditionFunction; propertyExists: (propertyName: string) => ConditionFunction; propertyMatches: (propertyName: string, pattern: RegExp) => ConditionFunction; and: (...conditions: ConditionFunction[]) => ConditionFunction; or: (...conditions: ConditionFunction[]) => ConditionFunction; not: (condition: ConditionFunction) => ConditionFunction; }; //# sourceMappingURL=is-required-if.decorator.d.ts.map