"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.updateModal = exports.hideModal = exports.showModalUrl = exports.showModalComponent = void 0;
var tslib_1 = require("tslib");
var actions_1 = require("../constants/actions");
/**
 * Displays the specified component in a modal dialog
 *
 * @export
 * @param {*} options Modal dialog display options
 * @returns {IShowComponentInModalAction}
 */
function showModalComponent(options) {
    return {
        type: actions_1.ActionType.MODAL_SHOW_COMPONENT,
        payload: tslib_1.__assign({}, options)
    };
}
exports.showModalComponent = showModalComponent;
/**
 * Displays the specified URL in a modal dialog
 *
 * @export
 * @param {*} options Modal dialog display options
 * @returns {IShowModalUrlAction}
 */
function showModalUrl(options) {
    return {
        type: actions_1.ActionType.MODAL_SHOW_URL,
        payload: tslib_1.__assign({}, options)
    };
}
exports.showModalUrl = showModalUrl;
/**
 * Hides an open modal dialog
 *
 * @export
 * @param name The name of the modal to hide
 * @returns {ICloseModalAction}
 */
function hideModal(name) {
    return {
        type: actions_1.ActionType.MODAL_CLOSE,
        payload: name
    };
}
exports.hideModal = hideModal;
/**
 * Update settings of the given modal
 *
 * @param name The name of the modal to update
 * @param args
 * @since 0.14.8
 */
function updateModal(name, args) {
    return {
        type: actions_1.ActionType.MODAL_UPDATE,
        payload: {
            name: name,
            args: args
        }
    };
}
exports.updateModal = updateModal;
//# sourceMappingURL=modal.js.map