import { AfterContentInit, DestroyRef, OnDestroy } from '@angular/core';
import { NgControl } from '@angular/forms';
import { BaseComponent } from '../../base-component';
import { NxControlMessagesComponent as NxMessages } from '../control-messages/control-messages.component';
import { NxLabelComponent } from '../label/label.component';
import { ControlState, ErrorMatcherFn } from './error-state-matcher';
import { NxFormFieldControlDirective as NxControlDirective } from './form-field-control.directive';
import * as i0 from "@angular/core";
import * as i1 from "nx-shared";
import * as i2 from "../use-form-style.directive";
/** A component used to wrap a form control element and handle error states.
 *
 * Based on [Material form field](https://material.angular.io/components/form-field/overview).
 *
 * "field" refers to the `nx-form-field` container element, "control" refers to the
 * element that the field is wrapping, and "form control" refers to the `FormControl`
 * registered with the element.
 *
 * The field must be inside a reacive form.
 *
 * The field should be used with three child elements:
 * 1. `nx-label` for the control (optional, but usually used)
 * 2. The control with `NxControlDirective` (required)
 * 3. `nx-control-messages` for control state messages (optional)
 *
 * How validation works:
 * 1. Add validator functions to the form control. The `NxValidators` class contains
 *    sets for common use cases like email validation.
 * 2. Create an error matcher function for the control using `errorMatcherFactory` and
 *    pass it as an input to the field. This is what tells the field when to display
 *    specific errors. `NX_BASE_ERROR_MATCHES` contains the base matches for text inputs.
 * 3. Add messages to be displayed for errors with `nx-control-message` elements. The key input
 *    should match the error key. There are certain preset messages in `nx-control-messages`
 *    that cannot be overridden.
 */
export declare class NxFormFieldComponent extends BaseComponent implements AfterContentInit, OnDestroy {
    private defaultErrorMatches;
    /** A function for when to display errors.
     *
     * See `error-state-matcher.ts`.
     *
     * Defaults to the matches in `NX_BASE_ERROR_MATCHES`.
     */
    errorMatcher: import("@angular/core").InputSignal<ErrorMatcherFn>;
    protected set _label(label: NxLabelComponent);
    protected hasLabel: import("@angular/core").WritableSignal<boolean>;
    protected nxControlDirective: import("@angular/core").Signal<NxControlDirective>;
    protected ngControl: NgControl;
    protected set _messages(messages: NxMessages);
    protected hasMessages: import("@angular/core").WritableSignal<boolean>;
    private _valueState;
    /** The current value for the control.
     *
     * Used for non-error control messages.
     */
    valueState: import("@angular/core").Signal<ControlState | null>;
    private _errorState;
    /** The current validation error for the control */
    errorState: import("@angular/core").Signal<ControlState | null>;
    protected _errorStateEffect: import("@angular/core").EffectRef;
    protected destroyRef: DestroyRef;
    private formGroup;
    private formObserver;
    constructor();
    private submitted;
    ngAfterContentInit(): void;
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<NxFormFieldComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<NxFormFieldComponent, "nx-form-field", never, { "errorMatcher": { "alias": "errorMatcher"; "required": false; "isSignal": true; }; }, {}, ["nxControlDirective", "_label", "ngControl", "_messages"], ["[nx-label]", "*", "nx-control-messages"], true, [{ directive: typeof i1.NxThemeAttributeDirective; inputs: {}; outputs: {}; }, { directive: typeof i2.__NxUseFormStyleDirective; inputs: {}; outputs: {}; }]>;
}
