veffect
Version:
powerful TypeScript validation library built on the robust foundation of Effect combining exceptional type safety, high performance, and developer experience. Taking inspiration from Effect's functional principles, VEffect delivers a balanced approach tha
17 lines (16 loc) • 824 B
TypeScript
import { Schema, RefinableSchema, TransformableSchema, DefaultableSchema, NullableSchema } from '../types';
/**
* Array schema interface
*/
export interface ArraySchema<T> extends Schema<T[]>, RefinableSchema<T[], ArraySchema<T>>, TransformableSchema<T[], ArraySchema<T>>, DefaultableSchema<T[], ArraySchema<T>>, NullableSchema<T[], ArraySchema<T>> {
readonly _tag: 'ArraySchema';
readonly elementSchema: Schema<T>;
readonly minLength: (min: number, message?: string) => ArraySchema<T>;
readonly maxLength: (max: number, message?: string) => ArraySchema<T>;
readonly length: (length: number, message?: string) => ArraySchema<T>;
readonly nonEmpty: (message?: string) => ArraySchema<T>;
}
/**
* Create an array schema
*/
export declare function array<T>(elementSchema: Schema<T>): ArraySchema<T>;