import { ComponentPortal } from '@angular/cdk/portal';
import { Observable } from 'rxjs';
import { Nullable } from '@fundamental-ngx/cdk/utils';
import * as _angular_core from '@angular/core';
import { TemplateRef, Type, InjectionToken, ElementRef } from '@angular/core';
import { BooleanInput } from '@angular/cdk/coercion';
import { Observable as Observable$1 } from 'rxjs/internal/Observable';

type MessageStripAlertVerticalPosition = 'top' | 'bottom';
type MessageStripAlertHorizontalPosition = 'start' | 'middle' | 'end';
type MessageStripAlertPosition = `${MessageStripAlertVerticalPosition}-${MessageStripAlertHorizontalPosition}`;

declare const messageStripIndicationColors: readonly ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"];
type MessageStripIndicationColor = `${(typeof messageStripIndicationColors)[number]}` | `${(typeof messageStripIndicationColors)[number]}b`;
declare const _messageStripIndicationColors: MessageStripIndicationColor[];

type MessageStripType = Nullable<'warning' | 'success' | 'information' | 'error'>;

interface MessageStripConfiguration {
    class: string;
    dismissible: boolean;
    mousePersist: boolean;
    duration: number;
    noIcon: boolean;
    type: MessageStripType;
    indicationColor: MessageStripIndicationColor;
    id: string;
    ariaLabelledBy: Nullable<string>;
    ariaLabel: Nullable<string>;
    dismissLabel: string;
    onDismiss: () => void;
}

interface MessageStripAlert {
    messageStripConfig: MessageStripConfiguration;
}

declare abstract class MessageStripAlertRef {
    /** Message strip alert component portal which is rendered in the container */
    abstract portal: ComponentPortal<MessageStripAlert>;
    /**
     * Function, which dismisses the alert, it calls the user-provided function
     * after dismissing the actual alert
     */
    abstract dismiss: () => void;
    /** Observable that emits when the alert is dismissed */
    abstract onDismiss$: Observable<void>;
}

/**
 * The configuration type which is expected from the user
 */
interface OpenMessageStripAlertConfig<ComponentType = unknown> {
    /**
     * Position of the message strip alert container.
     * Every top-* and bottom-* ones will be merged into the top-middle
     * and bottom-middle sections respectively and will be sorted by the
     * order of appearance.
     */
    position?: MessageStripAlertPosition;
    /** Content, that will be rendered inside the message strip when it appears */
    content: string | TemplateRef<{
        $implicit: MessageStripAlertRef;
    }> | Type<ComponentType>;
    /** Configuration for the message strip component */
    messageStrip?: Partial<MessageStripConfiguration>;
    /** Whether to close message strip when navigation changes. */
    closeOnNavigation?: boolean;
}

/**
 * Service that is responsible for opening and closing message strip alerts.
 * This should be only created once in entire application.
 * Service is responsible for creating and managing the overlays for the
 * message strip alerts. This also manages the footer components for any
 * given position.
 */
declare class MessageStripAlertService {
    /** @hidden */
    footerComponents$: Observable<Partial<Record<MessageStripAlertPosition, Type<any>>>>;
    /** @hidden */
    private readonly _injector;
    /** @hidden */
    private readonly _overlay;
    /** @hidden */
    private readonly _viewportSize$;
    /** @hidden */
    private readonly _messageStripAlertService;
    /**
     * Signal holding all message alerts
     * @hidden
     */
    private readonly _messageAlerts;
    /** @hidden */
    private _overlayRefs;
    /**
     * Signal holding footer components
     * @hidden
     */
    private readonly _messageStripAlertContainerFooters;
    /** @hidden */
    constructor();
    /**
     * Set the footer component for a given position.
     * @param position - The position where the footer should be displayed
     * @param component - The component type to be rendered as footer
     */
    setFooterComponent(position: MessageStripAlertPosition, component: Type<any>): void;
    /**
     * Open a message strip alert with given configuration.
     * @param c - Configuration for the message strip alert
     * @returns Reference to the opened alert for programmatic control
     */
    open<ComponentType = unknown>(c: OpenMessageStripAlertConfig<ComponentType>): MessageStripAlertRef;
    /** @hidden */
    private _getMessageStripAlertRef;
    /** @hidden */
    private _listenToItemsChanges;
    /**
     * Synchronizes existing overlay states based on current message alerts.
     * @hidden
     */
    private _syncExistingOverlays;
    /**
     * Gets or creates an overlay reference for the specified position.
     * @hidden
     */
    private _getOverlayRef;
    /**
     * Creates an overlay for message strip alerts at the specified position.
     * @hidden
     */
    private _createOverlay;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageStripAlertService, never>;
    static ɵprov: _angular_core.ɵɵInjectableDeclaration<MessageStripAlertService>;
}

