UNPKG

@resk/core

Version:

An innovative TypeScript framework that empowers developers to build applications with a fully decorator-based architecture for efficient resource management. By combining the power of decorators with a resource-oriented design, DecorRes enhances code cla

21 lines (20 loc) 745 B
import { IPrimitive } from "../../types"; export declare const IsEnum: (ruleParameters: IPrimitive[]) => PropertyDecorator; declare module "../types" { interface IValidatorRulesMap<Context = unknown> { /** * ### Enum Rule * * Validates that the field match one of the following value, passed throght rulesParams * * * @param options - Validation options with rule parameters * @param options.ruleParams - Array containing enum values * @returns Promise resolving to true if valid, rejecting with error message if invalid * * @since 1.25.13 * @public */ Enum: IValidatorRuleParams<Array<IPrimitive>, Context>; } }