@stacksjs/ts-validation
Version:
A simple TypeScript starter kit using Bun.
16 lines • 654 B
TypeScript
import { BaseValidator } from './base';
import type { IsIntOptions, NumberValidatorType, ValidationNames } from '../types';
// Export a function to create number validators
export declare function number(): NumberValidator;
export declare class NumberValidator extends BaseValidator<number> implements NumberValidatorType {
name: ValidationNames;
constructor();
min(min: number): this;
max(max: number): this;
length(length: number): this;
integer(options?: IsIntOptions): this;
positive(): this;
negative(): this;
divisibleBy(divisor: number): this;
custom(fn: (value: number | null | undefined) => boolean, message: string): this;
}