import * as i0 from '@angular/core';
import { InjectionToken, InputSignal, ElementRef, Type, Provider, OnInit, OnChanges, OnDestroy, EventEmitter, TemplateRef, AfterViewInit, NgZone } from '@angular/core';
import { FormStates } from '@fundamental-ngx/cdk/forms';
import { Nullable, CssClassBuilder } from '@fundamental-ngx/cdk/utils';
import { ContentDensityObserver } from '@fundamental-ngx/core/content-density';
import { TriggerConfig, PopoverComponent, PopoverService } from '@fundamental-ngx/core/popover';
import { PopoverFillMode, Placement } from '@fundamental-ngx/core/shared';

/**
 * Used for easily displaying forms with a margin. Not necessary for fundamental forms to be functional.
 *
 * ```html
 * <div fd-fieldset
 *     <div fd-form-item>
 *         ...
 *     </div>
 * </div>
 * ```
 */
declare class FieldsetComponent {
    /** @hidden */
    fdFieldClass: boolean;
    static ɵfac: i0.ɵɵFactoryDeclaration<FieldsetComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<FieldsetComponent, "[fd-fieldset]", never, {}, {}, never, ["*"], true, never>;
}

/**
 * @deprecated
 * Import `FieldsetComponent` directly as a standalone component.
 */
declare class FieldSetModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FieldSetModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FieldSetModule, never, [typeof FieldsetComponent], [typeof FieldsetComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FieldSetModule>;
}

/** An injection token, that should be used with all controls, that can be put inside `fd-form-item` */
declare const FORM_ITEM_CONTROL: InjectionToken<FormItemControl>;
/** Utility function to provide `FORM_ITEM_CONTROL` injection token  */
declare function registerFormItemControl(control: Type<FormItemControl>): Provider;
/** Set of fields of FormItemControl component */
interface FormItemControl {
    ariaLabelledBy: Nullable<string> | InputSignal<Nullable<string>>;
    elmRef?: ElementRef;
}

/**
 * Directive intended for use on form controls.
 *
 * ```html
 * <input type="text" fd-form-control />
 * ```
 */
