Interface
The interface for all message actions. Message action executes when a matched message is received.
Properties
Property | Type | Notes |
---|---|---|
() => void | ||
(message: Message) => boolean | ||
(messageDescription: MessageDescription) => boolean | ||
(messageType: MessageType, messageWidgetId?: string) => string | ||
string | The unique id of the action. For actions provided by a widget, the id is: widgetId + actionName. | |
string | The action label. To support i18n, use | |
string | The action name. | |
(message: Message, actionConfig?: any) => boolean | Promise<boolean> | ||
(messageType: MessageType, messageWidgetId?: string) => void | ||
string | The widget id that provides the action. If a widget id is not provided, the action is provided by the Jimu framework. |
filterMessageDescription
Interface PropertyfilterMessageDescription: (messageDescription: MessageDescription) => boolean
Type declaration
function(messageDescription: MessageDescription): boolean
This indicates whether or not the type of message can trigger the filter message action. This method is used in builder to filter the available actions.
Parameters
Parameter | Type |
---|---|
message | MessageDescription |
Returns
boolean
getSettingComponentUri
getSettingComponentUri: (messageType: MessageType, messageWidgetId?: string) => string
Type declaration
function(messageType: MessageType, messageWidgetId?: string): string
This returns the action setting component uri. The returned value should match thesettingUri
from the widget manifest. If no setting is required, null
is returned.
This method is required for framework actions but optional for widget actions.
This setting component is used to configure the action according to the message.
Parameters
Parameter | Type |
---|---|
message | MessageType |
message | string |
Returns
string
id
Interface Propertyid: string
The unique id of the action. For actions provided by a widget, the id is: widgetId + actionName.
label
Interface Propertylabel: string
The action label. To support i18n, use _action_${actionName}
as the string key.
onExecute
Interface PropertyonExecute: (message: Message, actionConfig?: any) => boolean | Promise<boolean>
Type declaration
onRemoveListen
Interface PropertyonRemoveListen: (messageType: MessageType, messageWidgetId?: string) => void
Type declaration
function(messageType: MessageType, messageWidgetId?: string): void
When an action is removed from a message's listener, this function will be invoked.
Parameters
Parameter | Type |
---|---|
message | MessageType |
message | string |
Returns
void
destroy: () => void
Type declaration
function(): void
When a widget is removed, actions provided by this widget will be destroyed.
Returns
void