Home > @i2analyze/notebook-sdk > toolview > IToolViewApi > addEventListener
toolview.IToolViewApi.addEventListener() method
Adds a listener for events that might affect the tool view.
Signature:
addEventListener<K extends keyof ToolViewApiEventMap>(type: K, listener: ToolViewApiEventMap[K], options?: ToolViewApiEventOptionsMap[K]): () => void;
Introduced: version 1.0
Type Parameters
Parameter | Type | Description |
---|---|---|
K | extends keyof ToolViewApiEventMap | The type of event to subscribe to. |
Parameters
Parameter | Type | Description |
---|---|---|
type | K | The type of event to subscribe to. |
listener | ToolViewApiEventMap[K] | A function to handle the event. |
options | ToolViewApiEventOptionsMap[K] | (Optional) An object that controls the behavior of the listener. |
Returns:
() => void
A function that can be called to remove the listener.