declare class FormControlComponent implements CssClassBuilder, OnInit, OnChanges, OnDestroy, FormItemControl {
    elementRef: ElementRef<HTMLInputElement | HTMLTextAreaElement>;
    private ariaLabelAttr;
    private ariaLabelledByAttr;
    /**
     *  The state of the form control - applies css classes.
     *  Can be `success`, `error`, `warning`, `information` or blank for default.
     */
    state: FormStates | null;
    /** Type of the form control. */
    type: string;
    /** user's custom classes */
    class: string;
    /** aria-label for form-control. */
    ariaLabel: Nullable<string>;
    /** aria-label for form-control. */
    ariaLabelledBy: Nullable<string>;
    /** @hidden */
    protected get ariaLabelBinding(): string;
    /** @hidden */
    protected get ariaLabelledByBinding(): string;
    /** @hidden */
    private _subscriptions;
    /** @hidden */
    constructor(elementRef: ElementRef<HTMLInputElement | HTMLTextAreaElement>, _contentDensityObserver: ContentDensityObserver, ariaLabelAttr: string, ariaLabelledByAttr: string);
    /**
     * @hidden
     * CssClassBuilder interface implementation
     * function must return single string
     * function is responsible for order which css classes are applied
     */
    buildComponentCssClass(): string[];
    /** @hidden */
    ngOnInit(): void;
    /** @hidden */
    ngOnChanges(): void;
    /** @hidden */
    ngOnDestroy(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<FormControlComponent, [null, null, { attribute: "aria-label"; }, { attribute: "aria-labelledby"; }]>;
    static ɵcmp: i0.ɵɵComponentDeclaration<FormControlComponent, "input[fd-form-control], textarea[fd-form-control]", never, { "state": { "alias": "state"; "required": false; }; "type": { "alias": "type"; "required": false; }; "class": { "alias": "class"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; }, {}, never, ["*"], true, never>;
}

/**
 * @deprecated
 * Import `FormControlComponent` directly as a standalone component.
 */
declare class FormControlModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FormControlModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FormControlModule, never, [typeof FormControlComponent], [typeof FormControlComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FormControlModule>;
}

/**
 * Represents a form group element.
 *
 * ```html
 * <fd-form-group>
 *     <div fd-form-item>
 *         <input fd-form-control type="radio" checked>
 *         <fd-form-label>Option One</fd-form-label>
 *     </div>
 * </fd-form-group>
 * ```
 */
declare class FormGroupComponent implements CssClassBuilder, OnChanges, OnInit {
    elementRef: ElementRef;
    /** @hidden */
    fdFormGroupClass: boolean;
    /** Determines if form items should be displayed inline or not
     * Default value is set to false;
     */
    isInline: boolean;
    /** @hidden */
    class: string;
    /** @hidden */
    constructor(elementRef: ElementRef);
    /** This method is responsible for building a css class based on current state
     *  It is implementation of CssClassBuilder interface and
     *  should be used with @applyCssClass decorator
     */
    buildComponentCssClass(): string[];
    /** @hidden */
    ngOnChanges(): void;
    /** @hidden */
    ngOnInit(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<FormGroupComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<FormGroupComponent, "fd-form-group", never, { "isInline": { "alias": "isInline"; "required": false; }; }, {}, never, ["*"], true, never>;
}

/**
 * @deprecated
 * Import `FormGroupComponent` directly as a standalone component.
 */
declare class FormGroupModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FormGroupModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FormGroupModule, never, [typeof FormGroupComponent], [typeof FormGroupComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FormGroupModule>;
}

/**
 *
 * ```html
 * <h4 fd-form-header>Form Header</h4>
 * ```
 */
declare class FormHeaderComponent {
    /** @hidden */
    fdFormHeaderClass: boolean;
    static ɵfac: i0.ɵɵFactoryDeclaration<FormHeaderComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<FormHeaderComponent, "[fd-form-header]", never, {}, {}, never, ["*"], true, never>;
}

/**
 * @deprecated
 * Import `FormHeaderComponent` directly as a standalone component.
 */
declare class FormHeaderModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FormHeaderModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FormHeaderModule, never, [typeof FormHeaderComponent], [typeof FormHeaderComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FormHeaderModule>;
}

declare class FormInputMessageGroupComponent {
    /**
     * To allow user to determine what event he wants to trigger the messages to show
     * Accepts any [HTML DOM Events](https://www.w3schools.com/jsref/dom_obj_event.asp).
     */
    triggers: (string | TriggerConfig)[];
    /**
     * Allows the user to decide if he wants to keep the error message after they click outside
     * Whether the popover should close when a click is made outside its boundaries.
     */
    closeOnOutsideClick: boolean;
    /**
     * Preset options for the message body width.
     * * `at-least` will apply a minimum width to the body equivalent to the width of the control.
     * * `equal` will apply a width to the body equivalent to the width of the control.
     * * Leave blank for no effect.
     */
    fillControlMode: PopoverFillMode;
    /** Whether the popover should have an arrow. */
    noArrow: boolean;
    /** Whether the popover should close when the escape key is pressed. */
    closeOnEscapeKey: boolean;
    /** The placement of the popover. It can be one of: top, top-start, top-end, bottom,
     *  bottom-start, bottom-end, right, right-start, right-end, left, left-start, left-end. */
    placement: Placement;
    /**
     * @experimental
     * Container element, in which form message popover will be rendered.
     */
    placementContainer: 'body' | 'self';
    /** Whether the message is open. Can be used through two-way binding. */
    isOpen: boolean;
    /**
     * Whether the popover should prevent page scrolling when space key is pressed.
     **/
    preventSpaceKeyScroll: boolean;
    /** Event emitted when the state of the isOpen property changes. */
    isOpenChange: EventEmitter<boolean>;
    /** @hidden */
    _popoverPlacementContainer: ElementRef | null;
    /** @hidden */
    _popover: PopoverComponent;
    /** @hidden */
    readonly _elementRef: ElementRef<any>;
    /**
     * Function is called every time message changes isOpen attribute
     */
    openChanged(isOpen: boolean): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<FormInputMessageGroupComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<FormInputMessageGroupComponent, "fd-form-input-message-group", never, { "triggers": { "alias": "triggers"; "required": false; }; "closeOnOutsideClick": { "alias": "closeOnOutsideClick"; "required": false; }; "fillControlMode": { "alias": "fillControlMode"; "required": false; }; "noArrow": { "alias": "noArrow"; "required": false; }; "closeOnEscapeKey": { "alias": "closeOnEscapeKey"; "required": false; }; "placement": { "alias": "placement"; "required": false; }; "placementContainer": { "alias": "placementContainer"; "required": false; }; "isOpen": { "alias": "isOpen"; "required": false; }; "preventSpaceKeyScroll": { "alias": "preventSpaceKeyScroll"; "required": false; }; }, { "isOpenChange": "isOpenChange"; }, never, ["*", "fd-form-message"], true, never>;
}

/**
 * @deprecated
 * Import `FormInputMessageGroupComponent` directly as a standalone component.
 */
declare class FormInputMessageGroupModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FormInputMessageGroupModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FormInputMessageGroupModule, never, [typeof FormInputMessageGroupComponent], [typeof FormInputMessageGroupComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FormInputMessageGroupModule>;
}

type InlineHelpFormPlacement = 'before' | 'after';

/**
 * Label to be linked to a form control.
 *
 * ```html
 * <label fd-form-label for="input-id">Label Text</label>
 * <input fd-form-control type="text" id="input-id" />
 * ```
 */
declare class FormLabelComponent implements OnChanges {
    /** Whether form is required. */
    required: boolean;
    /** Whether label text should be appended with colon. */
    colon: boolean;
    /** Align label on end. */
    alignLabelEnd: boolean;
    /** Inline help content. Could be just a string or complex template */
    inlineHelpContent: Nullable<string | TemplateRef<any>>;
    /** Glyph of icon triggering inline help. */
    inlineHelpGlyph: string;
    /** Trigger event names for the inline help. */
    inlineHelpTriggers: (string | TriggerConfig)[];
    /**
     * The placement of the inline help.
     * It can be one of:
     * top, top-start, top-end, bottom, bottom-start, bottom-end,
     * right, right-start, right-end, left, left-start, left-end.
     */
    inlineHelpBodyPlacement: Placement;
    /** If inline help trigger icon should be placed after, or before text. */
    inlineHelpPlacement: InlineHelpFormPlacement;
    /** Whether to allow the text of the form label to wrap. */
    allowWrap: boolean;
    /** Inline help label. */
    set inlineHelpLabel(label: string);
    get inlineHelpLabel(): string;
    /** @hidden */
    defaultClass: boolean;
    /** @hidden */
    inlineHelpClass: boolean;
    /** @hidden */
    inlineHelpAfter: boolean;
    /** @hidden */
    set formLabelId(value: Nullable<string>);
    get formLabelId(): string;
    /** @hidden */
    private _formLabelId;
    /** @hidden */
    private _inlineHelpLabel?;
    /** @hidden */
    ngOnChanges(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<FormLabelComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<FormLabelComponent, "[fd-form-label]", never, { "required": { "alias": "required"; "required": false; }; "colon": { "alias": "colon"; "required": false; }; "alignLabelEnd": { "alias": "alignLabelEnd"; "required": false; }; "inlineHelpContent": { "alias": "inlineHelpContent"; "required": false; }; "inlineHelpGlyph": { "alias": "inlineHelpGlyph"; "required": false; }; "inlineHelpTriggers": { "alias": "inlineHelpTriggers"; "required": false; }; "inlineHelpBodyPlacement": { "alias": "inlineHelpBodyPlacement"; "required": false; }; "inlineHelpPlacement": { "alias": "inlineHelpPlacement"; "required": false; }; "allowWrap": { "alias": "allowWrap"; "required": false; }; "inlineHelpLabel": { "alias": "inlineHelpLabel"; "required": false; }; "formLabelId": { "alias": "id"; "required": false; }; }, {}, never, ["*"], true, never>;
}

/**
 * Directive to be applied to the parent of a form control.
 *
 * ```html
 * <div fd-form-item>
 *     <input fd-form-control type="text" />
 * </div>
 * ```
 */
declare class FormItemComponent implements AfterViewInit {
    private ngZone;
    /** Whether the form item is inline. */
    isInline: boolean;
    /** Whether the form item is horizontal. */
    horizontal: boolean;
    /** @hidden */
    fdFormItemClass: boolean;
    /** @hidden */
    formLabel?: FormLabelComponent;
    /** @hidden */
    formItemControl?: FormItemControl;
    /** @hidden */
    constructor(ngZone: NgZone);
    /** @hidden */
    ngAfterViewInit(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<FormItemComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<FormItemComponent, "[fd-form-item]", never, { "isInline": { "alias": "isInline"; "required": false; }; "horizontal": { "alias": "horizontal"; "required": false; }; }, {}, ["formLabel", "formItemControl"], ["*"], true, never>;
}

/**
 * @deprecated
 * Import `FormItemComponent` directly as a standalone component.
 */
declare class FormItemModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FormItemModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FormItemModule, never, [typeof FormItemComponent], [typeof FormItemComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FormItemModule>;
}

/**
 * @deprecated
 * Import `FormLabelComponent` directly as a standalone component.
 */
declare class FormLabelModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FormLabelModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FormLabelModule, never, [typeof FormLabelComponent], [typeof FormLabelComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FormLabelModule>;
}

/**
 * Applies css to a legend html element.
 *
 * <legend fd-form-legend>Legend</legend>
 */
declare class FormLegendDirective {
    /** @hidden */
    fdFormLegendClass: boolean;
    static ɵfac: i0.ɵɵFactoryDeclaration<FormLegendDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<FormLegendDirective, "[fd-form-legend]", never, {}, {}, never, never, true, never>;
}

/**
 * @deprecated
 * Import `FormLegendDirective` directly as a standalone directive.
 */
declare class FormLegendModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FormLegendModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FormLegendModule, never, [typeof FormLegendDirective], [typeof FormLegendDirective]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FormLegendModule>;
}

/**
 * Form message. Intended to be displayed with a form control for validation purposes.
 */
declare class FormMessageComponent implements CssClassBuilder, OnInit, OnChanges {
    readonly elementRef: ElementRef;
    /** Type of the message. */
    type: FormStates;
    /** Whether message should be in static mode, without popover. It's mostly used for forms component, that contain dropdown */
    static: boolean;
    /**
     * Whether message is used inside popovers or dialogs.
     * When it is enabled box shadow is removed and message is expanded to whole container width
     */
    embedded: boolean;
    /** User's custom classes */
    class: string;
    /** @hidden */
    constructor(elementRef: ElementRef);
    /** @hidden */
    buildComponentCssClass(): string[];
    /** @hidden */
    ngOnChanges(): void;
    /** @hidden */
    ngOnInit(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<FormMessageComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<FormMessageComponent, "fd-form-message", never, { "type": { "alias": "type"; "required": false; }; "static": { "alias": "static"; "required": false; }; "embedded": { "alias": "embedded"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, {}, never, ["*"], true, never>;
}

/**
 * @deprecated
 * Import `FormMessageComponent` directly as a standalone component.
 */
declare class FormMessageModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FormMessageModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FormMessageModule, never, [typeof FormMessageComponent], [typeof FormMessageComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FormMessageModule>;
}

declare class PopoverFormMessageService {
    private _popoverService;
    /** @hidden */
    private _message;
    /** @hidden */
    private _hidden;
    /** @hidden */
    constructor(_popoverService: PopoverService);
    /** @hidden */
    set message(message: Nullable<string | TemplateRef<any>>);
    /** @hidden */
    set triggers(triggers: string[]);
    /** Initialise popover service with trigger element */
    init(triggerElement: ElementRef): void;
    /** Forces hidden state onto popover, without any collision with triggering events */
    hide(): void;
    /** Removes hidden state onto popover, without any collision with triggering events */
    show(): void;
    /** @hidden */
    private _getAdditionalClass;
    /** @hidden */
    private _updatePopover;
    /** @hidden */
    private _shouldBeHidden;
    static ɵfac: i0.ɵɵFactoryDeclaration<PopoverFormMessageService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<PopoverFormMessageService>;
}

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
declare class FormModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<FormModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<FormModule, never, [typeof FieldsetComponent, typeof FormControlComponent, typeof FormItemComponent, typeof FormItemComponent, typeof FormLabelComponent, typeof FormHeaderComponent, typeof FormLegendDirective, typeof FormMessageComponent, typeof FormInputMessageGroupComponent, typeof FormGroupComponent], [typeof FieldsetComponent, typeof FormControlComponent, typeof FormItemComponent, typeof FormItemComponent, typeof FormLabelComponent, typeof FormHeaderComponent, typeof FormLegendDirective, typeof FormMessageComponent, typeof FormInputMessageGroupComponent, typeof FormGroupComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<FormModule>;
}

export { FORM_ITEM_CONTROL, FieldSetModule, FieldsetComponent, FormControlComponent, FormControlModule, FormGroupComponent, FormGroupModule, FormHeaderComponent, FormHeaderModule, FormInputMessageGroupComponent, FormInputMessageGroupModule, FormItemComponent, FormItemModule, FormLabelComponent, FormLabelModule, FormLegendDirective, FormLegendModule, FormMessageComponent, FormMessageModule, FormModule, PopoverFormMessageService, registerFormItemControl };
export type { FormItemControl, InlineHelpFormPlacement };
