validlyjs
Version:
ValidlyJS is a lightweight, type-safe validation library inspired by Laravel's validation syntax
15 lines (14 loc) • 418 B
TypeScript
import { Rule } from "../types/interfaces.js";
export declare class StringBuilder {
protected rules: Rule[];
[key: string]: any;
constructor();
required(): this;
min(length: number): this;
max(length: number): this;
email(): this;
addRule(name: string): this;
custom(ruleName: string, ...params: any[]): this;
build(): Rule[];
}
export declare function string(): StringBuilder;