import * as i0 from '@angular/core';
import { OnDestroy, AfterViewInit, EventEmitter, AfterContentChecked, WritableSignal, InjectionToken } from '@angular/core';
import { AXEvent, MXValueComponent, AXStyleLookType, MXBaseComponent } from '@acorex/cdk/common';
import * as i5 from '@acorex/core/validation';
import { AXValidationSummary, AXValidationRuleOptions } from '@acorex/core/validation';
import * as i1 from '@angular/common';
import * as i2 from '@acorex/components/decorators';
import * as i3 from '@acorex/components/alert';
import * as i4 from '@acorex/components/button';
import * as i6 from '@acorex/core/translation';

/**
 *  Contains native event
 * @category Events
 */
declare class AXFormValidationEvent extends AXEvent {
    result: AXValidationSummary;
}
/**
 *  Contains native event
 * @category Events
 */
type AXFormUpdateOn = 'change' | 'blur' | 'submit';
type AXFormMessageStyle = 'bottom' | 'float';
type AXLabelMode = 'static' | 'floating' | 'over';
/**
 * The AXForm is a component which detects user interaction and triggers a corresponding event
 *
 * @category Components
 */
declare class AXFormComponent extends MXValueComponent implements OnDestroy, AfterViewInit {
    #private;
    /**
     * Specifies the mode of the label in the form field.
     *  @defaultValue 'static'
     */
    readonly labelMode: i0.InputSignal<AXLabelMode>;
    readonly look: i0.InputSignal<AXStyleLookType>;
    content: i0.Signal<readonly AXFormFieldComponent[]>;
    /**
     * Determines the style of the message in the form field.
     * @defaultValue 'bottom'
     */
    readonly messageStyle: i0.InputSignal<AXFormMessageStyle>;
    /**
     * Emitted when the form is validated.
     *
     * @event
     */
    onValidate: EventEmitter<AXFormValidationEvent>;
    /**
     * Emitted when the form's update mode changes.
     *
     * @event
     */
    updateOnChange: EventEmitter<AXFormUpdateOn>;
    /**
     *  @ignore
     */
    private _updateOn;
    /**
     * Determines when the form should be updated.
     */
    get updateOn(): AXFormUpdateOn;
    /**
     * Sets the criteria for when the form should be updated.
     * @param v The criteria to set (e.g., 'change', 'blur').
     */
    set updateOn(v: AXFormUpdateOn);
    inUserInteractionActive: i0.InputSignal<boolean>;
    /**
     *  @ignore
     */
    private _subs;
    /**
     *  @ignore
     */
    protected _handleSubmit(e: SubmitEvent): Promise<void>;
    /**
     *  @ignore
     */
    protected _handleReset(): void;
    /**
     *  @ignore
     */
    constructor();
    ngAfterViewInit(): void;
    private _bindEvents;
    /**
     *  @ignore
     */
    private _clearSubs;
    /**
     *  @ignore
     */
    private get fields();
    /**
     * Validates the form fields.
     *
     * @param names - Optional array of field names to validate.
     * @returns Promise<AXValidationSummary> - Promise that resolves with validation results.
     */
    validate(...names: string[]): Promise<AXValidationSummary>;
    /**
     *  @ignore
     */
    private _emitOnValidateEvent;
    /**
     * Resets all form fields without clearing errors.
     *
     * @returns void - No return value. Form fields are reset to their initial values.
     */
    reset(): void;
    /**
     * Resets validation errors for all form fields.
     *
     * @returns void - No return value. All validation errors are cleared.
     */
    resetErrors(): void;
    /**
     *  @ignore
     */
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXFormComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXFormComponent, "ax-form", never, { "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "labelMode": { "alias": "labelMode"; "required": false; "isSignal": true; }; "look": { "alias": "look"; "required": false; "isSignal": true; }; "messageStyle": { "alias": "messageStyle"; "required": false; "isSignal": true; }; "updateOn": { "alias": "updateOn"; "required": false; }; "inUserInteractionActive": { "alias": "inUserInteractionActive"; "required": false; "isSignal": true; }; }, { "onValidate": "onValidate"; "updateOnChange": "updateOnChange"; }, ["content"], ["*"], true, never>;
}

/**
 * A container component for form fields that provides styling and structure.
 *
 * @category Components
 */
declare class AXFormFieldComponent extends MXBaseComponent implements AfterContentChecked {
    /**
     * Specifies the mode of the label in the form field.
     *  @defaultValue 'static'
     */
    readonly labelMode: i0.InputSignal<AXLabelMode>;
    /**
     *  @ignore
     */
    protected _labelMode: WritableSignal<AXLabelMode>;
    private unsubscriber;
    private input;
    /**
     *  @ignore
     */
    private label;
    private form;
    private host;
    /**
     *  @ignore
     */
    protected prefix: HTMLElement;
    /**
     *  @ignore
     */
    constructor();
    ngAfterContentChecked(): void;
    /**
     * Calculates and sets the indentation size for the label based on the width of the prefix element.
     * @ignore
     */
    protected calcIndentSize(): void;
    /**
     * Sets the required attribute for the input field based on validation rules.
     * Automatically updates if validation rules change.
     * @ignore
     */
    protected setRequired(): void;
    /**
     * Sets the label mode based on the form's label mode configuration.
     * @ignore
     */
    protected setLabelMode(): void;
    /**
     * Subscribes to focus and blur events on the input element.
     * Adds or removes the 'ax-state-focused' class to/from the host element based on the focus state.
     * @ignone
     */
    protected listeningEvent(): void;
    /**
     *  @ignore
     */
    private autoSetRequired;
    /**
     *  @ignore
     */
    private autoSetLabelAssociation;
    /**
     *  @ignore
     */
    get __hostClass(): string[];
    static ɵfac: i0.ɵɵFactoryDeclaration<AXFormFieldComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXFormFieldComponent, "ax-form-field", never, { "labelMode": { "alias": "labelMode"; "required": false; "isSignal": true; }; }, {}, ["input", "label"], ["*"], true, never>;
}

interface AXFormConfig {
}
declare const AX_FORM_CONFIG: InjectionToken<AXFormConfig>;
declare const AXFormDefaultConfig: AXFormConfig;
type PartialFormConfig = Partial<AXFormConfig>;
declare function formConfig(config?: PartialFormConfig): AXFormConfig;

declare class AXValidationRuleDirective implements OnDestroy {
    #private;
    private host;
    rule: i0.InputSignal<string>;
    options: i0.InputSignal<Omit<AXValidationRuleOptions, "message">>;
    message: i0.InputSignal<string>;
    disabled: i0.InputSignal<boolean>;
    ngOnDestroy(): void;
    private addValidation;
    private removeValidation;
    private get ruleOptions();
    static ɵfac: i0.ɵɵFactoryDeclaration<AXValidationRuleDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<AXValidationRuleDirective, "ax-validation-rule", never, { "rule": { "alias": "rule"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "message": { "alias": "message"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

type AXValidationSummaryDisplayMode = 'toast' | 'alert';
/**
 * Displays validation summaries in the form of an alert.
 *
 * @category Components
 */
declare class AXValidationSummaryComponent extends MXBaseComponent implements OnDestroy {
    private _tosatService;
    private host;
    private translateService;
    /**
     *  @ignore
     */
    protected _content?: string;
    /**
     *  @ignore
     */
    private _title;
    /**
     * The title of the validation summary alert.
     */
    get title(): string;
    /**
     * Sets the title of the validation summary alert.
     *
     * @param v The title to be set.
     */
    set title(v: string);
    /**
     * Specifies the display mode for the validation summary.
     *
     *  @defaultValue 'toast'
     */
    displayMode: AXValidationSummaryDisplayMode;
    /**
     * Specifies the time in milliseconds before the validation summary automatically hides.
     */
    timeOut?: number;
    /**
     * Determines whether the validation summary should automatically hide after a specified time.
     * @defaultValue false
     */
    autoHide: boolean;
    /**
     *  @ignore
     */
    protected _timeOut: number;
    /**
     *  @ignore
     */
    private sub;
    /**
     *  @ignore
     */
    constructor();
    /**
     *  @ignore
     */
    private formatRule;
    /**
     *  @ignore
     */
    protected _handleOnDismissed(): void;
    /**
     *  @ignore
     */
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<AXValidationSummaryComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<AXValidationSummaryComponent, "ax-validation-summary", never, { "title": { "alias": "title"; "required": false; }; "displayMode": { "alias": "displayMode"; "required": false; }; "timeOut": { "alias": "timeOut"; "required": false; }; "autoHide": { "alias": "autoHide"; "required": false; }; }, {}, never, never, true, never>;
}

declare class AXFormModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<AXFormModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<AXFormModule, never, [typeof i1.CommonModule, typeof i2.AXDecoratorModule, typeof i3.AXAlertModule, typeof i4.AXButtonModule, typeof i5.AXValidationModule, typeof i6.AXTranslationModule, typeof AXFormFieldComponent, typeof AXFormComponent, typeof AXValidationRuleDirective, typeof AXValidationSummaryComponent], [typeof AXFormFieldComponent, typeof AXFormComponent, typeof AXValidationRuleDirective, typeof AXValidationSummaryComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<AXFormModule>;
}

export { AXFormComponent, AXFormDefaultConfig, AXFormFieldComponent, AXFormModule, AXFormValidationEvent, AXValidationRuleDirective, AXValidationSummaryComponent, AX_FORM_CONFIG, formConfig };
export type { AXFormConfig, AXFormMessageStyle, AXFormUpdateOn, AXLabelMode, AXValidationSummaryDisplayMode, PartialFormConfig };
