Edit

Share via


WorkloadAction type

Represents an action that can be handled by a specific workload. The shape of the action depends on the iframeType:

  • If iframeType is 'widget', then widgetType must be specified.
  • If iframeType is omitted or has any value other than 'widget', then widgetType must not be provided.
type WorkloadAction<TData> =
  | (BaseWorkloadAction<TData> & {
      iframeType: "widget"
      widgetType: WidgetType
    })
  | (BaseWorkloadAction<TData> & {
      iframeType?: Exclude<IFrameType, "widget">
      widgetType?: never
    })