"use strict";
/*---------------------------------------------------------------------------------------------
* 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
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.isReactNotifyMessageDetails = exports.ReactNotifyMessageDetails = void 0;
const core_frontend_1 = require("@itwin/core-frontend");
const appui_abstract_1 = require("@itwin/appui-abstract");
/** Describes a message to be displayed to the user and adds support for React components in messages.
 * @public
 */
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 = core_frontend_1.OutputMessageType.Toast, openAlert = core_frontend_1.OutputMessageAlert.None) {
        this.priority = priority;
        this.briefMessage = briefMessage;
        this.detailedMessage = detailedMessage;
        this.msgType = msgType;
        this.openAlert = openAlert;
        /** Create an internal NotifyMessageDetails */
        this._notifyMessageDetails = new core_frontend_1.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 = appui_abstract_1.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);
    }
}
exports.ReactNotifyMessageDetails = ReactNotifyMessageDetails;
/** ReactNotifyMessageDetails type guard.
 * @internal
 */
const isReactNotifyMessageDetails = (details) => {
    return details.messageDetails !== undefined;
};
exports.isReactNotifyMessageDetails = isReactNotifyMessageDetails;
//# sourceMappingURL=ReactNotifyMessageDetails.js.map