import * as _angular_core from '@angular/core'; import { DoCheck } from '@angular/core'; import { AbstractControl, ValidatorFn } from '@angular/forms'; import { isInvalid } from '@masterteam/components'; declare class FieldValidation implements DoCheck { private readonly elementRef; readonly control: _angular_core.InputSignal | null>; readonly touched: _angular_core.InputSignalWithTransform; /** * Id the failing control points at with `aria-describedby`. Generated when * not supplied, so no caller has to pass anything for the wiring below to * work; override it only when a host needs a predictable id (a test, or a * second `aria-describedby` target it is composing itself). */ readonly messageId: _angular_core.InputSignal; private readonly fallbackMessageId; readonly resolvedMessageId: _angular_core.Signal; isInvalid: typeof isInvalid; /** Cached lookup — the control element never changes for a given field. */ private controlElement; private describedApplied; /** * Keep `aria-invalid` / `aria-describedby` on the field's own control in step * with the message below it. * * The message used to be loose text with no relationship to anything: a * screen-reader user heard the field, then — separately, later, if they kept * reading — an unattributed error (findings C-02, H-04). Wiring it here rather * than in each of the 23 field templates means every field that already * renders `mt-field-validation` gets it, including the ones whose control is * an input PrimeNG renders and the template cannot reach. * * `ngDoCheck` rather than an `effect` because `AbstractControl` validity is * not a signal — the template re-reads it every cycle, and so does this. */ ngDoCheck(): void; /** * Reserve the error-message line whenever the control can surface an error — * i.e. it has sync/async validators, or is already showing one. This keeps the * field's height constant so showing the error never pushes sibling fields or * the content below the row. Re-evaluated each change-detection cycle, so it * picks up validators that fields add asynchronously after init. */ shouldReserveSpace(): boolean; /** * The control this message belongs to: the first focusable element inside the * field component that hosts us. `undefined` means "not looked up yet", * `null` means "looked up and there is nothing to annotate" — a distinction * that matters, because the second case must not re-query every cycle. */ private resolveControlElement; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare const characterLimitValidator: (maxLength: number) => ValidatorFn; export { FieldValidation, characterLimitValidator };