@stacksjs/ts-validation
Version:
A simple TypeScript starter kit using Bun.
15 lines • 577 B
TypeScript
import { NumberValidator } from './numbers';
import type { DoubleValidatorType, ValidationNames } from '../types';
// Export a function to create float validators
export declare function float(): DoubleValidator;
export declare class DoubleValidator extends NumberValidator implements DoubleValidatorType {
name: ValidationNames;
constructor();
min(min: number): this;
max(max: number): this;
length(length: number): this;
positive(): this;
negative(): this;
divisibleBy(divisor: number): this;
custom(fn: (value: number) => boolean, message: string): this;
}