This module provides functionality for constructing events similar to
WebExtensions events.Event
objects.
Classes
Methods
(static) createEvent(optionsopt) → {Event}
Create a new Event object that implements WebExtensions event syntax, with the provided options.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
The options for the event. Properties
|
Returns:
- The created
Event
object.
- Type
- Event
Type Definitions
addListenerCallback(listener, options)
A callback function that is called immediately before a listener is added.
Parameters:
Name | Type | Description |
---|---|---|
listener |
function | The listener that is being added. |
options |
Object | The options for the listener. |
notifyListenersCallback(listener, listenerArguments, options) → {boolean}
A callback function that is called when a listener may be notified via
notifyListeners()
.
Parameters:
Name | Type | Description |
---|---|---|
listener |
function | The listener that may be called. |
listenerArguments |
Array | The arguments that would be passed to the listener function. |
options |
Options | The options that the listener was added with. |
Returns:
Whether to call the listener.
- Type
- boolean
removeListenerCallback(listener, options)
A callback function that is called immediately after a listener is removed.
Parameters:
Name | Type | Description |
---|---|---|
listener |
function | The listener that was removed. |
options |
Object | The options that the listener was added with. |