Interface: WebHandle
An object to send messages from the shell to the Web. See WebjsContext.onShellMessage, WebshellInvariantProps.webHandleRef and FeatureBuilder.withWebHandler.
Hierarchy
- WebHandle
Methods
postMessageToWeb
â–¸ postMessageToWeb<F, H>(feat
: F, eventId
: H, payload
: Required<ExtractWebHandlerSpecsFromFeature<F>[H]>["payload"]): void
Send a message to a Web handler, e.g. a callback registered in the Web script associated with a feature.
remarks
Web handlers must have been declared with FeatureBuilder.withWebHandler.
Type parameters:
Name | Type |
---|---|
F | Feature<any, any, any> |
H | keyof ExtractWebHandlerSpecsFromFeature<F> |
Parameters:
Name | Type | Description |
---|---|---|
feat | F | The feature to which a message should be sent. |
eventId | H | A unique identifier for the event sent to the Web script. |
payload | Required<ExtractWebHandlerSpecsFromFeature<F>[H]>["payload"] | The type of the message to sent. |
Returns: void