You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
svelte-tiny-validator/validator.d.ts

12 lines
478 B

import { Action } from 'svelte/action';
import { Writable } from 'svelte/store';
type Falsy = false | 0 | '' | null | undefined;
type Validator<T> = Action<HTMLElement, undefined> & Writable<T | Falsy> & { validate: (display?: boolean) => boolean };
export function validator<T = string>(chill?: boolean): Validator<T>;
export function validate(...validators: (Validator<any> | Falsy)[]): boolean;
export function reset(...validators: (Validator<any> | Falsy)[]): boolean;