import { StructEntityType } from '../../shared/struct-entity-type'; export interface BaseContextPayload { messagingVersion: string; slug: string; currentLanguage?: string; currentUser?: string; currentSegments?: Record; } export interface TabContextPayload extends BaseContextPayload { entityId: number; entityType: StructEntityType; } export interface SectionContextPayload extends BaseContextPayload { entityId: number; entityType: StructEntityType; } export interface SidebarWidgetContextPayload extends BaseContextPayload { entityId: number; entityType: StructEntityType; } export interface PropertyContextPayload extends BaseContextPayload { entityId: number; entityType: StructEntityType; } export interface ExporterContextPayload extends BaseContextPayload { selectedEntityIds: number[]; selectedEntityType: StructEntityType; } export interface SearchActionContextPayload extends BaseContextPayload { selectedEntityIds: number[]; selectedEntityType: StructEntityType; } export interface WidgetContextPayload extends BaseContextPayload { /** * Identifies the dashboard widget this extension renders in. Stable for the lifetime of the widget, * and distinct per widget, so the same app embedded twice on one dashboard can tell itself apart. * * This is a render-slot identifier, not an authorization subject: it is self-asserted by the embedded * page and cannot be verified by the app's backend. Authorize on the getToken() JWT instead. */ widgetUid: string; /** * True while the widget renders inside the widget settings surface - both the configure step of the * add-widget flow and the settings dialog of an existing widget - where the extension is expected to * render its configuration UI. False on the dashboard. Fixed for the lifetime of the iframe. */ isSettingsMode: boolean; } //These are intentionally typed as BaseContextPayload since they have no additional fields, but are exported as separate interfaces for clarity and future extensibility. // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface PageContextPayload extends BaseContextPayload {} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ImportContextPayload extends BaseContextPayload {} // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ConfigContextPayload extends BaseContextPayload {}