@cowwoc/requirements
Version:
A fluent API for enforcing design contracts with automatic message generation.
23 lines (22 loc) • 1.43 kB
text/typescript
import { type Configuration, type ValidationFailure, type ApplicationScope, type ArrayValidator, AbstractCollectionValidator, ValidationTarget, Pluralizer, type UnsignedNumberValidator } from "../internal.mjs";
/**
* Default implementation of `ArrayValidator`.
*/
declare class ArrayValidatorImpl<T extends E[] | undefined | null, E> extends AbstractCollectionValidator<T, E> implements ArrayValidator<T, E> {
/**
* @param scope - the application configuration
* @param configuration - the validator configuration
* @param name - the name of the value
* @param value - the value
* @param pluralizer - the type of items in the array
* @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>, pluralizer: Pluralizer, context: Map<string, unknown>, failures: ValidationFailure[]);
isSorted(comparator: (first: unknown, second: unknown) => number): this;
size(): UnsignedNumberValidator;
}
export { ArrayValidatorImpl };