@steveesamson/microform
Version:
`microform` is a tiny library for managing forms in `svelte/sveltekit`.
21 lines (20 loc) • 988 B
TypeScript
import type { ValidateArgs, ValidatorType, ValidatorMap, FormErrors, FormValues } from './types.js';
export declare const IS_REQUIRED = "required";
export declare const IS_EMAIL = "email";
export declare const IS_URL = "url";
export declare const IS_IP = "ip";
export declare const IS_INTEGER = "integer";
export declare const IS_NUMBER = "number";
export declare const IS_ALPHA = "alpha";
export declare const IS_ALPHANUM = "alphanum";
export declare const IS_MIN_LEN = "minlen";
export declare const IS_MAX_LEN = "maxlen";
export declare const IS_LEN = "len";
export declare const IS_MIN = "min";
export declare const IS_MAX = "max";
export declare const IT_MATCHES = "match";
export declare const IS_FILE_SIZE_MB = "file-size-mb";
export declare const useValidator: (errors: FormErrors, values: FormValues, validators?: ValidatorMap<ValidatorType>) => {
validate: ({ name, value, validations, node }: ValidateArgs) => Promise<void>;
validators: ValidatorMap<ValidatorType>;
};