import { ActionType } from '../../_contract-src/action-payloads/action-type'; import { NavigatePayload } from '../../_contract-src/action-payloads/navigate/navigate-payload'; import { postToHost } from './post-to-host'; /** * Navigates the Struct PIM host to a relative path within the PIM. * * `path` must be a relative, app-absolute path starting with a single "/" * (e.g. "/pim/search"). The host * resolves it against the current tenant origin — extensions do not need to * know the tenant host. Absolute or protocol-relative URLs are rejected and * surface an error to the user. * * @example * ```ts * struct.actions.navigate({ path: '/pim/search' }); * ``` */ export function navigate(params: NavigatePayload) { postToHost({ actionType: ActionType.Navigate, payload: params }); }