import { FormGroup } from '@angular/forms'; import { TranslateService } from './translate.service'; import * as i0 from "@angular/core"; /** * Configuration options for form validation */ interface ValidationOptions { /** * When true, displays a warning message when an input reaches its maximum length. * This helps users know they've reached the character limit for a field. * Default: false */ showMaxLengthWarning?: boolean; /** * When true, immediately marks all form controls as "dirty", causing validation * errors to display right away without waiting for user interaction. * Use this when you want to show all validation errors at once, such as after * a form submission attempt. * Default: false */ markFieldsAsDirty?: boolean; } export declare class FormValidatorService { private translationService; private translations; constructor(translationService: TranslateService); /** * Sets up form validation with visual feedback for all controls in the form * * @param form The Angular FormGroup to validate * @param options Configuration options: * - markFieldsAsDirty: When true, immediately shows all validation errors without waiting for user interaction * - showMaxLengthWarning: When true, shows a warning when an input field reaches its maximum character length */ validateForm(form: FormGroup, options?: ValidationOptions): void; /** * Validates a single form field and updates UI accordingly * @param controlName Form control name * @param form The form containing the control * @param showMaxLengthWarning Whether to show warning when max length is reached */ validateField(controlName: string, form: FormGroup, showMaxLengthWarning?: boolean): void; /** * Creates a message element for validation feedback */ private createMessageElement; /** * Removes existing validation messages for a control */ private removeExistingMessages; /** * Handles the display of validation errors */ handleErrorState(errorElement: HTMLSpanElement, controlName: string, inputElement: HTMLInputElement, form: FormGroup, parentElement: HTMLElement | null): void; /** * Handles the display of valid state and max length warnings */ handleValidState(errorElement: HTMLSpanElement, inputElement: HTMLInputElement, warningElement: HTMLSpanElement, parentElement: HTMLElement | null, controlName: string, form: FormGroup, showMaxLengthWarning?: boolean): void; /** * Checks if input has reached its maximum length */ private isMaxLengthReached; /** * Displays max length warning message */ displayMaxLengthWarning(warningElement: HTMLSpanElement, parentElement: HTMLElement | null, controlName: string): void; /** * Prioritizes and returns the appropriate error message */ getErrorMessage(errors: string[]): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export {};