import { ComponentPortal } from '@angular/cdk/portal';
import { Observable } from 'rxjs';
import { Nullable, CssClassBuilder } from '@fundamental-ngx/cdk/utils';
import * as i0 from '@angular/core';
import { TemplateRef, Type, InjectionToken, OnInit, OnChanges, ElementRef, EventEmitter } from '@angular/core';
import { BooleanInput } from '@angular/cdk/coercion';

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 injector;
    /** @hidden */
    private readonly _overlay;
    /** @hidden */
    private viewportSize$;
    /** @hidden */
    private readonly _messageStripAlertService;
    /** @hidden */
    private _messageAlerts$;
    /** @hidden */
    private _overlayRefs;
    /** @hidden */
    private _messageStripAlertContainerFooters$;
    /** @hidden */
    constructor();
    /**
     * Set the footer component for a given position.
     */
    setFooterComponent(position: MessageStripAlertPosition, component: Type<any>): void;
    /**
     * Open a message strip alert with given configuration
     */
    open<ComponentType = unknown>(c: OpenMessageStripAlertConfig<ComponentType>): MessageStripAlertRef;
    /** @hidden */
    private getMessageStripAlertRef;
    /** @hidden */
    private listenToItemsChanges;
    /** @hidden */
    private syncExistingOverlays;
    /** @hidden */
    private getOverlayRef;
    /** @hidden */
    private createOverlay;
    static ɵfac: i0.ɵɵFactoryDeclaration<MessageStripAlertService, never>;
    static ɵprov: i0.ɵɵ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 */
    dismissible: BooleanInput;
    /** Whether the alert should be automatically dismissed. */
    autoDismiss: BooleanInput;
    /** Duration of time *in milliseconds* that the alert will be visible. Set to -1 for indefinite. */
    duration: number;
    /** Whether the alert should stay open if the mouse is hovering over it. */
    mousePersist: BooleanInput;
    /** Whether the message strip is currently opened. */
    opened: boolean;
    /** @hidden */
    private messageStripComponent;
    /** @hidden */
    private autoDismissTimeout?;
    /** @hidden */
    private elementRef;
    /** @hidden */
    private _destroyRef;
    /**
     * Mouse is hovering over the message strip.
     * */
    private mouseIn$;
    /** @hidden */
    open(): void;
    /** @hidden */
    private stopAutoDismiss;
    /** @hidden */
    private startAutoDismiss;
    /** @hidden */
    private dismiss;
    static ɵfac: i0.ɵɵFactoryDeclaration<AutoDismissMessageStripDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<AutoDismissMessageStripDirective, "fd-message-strip[mousePersist], fd-message-strip[duration], fd-message-strip[autoDismiss]", ["fdAutoDismissMessageStrip"], { "dismissible": { "alias": "dismissible"; "required": false; }; "autoDismiss": { "alias": "autoDismiss"; "required": false; }; "duration": { "alias": "duration"; "required": false; }; "mousePersist": { "alias": "mousePersist"; "required": false; }; }, {}, never, never, true, never>;
    static ngAcceptInputType_dismissible: unknown;
    static ngAcceptInputType_autoDismiss: unknown;
    static ngAcceptInputType_mousePersist: unknown;
}

declare class MessageStripIconDirective {
    readonly templateRef: TemplateRef<void>;
    /** @hidden */
    constructor(templateRef: TemplateRef<void>);
    static ɵfac: i0.ɵɵFactoryDeclaration<MessageStripIconDirective, never>;
    static ɵdir: i0.ɵɵDirectiveDeclaration<MessageStripIconDirective, "[fdMessageStripIcon]", never, {}, {}, never, never, true, never>;
}

/**
 * The component that represents a message-strip. It can only be used inline.
 */
declare class MessageStripComponent implements OnInit, OnChanges, CssClassBuilder {
    readonly elementRef: ElementRef;
    /** User's custom classes */
    class: string;
    /** Whether the message strip is dismissible. */
    dismissible: BooleanInput;
    /** Title for dismiss button */
    dismissBtnTitle: 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.
     */
    noIcon: BooleanInput;
    /** The type of the message strip.
     * Can be one of *warning*, *success*, *information*, *error* or null.
     */
    type: MessageStripType;
    /** Id for the message-strip component. If omitted, a unique one is generated. */
    id: string;
    /** Id of the element that labels the message-strip. */
    ariaLabelledBy: Nullable<string>;
    /** Aria label for the message-strip component element. */
    ariaLabel: Nullable<string>;
    /** Width of the message-strip. */
    width: string;
    /** Minimum width of the message-strip. */
    minWidth: string;
    /** Margin bottom of the message-strip. */
    marginBottom: string;
    /** indication color of the message-strip. */
    indicationColor: MessageStripIndicationColor;
    /** Event fired when the message-strip is dismissed. */
    onDismiss: EventEmitter<void>;
    /** Custom icon component */
    icon: MessageStripIconDirective;
    /** @hidden */
    constructor(elementRef: ElementRef);
    /** @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;
    /** Whether icon container should be shown */
    get shouldShowIcon(): boolean;
    /** @hidden */
    get typeSpecificIconName(): string;
    /**
     * Dismisses the message-strip.
     */
    dismiss(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<MessageStripComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<MessageStripComponent, "fd-message-strip", never, { "class": { "alias": "class"; "required": false; }; "dismissible": { "alias": "dismissible"; "required": false; }; "dismissBtnTitle": { "alias": "dismissBtnTitle"; "required": false; }; "noIcon": { "alias": "noIcon"; "required": false; }; "type": { "alias": "type"; "required": false; }; "id": { "alias": "id"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "width": { "alias": "width"; "required": false; }; "minWidth": { "alias": "minWidth"; "required": false; }; "marginBottom": { "alias": "marginBottom"; "required": false; }; "indicationColor": { "alias": "indicationColor"; "required": false; }; }, { "onDismiss": "onDismiss"; }, ["icon"], ["*"], true, never>;
    static ngAcceptInputType_dismissible: unknown;
    static ngAcceptInputType_noIcon: unknown;
}

declare class MessageStripModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<MessageStripModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<MessageStripModule, never, [typeof MessageStripComponent, typeof AutoDismissMessageStripDirective, typeof MessageStripIconDirective], [typeof MessageStripComponent, typeof AutoDismissMessageStripDirective, typeof MessageStripIconDirective]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<MessageStripModule>;
}

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