import { ActionType } from '../../_contract-src/action-payloads/action-type'; import { postToHost } from './post-to-host'; /** * Asks the Struct PIM host to close the container that is currently * hosting this extension iframe (e.g. an exporter dialog or a * search-action dialog). * * Only available for extension points whose host renders the iframe * inside a dismissible dialog — currently `Exporter` and `SearchAction`. * The host will reject the action with `ACTION_REJECTED` for any other * extension point type. * * @example * ```ts * // After your exporter has finished its work: * struct.actions.closeHostContainer(); * ``` */ export function closeHostContainer() { postToHost({ actionType: ActionType.CloseHostContainer, payload: {} }); }