Class: TextSelectionPlugin
Represents a plugin that can be registered, activated, and deactivated.
Extends
Implements
Constructors
new TextSelectionPlugin()
new TextSelectionPlugin(
documentView
):TextSelectionPlugin
Parameters
• documentView: DocumentView
Returns
Overrides
Properties
id
id:
string
='text-selection-plugin'
Unique identifier for the plugin.
Implementation of
Accessors
active
get
active():boolean
set
active(v
):void
Parameters
• v: boolean
Returns
boolean
debugMode
get
debugMode():boolean
set
debugMode(v
):void
Parameters
• v: boolean
Returns
boolean
documentView
get
documentView():DocumentView
The document view associated with the plugin.
set
documentView(v
):void
The document view associated with the plugin.
Parameters
• v: DocumentView
Returns
The document view associated with the plugin.
Implementation of
Methods
activate()
activate():
void
Activates the plugin.
Returns
void
Implementation of
addEventListener()
addEventListener<
K
>(type
,listener
):void
Register a function that will be called whenever the specified event is delivered.
Type Parameters
• K extends "textSelectionChanged"
A generic type representing the key of the event type.
Parameters
• type: K
String representing the event type to listen for.
• listener
The function that will be executed when an event of the specified type occurs.
Returns
void
Inherited from
deactivate()
deactivate():
void
Deactivates the plugin.
Returns
void
Implementation of
dispatchEvent()
dispatchEvent<
K
>(type
,args
):void
Dispatches an event to all registered listeners.
Type Parameters
• K extends "textSelectionChanged"
A generic type representing the key of the event type.
Parameters
• type: K
String representing the event type to dispatch.
• args: Parameters
<TextSelectionPluginEventMap
[K
]>
The data associated with the event.
Returns
void
Inherited from
removeAllListeners()
removeAllListeners<
K
>(type
):void
Remove all listeners for a given event.
Type Parameters
• K extends "textSelectionChanged"
A generic type representing the key of the event type.
Parameters
• type: K
String representing the event for which to remove all listeners.
Returns
void
Inherited from
EventEmitter
.removeAllListeners
removeEventListener()
removeEventListener<
K
>(type
,listener
):void
Removes an event listener previously registered with addEventListener.
Type Parameters
• K extends "textSelectionChanged"
A generic type representing the key of the event type.
Parameters
• type: K
String representing the event for which to remove an event listener.
• listener
The event listener function of the event handler to remove from the event target.
Returns
void