/**
 * Injection token for getting the position of the message strip alert container.
 * Is available in any of the message strip alert components and in footer component.
 */
declare const MessageStripAlertContainerPosition: InjectionToken<"top-start" | "top-middle" | "top-end" | "bottom-start" | "bottom-middle" | "bottom-end">;
/**
 * Injection token for getting the list of the message strip alert refs
 * in the given container. Is available in the footer component injection
 * context.
 */
declare const MessageStripAlertContainerAlertRefs: InjectionToken<Observable<Nullable<MessageStripAlertRef[]>>>;

declare class AutoDismissMessageStripDirective {
    /** Whether the message strip is dismissible */
    readonly dismissible: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
    /** Whether the alert should be automatically dismissed. */
    readonly autoDismiss: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
    /** Duration of time *in milliseconds* that the alert will be visible. Set to -1 for indefinite. */
    readonly duration: _angular_core.InputSignal<number>;
    /** Whether the alert should stay open if the mouse is hovering over it. */
    readonly mousePersist: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
    /**
     * Whether the message strip is currently opened.
     * @hidden
     */
    protected readonly _opened: _angular_core.WritableSignal<boolean>;
    /** @hidden */
    private readonly _messageStripComponent;
    /** @hidden */
    private readonly _onDismiss$;
    /** @hidden */
    private readonly _elementRef;
    /** @hidden */
    private readonly _destroyRef;
    /** @hidden */
    private _autoDismissTimeout?;
    /** @hidden */
    private _mouseIn$?;
    /**
     * Gets observable tracking mouse hover state.
     * Lazily initialized to ensure ElementRef is available.
     * @hidden
     */
    private get _mouseIn();
    /**
     * Opens the message strip and starts auto-dismiss timer if configured.
     * This method is part of the public API via exportAs.
     */
    open(): void;
    /** @hidden */
    private _stopAutoDismiss;
    /** @hidden */
    private _startAutoDismiss;
    /** @hidden */
    private _dismiss;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<AutoDismissMessageStripDirective, never>;
    static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AutoDismissMessageStripDirective, "fd-message-strip[mousePersist], fd-message-strip[duration], fd-message-strip[autoDismiss]", ["fdAutoDismissMessageStrip"], { "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "autoDismiss": { "alias": "autoDismiss"; "required": false; "isSignal": true; }; "duration": { "alias": "duration"; "required": false; "isSignal": true; }; "mousePersist": { "alias": "mousePersist"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
}

declare class MessageStripIconDirective {
    readonly templateRef: TemplateRef<any>;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageStripIconDirective, never>;
    static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MessageStripIconDirective, "[fdMessageStripIcon]", never, {}, {}, never, never, true, never>;
}

declare const enum MessageStringIconEnum {
    ALERT = "alert",
    SUCCESS = "sys-enter-2",
    ERROR = "error",
    INFORMATION = "information"
}

/**
 * The component that represents a message-strip. It can only be used inline.
 */
declare class MessageStripComponent {
    /** Whether the message strip is dismissible. */
    readonly dismissible: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
    /** Id of the element that labels the message-strip. */
    readonly ariaLabelledBy: _angular_core.InputSignal<string | null | undefined>;
    /** Title for dismiss button */
    readonly dismissBtnTitle: _angular_core.InputSignal<string>;
    /** The default message strip does not have an icon.
     * The other types (warning, success, information and error) have icons by default.
     * To remove the icon set the property to true.
     */
    readonly noIcon: _angular_core.InputSignalWithTransform<boolean, BooleanInput>;
    /** The type of the message strip.
     * Can be one of *warning*, *success*, *information*, *error* or null.
     */
    readonly type: _angular_core.InputSignal<MessageStripType>;
    /** Id for the message-strip component. If omitted, a unique one is generated. */
    readonly id: _angular_core.InputSignalWithTransform<string, string>;
    /** Aria label for the message-strip component element. */
    readonly ariaLabel: _angular_core.InputSignal<string | null | undefined>;
    /** Width of the message-strip. */
    readonly width: _angular_core.InputSignal<string>;
    /** Minimum width of the message-strip. */
    readonly minWidth: _angular_core.InputSignal<string>;
    /** Margin bottom of the message-strip. */
    readonly marginBottom: _angular_core.InputSignal<string>;
    /** indication color of the message-strip. */
    readonly indicationColor: _angular_core.InputSignal<MessageStripIndicationColor | undefined>;
    /** Event fired when the message-strip is dismissed. */
    readonly onDismiss: _angular_core.OutputEmitterRef<void>;
    /** Custom icon component */
    readonly icon: _angular_core.Signal<MessageStripIconDirective | undefined>;
    /** @hidden */
    readonly elementRef: ElementRef<any>;
    /**
     * Computed aria-labelledby attribute.
     * @hidden
     */
    protected readonly hostAriaLabelledBy: _angular_core.Signal<string>;
    /**
     * Computed CSS class string for the component.
     * @hidden
     */
    protected readonly cssClass: _angular_core.Signal<string>;
    /**
     * Whether icon container should be shown.
     * @hidden
     */
    protected readonly shouldShowIcon: _angular_core.Signal<boolean>;
    /**
     * Type-specific icon name.
     * @hidden
     */
    protected readonly typeSpecificIconName: _angular_core.Signal<"" | MessageStringIconEnum>;
    /** message strip information read by screen readers */
    protected messageStripHiddenText$: Observable$1<string>;
    /** default dismiss button text read by screen readers */
    protected defaultDismissButtonText$: Observable$1<string>;
    /** @hidden */
    private readonly _destroyRef;
    /** @hidden */
    private readonly _lang$;
    /** @hidden */
    private readonly _translationResolver;
    /** @hidden */
    constructor();
    /**
     * Dismisses the message-strip.
     */
    dismiss(): void;
    /** @hidden */
    private _translateAnnouncement;
    /** @hidden */
    private _buildMessageStripHiddenText;
    /** @hidden **/
    private _getHiddenButtonText;
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageStripComponent, never>;
    static ɵcmp: _angular_core.ɵɵComponentDeclaration<MessageStripComponent, "fd-message-strip", never, { "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; "isSignal": true; }; "dismissBtnTitle": { "alias": "dismissBtnTitle"; "required": false; "isSignal": true; }; "noIcon": { "alias": "noIcon"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "minWidth": { "alias": "minWidth"; "required": false; "isSignal": true; }; "marginBottom": { "alias": "marginBottom"; "required": false; "isSignal": true; }; "indicationColor": { "alias": "indicationColor"; "required": false; "isSignal": true; }; }, { "onDismiss": "onDismiss"; }, ["icon"], ["*"], true, never>;
}

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
declare class MessageStripModule {
    static ɵfac: _angular_core.ɵɵFactoryDeclaration<MessageStripModule, never>;
    static ɵmod: _angular_core.ɵɵNgModuleDeclaration<MessageStripModule, never, [typeof MessageStripComponent, typeof AutoDismissMessageStripDirective, typeof MessageStripIconDirective], [typeof MessageStripComponent, typeof AutoDismissMessageStripDirective, typeof MessageStripIconDirective]>;
    static ɵinj: _angular_core.ɵɵInjectorDeclaration<MessageStripModule>;
}

export { AutoDismissMessageStripDirective, MessageStripAlertContainerAlertRefs, MessageStripAlertContainerPosition, MessageStripAlertRef, MessageStripAlertService, MessageStripComponent, MessageStripIconDirective, MessageStripModule, _messageStripIndicationColors };
export type { MessageStripAlert, MessageStripAlertHorizontalPosition, MessageStripAlertPosition, MessageStripAlertVerticalPosition, MessageStripConfiguration, MessageStripIndicationColor, MessageStripType, OpenMessageStripAlertConfig };
