UNPKG

@cowwoc/requirements

Version:

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

26 lines (25 loc) 999 B
import { type ErrorBuilder, Configuration, type ValidationFailure } from "../internal.mjs"; declare class ValidationFailureImpl implements ValidationFailure { private readonly message; private readonly errorBuilder; private error; private readonly errorTransformer; private transformedError; /** * @param configuration - the validator's configuration * @param message - the failure message * @param errorBuilder - returns the error associated with the failure message * @throws AssertionError if: * <ul> * <li>Any of the arguments are `undefined` or `null`.</li> * <li>The error message contains leading or trailing whitespace, or is empty.</li> * </ul> */ constructor(configuration: Configuration, message: string, errorBuilder: ErrorBuilder); getMessage(): string; getType(): string; getError(): Error; private getTransformedError; toString(): string; } export { ValidationFailureImpl };