sveltekit-superforms-5
Version:
<p align="center"> <img src="https://github.com/ciscoheat/sveltekit-superforms/raw/main/logo.svg" width="150px" align="center" alt="Superforms logo" /> <h1 align="center">Superforms 💥</h1> <p align="center">Making SvelteKit forms a pleasure to use!
14 lines (13 loc) • 460 B
TypeScript
import type { SuperStruct } from '../superStruct.js';
import type { JSONSchema } from './index.js';
export type InputConstraint = Partial<{
pattern: string;
min: number | string;
max: number | string;
required: boolean;
step: number | 'any';
minlength: number;
maxlength: number;
}>;
export type InputConstraints<T> = SuperStruct<T, InputConstraint>;
export declare function constraints<T>(schema: JSONSchema): InputConstraints<T>;