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:

NameType
FFeature<any, any, any>
Hkeyof ExtractWebHandlerSpecsFromFeature<F>

Parameters:

NameTypeDescription
featFThe feature to which a message should be sent.
eventIdHA unique identifier for the event sent to the Web script.
payloadRequired<ExtractWebHandlerSpecsFromFeature<F>[H]>["payload"]The type of the message to sent.

Returns: void