import { ActionType } from '../../_contract-src/action-payloads/action-type'; import { CloseModalPayload } from '../../_contract-src/action-payloads/close-modal/close-modal-payload'; import { postToHost } from './post-to-host'; /** * Closes a modal dialog previously opened with {@link openModal}. * The modal is identified by the same `id` that was used when opening it. * * @example * ```ts * struct.actions.closeModal({ id: 'detail-modal' }); * ``` */ export function closeModal(params: CloseModalPayload) { postToHost({ actionType: ActionType.CloseModal, payload: params }); }