/** @packageDocumentation
 * @module Notification
 */
import type { XAndY } from "@itwin/core-geometry";
import type { MessageBoxValue, ToolAssistanceInstructions, ToolTipOptions } from "@itwin/core-frontend";
import { ActivityMessageDetails, MessageBoxIconType, MessageBoxType, OutputMessagePriority } from "@itwin/core-frontend";
import { MessageSeverity, UiEvent } from "@itwin/appui-abstract";
import type { IconSpec } from "@itwin/core-react";
import type { NotifyMessageDetailsType, NotifyMessageType } from "./ReactNotifyMessageDetails";
import { StatusMessageManager } from "./StatusMessageManager";
import type { useToaster } from "@itwin/itwinui-react";
import { BeUiEvent } from "@itwin/core-bentley";
type Toaster = ReturnType<typeof useToaster>;
type ToasterSettings = Parameters<Toaster["setSettings"]>;
type ToastOptions = Parameters<Toaster["positive"]>[1];
/** [[MessageAddedEvent]] arguments.
 * @public
 * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.
 */
export interface MessageAddedEventArgs {
    /** Message details for the message added */
    message: NotifyMessageDetailsType;
}
/** Activity Message Event arguments.
 * @public
 * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.
 */
export interface ActivityMessageEventArgs {
    /** Current message for the activity */
    message: NotifyMessageType;
    /** Current percentage for the activity */
    percentage: number;
    /** Message details set by calling NotificationManager.setupActivityMessage */
    details?: ActivityMessageDetails;
    /** Indicates whether the activity message popup is being restored */
    restored?: boolean;
}
/** Input Field Message Event arguments.
 * @public
 * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.
 */
export interface InputFieldMessageEventArgs {
    /** Target HTML element for the Input Field message */
    target: Element;
    /** Message to be displayed near the input field */
    messageText: NotifyMessageType;
    /** Detailed message to be displayed near the input field */
    detailedMessage: NotifyMessageType;
    /** Priority of the input field message */
    priority: OutputMessagePriority;
}
/** Tool Assistance Changed event arguments.
 * @public
 * @deprecated in 4.13.0. Event args are inferred from a listener. If explicit type is needed use a type helper.
 */
export interface ToolAssistanceChangedEventArgs {
    /** Tool Assistance instructions for the active tool */
    instructions: ToolAssistanceInstructions | undefined;
}
/** Message Added Event class.
 * @public
 * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
 */
export declare class MessageAddedEvent extends UiEvent<MessageAddedEventArgs> {
}
/** Messages Updated Event class.
 * @public
 * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
 */
export declare class MessagesUpdatedEvent extends UiEvent<{}> {
}
/** Activity Message Added Event class.
 * @public
 * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
 */
export declare class ActivityMessageUpdatedEvent extends UiEvent<ActivityMessageEventArgs> {
}
/** Activity Message Cancelled Event class.
 * @public
 * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
 */
export declare class ActivityMessageCancelledEvent extends UiEvent<{}> {
}
/** Input Field Message Added Event class
 * @public
 * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
 */
export declare class InputFieldMessageAddedEvent extends UiEvent<InputFieldMessageEventArgs> {
}
/** Input Field Message Removed Event class.
 * @public
 * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
 */
export declare class InputFieldMessageRemovedEvent extends UiEvent<{}> {
}
/** Open Message Center Event class.
 * @public
 * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
 */
export declare class OpenMessageCenterEvent extends UiEvent<{}> {
}
/** Tool Assistance Changed event class
 * @public
 * @deprecated in 4.13.0. This class should not be used by applications to instantiate objects.
 */
export declare class ToolAssistanceChangedEvent extends UiEvent<ToolAssistanceChangedEventArgs> {
}
/** The MessageManager class manages messages and prompts. It is used by the [[AppNotificationManager]] class.
 * @public
 */
