import { FormConfig, PaymentProvider } from '../lib/types'; type ValidationRule = (value: any, params: any[]) => true | string; export interface ValidationResult { isValid: boolean; errors: string[]; } interface ValidateInput { name: string; validate: (bypass?: boolean) => ValidationResult; updateRule: (ruleString: string) => void; destroy: () => void; } export declare function updateValidationMessages(messages: Record): false | undefined; export declare class Validator { private rules; addRule(field: string, rule: ValidationRule): this; removeRule(field: string): this; clearRules(): this; validate(value: any, rules: string): ValidationResult; } export declare const ValidationRules: { required(value: any): string | true; minLength(value: string, params: any[]): string | true; email(value: string): string | true; expirationDate(value: string): string | true; card(value: string): string | true; luhn(value: string): string | true; length(value: string, params: any[]): string | true; min(value: string, params: any[]): string | true; phone(value: string): string | true; dLocalIdentity(value: string, params: any[]): string | true; }; export declare let validatorInstance: Validator | null; export declare function validateInput(input: HTMLInputElement, options?: { validateOnBlur?: boolean; onValidate?: (result: ValidationResult) => void; }): ValidateInput; export declare function checkboxValidation(input: HTMLInputElement, result: ValidationResult): void; export declare function inputValidation(input: HTMLInputElement, result: ValidationResult): void; export declare function validateForm(params: { providerKey: PaymentProvider; config: FormConfig; skipBillingFields?: boolean; validations: Record>; }): { isValid: boolean; errors: { name: string; result: ValidationResult; }[]; }; /** * Detects the provider from the focused element (e.g. Enter pressed in an input). * Returns undefined when focus says nothing about the form, e.g. WebKit does not * focus buttons on tap, so focus stays on body after the Apple Pay sheet closes. * The caller must then use the clicked button's provider, otherwise a wallet tap * is sent as an empty credit card payment. */ export declare function detectAndValidateForm(params: { config: FormConfig; validations: Record>; }): PaymentProvider | undefined; export {};