import { ActionType } from '../../_contract-src/action-payloads/action-type'; import { SetIsDirtyStatePayload } from '../../_contract-src/action-payloads/set-is-dirty-state/set-is-dirty-state-payload'; import { postToHost } from './post-to-host'; /** * Notifies the Struct PIM host whether the extension has unsaved changes. * When the user attempts to navigate away from the surrounding editor while * any extension reports `isDirty: true`, the host shows its standard * unsaved-changes confirmation dialog. * * Only supported for extension point types: Tab, Section, and Property. * For other types, the host will reject the action. * * @example * ```ts * struct.actions.setIsDirtyState({ isDirty: true }); * ``` */ export function setIsDirtyState(params: SetIsDirtyStatePayload) { postToHost({ actionType: ActionType.SetIsDirtyState, payload: params }); }