export declare class MessageManager {
    private static _maxCachedMessages;
    private static _maxDisplayedStickyMessages;
    private static _messages;
    private static _ongoingActivityMessage;
    private static _lastMessage?;
    private static _activeMessageManager;
    private static _animateOutToElement;
    private static _toastCloseCallbacks;
    /** The MessageAddedEvent is fired when a message is added via outputMessage(). */
    static readonly onMessageAddedEvent: MessageAddedEvent;
    /** The MessagesUpdatedEvent is fired when a message is added or the messages are cleared. */
    static readonly onMessagesUpdatedEvent: MessagesUpdatedEvent;
    /** The ActivityMessageUpdatedEvent is fired when an Activity message updates via outputActivityMessage(). */
    static readonly onActivityMessageUpdatedEvent: ActivityMessageUpdatedEvent;
    /** The ActivityMessageCancelledEvent is fired when an Activity message is cancelled via
     * endActivityMessage(ActivityMessageEndReason.Cancelled) or
     * by the user clicking the 'Cancel' link.
     */
    static readonly onActivityMessageCancelledEvent: ActivityMessageCancelledEvent;
    static readonly onInputFieldMessageAddedEvent: InputFieldMessageAddedEvent;
    static readonly onInputFieldMessageRemovedEvent: InputFieldMessageRemovedEvent;
    static readonly onOpenMessageCenterEvent: OpenMessageCenterEvent;
    /** @internal */
    static readonly onDisplayMessage: BeUiEvent<{
        message: NotifyMessageDetailsType;
        options?: ToastOptions;
        settings?: [settings: Partial<import("@itwin/itwinui-react/cjs/core/Toast/Toaster").ToasterSettings>] | undefined;
        animateOutToElement?: HTMLElement | undefined;
        close?: (() => void) | undefined;
    }>;
    /** The ToolAssistanceChangedEvent is fired when a tool calls IModelApp.notifications.setToolAssistance().
     * @public
     */
    static readonly onToolAssistanceChangedEvent: ToolAssistanceChangedEvent;
    /** List of messages as NotifyMessageDetailsType. */
    static get messages(): Readonly<NotifyMessageDetailsType[]>;
    /** Manager of active messages. */
    static get activeMessageManager(): StatusMessageManager;
    /** Clear the message list. */
    static clearMessages(): void;
    /** Update the message list. */
    static updateMessages(): void;
    /** Set the maximum number of cached message. */
    static setMaxCachedMessages(max: number): void;
    /** The maximum number of displayed Sticky messages. */
    static get maxDisplayedStickyMessages(): number;
    static set maxDisplayedStickyMessages(max: number);
    /** Output a message and/or alert to the user.
     * @param  message  Details about the message to output.
     */
    static outputMessage(message: NotifyMessageDetailsType): void;
    /** Set the element where messages should be animated out to on exit.
     * @param  element `HTMLElement` to animate out to.
     */
    static registerAnimateOutToElement(element: HTMLElement | null): void;
    /** Handles disconnected element modal frontstages, revert to last still displayed. */
    private static get animateOutToElement();
    /** Display a message.
     * Works only with `Sticky` and `Toast` message types.
     * @param  message  Details about the message to display.
     * @param options Optionally override individual toast parameters.
     * @param settings Optionally override all toasts settings (i.e. placement or order).
     * @returns Object with reference to the message (i.e. to close it programmatically) if it was displayed.
     */
    static displayMessage(message: NotifyMessageDetailsType, options?: ToastOptions, settings?: ToasterSettings): {
        close: () => void;
    } | undefined;
    /** Output a message and/or alert to the user.
     * @param  message  Details about the message to output.
     */
    static addMessage(message: NotifyMessageDetailsType): void;
    /**
     * Closes sticky messages that are beyond the limit,
     * opens new toast and sticky messages from the active message manager.
     */
    private static refreshToastMessages;
    /** Add a message to the Message Center.
     * @param  message  Details about the message to output.
     */
    static addToMessageCenter(message: NotifyMessageDetailsType): void;
    /** Checks number of messages against the maximum. */
    private static checkMaxCachedMessages;
    /**
     * Sets details for setting up an Activity message.
     * @param details    Details for setup of ActivityMessage
     * @returns true if details is valid and can be used to display ActivityMessage
     */
    static setupActivityMessageDetails(details: ActivityMessageDetails): boolean;
    /**
     * Output an activity message to the user.
     * @param message         The message text.
     * @param percentComplete The percentage of completion.
     * @return true if the message was displayed, false if the message could not be displayed.
     */
    static outputActivityMessage(message: NotifyMessageType, percentComplete: number): boolean;
    /**
     * Sets values on _OngoingActivityMessage to be referenced when displaying
     * an ActivityMessage.
     * @param message     Message of the process that ActivityMessage is tracking
     * @param percentage  Progress made by activity in percentage
     * @param restored    True if original ActivityMessage has been closed and
     *                    is now being restored from the status bar.
     * @returns true if details is valid and can be used to display ActivityMessage
     */
    static setupActivityMessageValues(message: NotifyMessageType, percentage: number, restored?: boolean): boolean;
    /**
     * Dismisses current ActivityMessage and ends activity if canceled.
     * @param isCompleted   True if the activity was completed, false if it was canceled
     * @returns True if both ActivityMessage and activity process are ended.
     */
    static endActivityMessage(isCompleted: boolean): boolean;
    /**
     * Ends processing for activity according to message definition.
     * @param isCompleted   True if the activity was completed, false if it was canceled
     */
    private static endActivityProcessing;
    /**
     * Displays an input field message near target element.
     * @param target  The currently focused or recently focused element to place the
     *                input field message near.
     * @param messageText  Text to display in the message.
     * @param detailedMessage   Optional detailed message text to display.
     * @param priority   Optional message priority which controls icon to display.
     */
    static displayInputFieldMessage(target: HTMLElement, messageText: NotifyMessageType, detailedMessage?: NotifyMessageType, priority?: OutputMessagePriority): void;
    /**
     * Hides the currently displayed input field message.
     */
    static hideInputFieldMessage(): void;
    /**
     * Opens message center.
     */
    static openMessageCenter(): void;
    /** Output a prompt to the user. A 'prompt' indicates an action the user should take to proceed. */
    static outputPrompt(prompt: string): void;
    /** Extracts the message severity from the message details and returns the corresponding React icon.
     * @param details NotifyMessageDetailsType
     * @returns IconSpec
     * @deprecated in 4.16.0. Use {@link https://itwinui.bentley.com/ iTwinUI icons} instead.
     */
    static getIconSpecFromDetails(details: NotifyMessageDetailsType): IconSpec;
    /** Gets an icon CSS class name based on a given NotifyMessageDetailsType.
     * @public
     * @deprecated in 4.16.0. Used internally.
     */
    static getIconClassName(details: NotifyMessageDetailsType): string;
    /** Gets a MessageSeverity based on a given NotifyMessageDetailsType. */
    static getSeverity(details: NotifyMessageDetailsType): MessageSeverity;
    /** Gets a MessageBoxIconType based on a given NotifyMessageDetailsType. */
    static getIconType(details: NotifyMessageDetailsType): MessageBoxIconType;
    /** Output a MessageBox and wait for response from the user.
     * @param mbType       The MessageBox type.
     * @param message      The message to display.
     * @param icon         The MessageBox icon type.
     * @return the response from the user.
     */
    static openMessageBox(mbType: MessageBoxType, message: NotifyMessageType, icon: MessageBoxIconType): Promise<MessageBoxValue>;
    /** @internal */
    static showAlertMessageBox(messageDetails: NotifyMessageDetailsType): void;
    private static standardMessageBox;
    /** Setup tool assistance instructions for a tool. The instructions include the main instruction, which includes the current prompt.
     * @param instructions The tool assistance instructions.
     * @public
     */
    static setToolAssistance(instructions: ToolAssistanceInstructions | undefined): void;
    /** Show a tooltip window. Saves tooltip location for AccuSnap to test if cursor has moved far enough away to close tooltip.
     * @param htmlElement The HTMLElement that anchors the tooltip.
     * @param message     What to display inside the tooltip.
     * @param location    An optional location, relative to the origin of htmlElement, for the tooltip. If undefined, center of `htmlElement`.
     * @param options     Options that supply additional information about how the tooltip should function.
     */
    static openToolTip(htmlElement: HTMLElement, message: NotifyMessageType, location?: XAndY, options?: ToolTipOptions): void;
    /** @internal */
    static closeAllMessages(): void;
}
export {};
//# sourceMappingURL=MessageManager.d.ts.map