import { InjectionToken } from '@angular/core';
import type { FormGroupDirective, NgControl } from '@angular/forms';
/** State of a form control, usually a validation error.
 *
 * Example: `{ key: 'pattern', data: {requiredPattern: '^[a-zA-Z ]*$', actualValue: '1'} }`
 */
export interface ControlState {
    key: string;
    data?: unknown;
}
/** A function for when to display errors — on change (immediately), control blur, or form submit.
 *
 * The first matching error from a control's validators array will be selected (ordering matters).
 */
export type ErrorMatcherFn = (control: NgControl, form: FormGroupDirective) => ControlState | null;
/** Sets of triggers to display errors.
 *
 * The strings are validator error keys.
 *
 * Example: `Validators.maxLength` => `'maxlength'`
 *
 * https://github.com/angular/angular/blob/d64ee6cc9decc83c58ba8e90780e9afe69326b86/packages/forms/src/validators.ts#L339
 * */
interface ErrorMatches {
    onChange?: string[];
    onBlur?: string[];
    onSubmit?: string[];
}
/** Base matches for a text input */
export declare const NX_BASE_ERROR_MATCHES: {
    onChange: string[];
    onBlur: string[];
    onSubmit: string[];
};
export declare const NxDefaultErrorMatchToken: InjectionToken<ErrorMatches>;
/** Factory to produce error matcher functions.
 *
 * Defaults to the base set of matches for a text input. Multiple sets will be composed.
 *
 * Matching should follow the general pattern:
 * 1. Show errors that will not be resolved by further input immediately.
 *    This includes forbidden value and max length errors.
 * 2. Show errors that can be caused by incomplete user input on blur.
 *    This includes pattern and min length errors.
 * 3. Show required errors and errors that involve multiple inputs on submit.
 *    This includes unique value errors.
 */
export declare function errorMatcherFactory(trigger: ErrorMatches, ...others: ErrorMatches[]): ErrorMatcherFn;
export {};
