@vinejs/compiler
Version:
Low level compiler for VineJS validator
25 lines (24 loc) • 749 B
TypeScript
import { ValidationNode } from '../../types.js';
/**
* Options accepts by the validation script
*/
type ValidationOptions = {
bail: boolean;
variableName: string;
validations: ValidationNode[];
/**
* Drop missing conditional check regardless of whether
* rule is implicit or not
*/
dropMissingCheck: boolean;
/**
* The expression to use for performing the existence check.
* Defaults to "item.isDefined"
*/
existenceCheckExpression?: string;
};
/**
* Returns JS fragment for executing validations for a given field.
*/
export declare function defineFieldValidations({ bail, validations, variableName, dropMissingCheck, existenceCheckExpression, }: ValidationOptions): string;
export {};