/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module Notification
 */
import { NotifyMessageDetails, OutputMessageAlert, OutputMessageType } from "@itwin/core-frontend";
import { RelativePosition } from "@itwin/appui-abstract";
/** Describes a message to be displayed to the user and adds support for React components in messages.
 * @public
 */
export class ReactNotifyMessageDetails {
    /** Constructor
     *  @param priority           The priority this message should be accorded by the NotificationManager.
     *  @param briefMessage       A short message that conveys the simplest explanation of the issue.
     *  @param detailedMessage    A comprehensive message that explains the issue in detail and potentially offers a solution.
     *  @param msgType            The type of message.
     *  @param openAlert          Whether an alert box should be displayed or not, and if so what kind.
     */
    constructor(priority, briefMessage, detailedMessage, msgType = OutputMessageType.Toast, openAlert = OutputMessageAlert.None) {
        this.priority = priority;
        this.briefMessage = briefMessage;
        this.detailedMessage = detailedMessage;
        this.msgType = msgType;
        this.openAlert = openAlert;
        /** Create an internal NotifyMessageDetails */
        this._notifyMessageDetails = new NotifyMessageDetails(priority, "", undefined, msgType, openAlert);
    }
    /** @internal */
    get messageDetails() { return this._notifyMessageDetails; }
    /** Amount of time a Toast message is displayed */
    get displayTime() { return this._notifyMessageDetails.displayTime; }
    set displayTime(duration) { this._notifyMessageDetails.displayTime = duration; }
    /** Anchor viewport for a Pointer message */
    get viewport() { return this._notifyMessageDetails.viewport; }
    /** Point for a Pointer message */
    get displayPoint() { return this._notifyMessageDetails.displayPoint; }
    /** Relative position for a Pointer message */
    get relativePosition() { return this._notifyMessageDetails.relativePosition; }
    /** Anchor input field for an Input Field message */
    get inputField() { return this._notifyMessageDetails.inputField; }
    /** Set OutputMessageType.Pointer message details.
     * @param viewport            Viewport over which to display the Pointer type message.
     * @param displayPoint        Point at which to display the Pointer type message.
     * @param relativePosition    Position relative to displayPoint at which to display the Pointer type message.
     */
    setPointerTypeDetails(viewport, displayPoint, relativePosition = RelativePosition.TopRight) {
        this._notifyMessageDetails.setPointerTypeDetails(viewport, displayPoint, relativePosition);
    }
    /** Set OutputMessageType.InputField message details.
     * @param inputField          Input field that message pertains. The message will be shown just below this input field element.
     */
    setInputFieldTypeDetails(inputField) {
        this._notifyMessageDetails.setInputFieldTypeDetails(inputField);
    }
}
/** ReactNotifyMessageDetails type guard.
 * @internal
 */
export const isReactNotifyMessageDetails = (details) => {
    return details.messageDetails !== undefined;
};
//# sourceMappingURL=ReactNotifyMessageDetails.js.map