export type ValidatorType = 'requirevalidator' | 'emailvalidator' | 'integervalidator' | 'positiveintegervalidator' | 'decimalvalidator' | 'urlvalidator' | 'regularexpressionvalidator'; export type ValidatorModel = { message: string; validationCssClass?: string | null; additionalAttributes?: Record; }; export type BaseValidator = { type: string; description?: string | null; model: ValidatorModel; jsPattern?: string; pattern?: string; }; export type SimplifiedValidator = { type: string; errorMessage: string; }; export type Validator = BaseValidator | SimplifiedValidator; export type FormFieldError = { validator: Validator; isValid: boolean; }; export declare const VALIDATION_PATTERNS: { readonly email: RegExp; readonly integer: RegExp; readonly positiveInteger: RegExp; readonly decimal: RegExp; }; export declare const extractErrorMessage: (validator: Validator) => string; export declare const extractValidatorType: (validator: Validator) => ValidatorType; export declare const validateField: (value: string, validators?: Validator[]) => FormFieldError[]; export declare const getErrorMessages: (errors: FormFieldError[]) => string[]; export declare const isFieldRequired: (validators?: Validator[]) => boolean; export declare const getHtmlValidationAttributes: (validators?: Validator[]) => Record; export declare const getFieldName: (field: { SubmissionFieldName?: string | null; Label?: string | null; }) => string; /** * Reads a `Validators` property. * * The CMS models it as free-form JSON, so it arrives as `unknown` and every * caller would otherwise repeat the same unchecked cast. */ export declare const toValidators: (value: unknown) => Validator[]; /** One choice in a choice or selection element. */ export type SelectionOption = { label: string; value: string; selected?: boolean; }; /** Reads the `Options` property of a choice or selection element. */ export declare const getSelectionOptions: (field: { Options?: unknown; }) => SelectionOption[];