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