import * as i0 from '@angular/core'; import { OnInit, PipeTransform, ModuleWithProviders, InjectionToken, Provider } from '@angular/core'; import { ValidationErrors } from '@angular/forms'; import * as i1 from '@angular/common'; type JsonMessage = Record | Record>; type ErrorWhenType = 'dirty' | 'invalid' | 'pristine' | 'touched' | 'untouched'; type ErrorPriority = string; interface ClassNames { control: string; message: string; } interface ErrorMessageConfig { validationsPrefix?: string; patternsPrefix?: string; errorMessages?: Record>; errorPriority?: ErrorPriority[]; } /** The provider-resolved shape of {@link ErrorMessageConfig}: every field defaulted. */ interface ResolvedErrorMessageConfig { validationsPrefix: string; patternsPrefix: string; errorMessages: Record>; errorPriority: ErrorPriority[]; } declare class NgxErrorMessageDirective implements OnInit { readonly fieldName: i0.InputSignal; readonly classNames: i0.InputSignal; readonly patternKey: i0.InputSignal; readonly when: i0.InputSignal; readonly errorPriority: i0.InputSignal; private readonly ngControl; private readonly elementRef; private readonly renderer; private readonly container; private readonly errorMessageService; private readonly destroyRef; private readonly revision; private componentRef?; readonly hasError: i0.Signal; readonly message: i0.Signal; constructor(); ngOnInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } declare class NgxErrorMessageService { private readonly config; private readonly translator; getErrorMessage(controlErrors: ValidationErrors, patternKey?: string, fieldName?: string, errorPriority?: ErrorPriority[]): string; private pickErrorKey; private patternMatchExpression; private getValueByRegexFromObject; private interpolateMessage; private getNestedMessage; private getMessage; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** For consumers rendering messages manually (e.g. via `exportAs`); the directive itself calls `NgxErrorMessageService` directly. */ declare class NgxErrorMessagePipe implements PipeTransform { private readonly errorMessageService; transform(value: ValidationErrors | null, patternKey?: string, fieldName?: string, errorPriority?: ErrorPriority[]): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } declare class NgxErrorMessageComponent { readonly message: i0.InputSignal; readonly messageClass: i0.InputSignal; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } /** * @deprecated Use `provideNgxErrorMessage()` instead. Will be removed in a * future major version. Note: `NgxErrorMessageModule` alone doesn't wire up * `@ngx-translate/core` - add `withNgxTranslate()` (from the * `ngx-error-message/ngx-translate` secondary entry point) to your own * providers if you need it. */ declare class NgxErrorMessageModule { static forRoot(config?: ErrorMessageConfig): ModuleWithProviders; static forChild(config?: ErrorMessageConfig): ModuleWithProviders; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare const ERROR_MESSAGE_CONFIG: InjectionToken; /** * Resolves a translation key to a message. The default implementation is a * zero-dependency no-op; `withNgxTranslate()` from the * `ngx-error-message/ngx-translate` secondary entry point overrides it with * an `@ngx-translate/core`-backed adapter. * * `translate()` is a plain synchronous method - implementations that read * signals while computing their result get reactivity for free, since * callers only ever invoke it from inside the directive's `computed()`. */ interface NgxErrorMessageTranslator { translate(key: string, params?: Record): string; } declare const NGX_ERROR_MESSAGE_TRANSLATOR: InjectionToken; /** * Composable, like `provideHttpClient(withXhr(), ...)`: * `provideNgxErrorMessage(withErrorMessageConfig({...}), withNgxTranslate())`. */ declare function provideNgxErrorMessage(...features: Provider[][]): Provider[]; declare function withErrorMessageConfig(config: ErrorMessageConfig): Provider[]; declare const regEx: { phoneNumber: RegExp; websiteUrl: RegExp; numeric: RegExp; smallLetters: RegExp; capitalLetters: RegExp; alphabet: RegExp; alphaNumeric: RegExp; ip: RegExp; }; declare const DEFAULT_ERROR_PRIORITY: string[]; export { DEFAULT_ERROR_PRIORITY, ERROR_MESSAGE_CONFIG, NGX_ERROR_MESSAGE_TRANSLATOR, NgxErrorMessageComponent, NgxErrorMessageDirective, NgxErrorMessageModule, NgxErrorMessagePipe, NgxErrorMessageService, provideNgxErrorMessage, regEx, withErrorMessageConfig }; export type { ClassNames, ErrorMessageConfig, ErrorPriority, ErrorWhenType, JsonMessage, NgxErrorMessageTranslator, ResolvedErrorMessageConfig };