Overview
Package: @qatium/sdk/ui
This package exports methods to work with the Panel of the plugin.
sendMessage()
Allows the plugin UI to communicate with the plugin logic. Learn more about plugin communication.
Method signature
sendMessage<T>(message: T): void
Parameters
message: T
: an arbitrary message to be sent to the logic of the plugin. Check the documentation of structuredClone to verify what can be sent.
Example
Send a message to the plugin logic
sendMessage("my message")
onMessage()
Allows for listening messages from the plugin logic. Learn more about plugin communication.
Method signature
onMessage<T>(message: T): void
Parameters
message: T
: The message sent by the plugin logic.
Example
Receives a message and prints it into an HTML element.
onMessage<string>((message) => { const element = document.getElementById("response");
if (!element) { return; }
element.innerHTML = `Response: ${message}`;});