signal-template-forms
Version:
A powerful, type-safe Angular forms library built with signals, providing reactive form management with excellent developer experience and performance.
12 lines (11 loc) • 972 B
TypeScript
import { type MetaValidatorFn, type SignalValidatorFn } from '../models/signal-form.model';
export declare class SignalValidators {
static required<TModel, K extends keyof TModel = any>(message?: string): MetaValidatorFn<TModel[K], TModel>;
static min<T extends number | null, TModel>(min: number, msg?: string): SignalValidatorFn<T, TModel>;
static max<T extends number, TModel>(max: number, msg?: string): SignalValidatorFn<T, TModel>;
static minLength<T extends string, TModel>(min: number, msg?: string): SignalValidatorFn<T, TModel>;
static maxLength<T extends string, TModel>(max: number, msg?: string): SignalValidatorFn<T, TModel>;
static isPositive<T extends number, TModel>(msg?: string): SignalValidatorFn<T, TModel>;
static hasValue<TModel, K extends keyof TModel>(fieldName: K): SignalValidatorFn<TModel[K], TModel>;
static matchField<TModel, TValue>(otherKey: keyof TModel, msg?: string): SignalValidatorFn<TValue, TModel>;
}