UNPKG

@cowwoc/requirements

Version:

A fluent API for enforcing design contracts with automatic message generation.

22 lines (21 loc) 1.22 kB
import { type BooleanValidator, type Configuration, type ValidationFailure, type ApplicationScope, AbstractValidator, ValidationTarget } from "../internal.mjs"; /** * Default implementation of `BooleanValidator`. */ declare class BooleanValidatorImpl<T extends boolean | undefined | null> extends AbstractValidator<T> implements BooleanValidator<T> { /** * @param scope - the application configuration * @param configuration - the validator configuration * @param name - the name of the value * @param value - the value * @param context - the contextual information set by a parent validator or the user * @param failures - the list of validation failures * @throws TypeError if `name` is `undefined` or `null` * @throws RangeError if `name` contains whitespace, or is empty * @throws AssertionError if `scope`, `configuration`, `value`, `context` or `failures` are null */ constructor(scope: ApplicationScope, configuration: Configuration, name: string, value: ValidationTarget<T>, context: Map<string, unknown>, failures: ValidationFailure[]); isTrue(): this; isFalse(): this; } export { BooleanValidatorImpl };