import { ActionType } from '../../_contract-src/action-payloads/action-type'; import { OpenModalPayload } from '../../_contract-src/action-payloads/open-modal/open-modal-payload'; import { postToHost } from './post-to-host'; /** * Opens a modal dialog in the Struct PIM host application. * The modal renders an iframe with the provided URL, allowing extensions to show * additional views without navigating away from the current page. * * @example * ```ts * struct.actions.openModal({ * url: 'https://my-app.example.com/detail', * id: 'detail-modal', * placement: 'right', * size: 'large', * }); * ``` */ export function openModal(params: OpenModalPayload) { postToHost({ actionType: ActionType.OpenModal, payload: params }); }