@stacksjs/ts-validation
Version:
A simple TypeScript starter kit using Bun.
10 lines • 509 B
TypeScript
import { BaseValidator } from './base';
import type { EnumValidatorType, ValidationNames } from '../types';
export declare function enum_(allowedValues: readonly string[]): EnumValidator;
export declare class EnumValidator extends BaseValidator<string> implements EnumValidatorType {
name: ValidationNames;
private allowedValues: readonly string[];
constructor(allowedValues: readonly string[]);
getAllowedValues(): readonly string[];
custom(fn: (value: string) => boolean, message: string): this;
}