@stacksjs/ts-validation
Version:
A simple TypeScript starter kit using Bun.
12 lines • 509 B
TypeScript
import { BaseValidator } from './base';
import type { JsonValidatorType, ValidationNames } from '../types';
// Export a function to create JSON validators
export declare function json(): JsonValidator;
export declare class JsonValidator extends BaseValidator<string> implements JsonValidatorType {
name: ValidationNames;
constructor();
min(min: number): this;
max(max: number): this;
length(length: number): this;
custom(fn: (value: string | null | undefined) => boolean, message: string): this;
}