@caido/quickjs-types / llrt/dom-events
llrt/dom-events
Classes
CustomEvent<D>
An event which takes place in the system.
Type Parameters
Type Parameter | Default type |
---|---|
D | any |
Implements
Constructors
new CustomEvent()
new CustomEvent<
D
>(type
:string
,opts
?:object
):CustomEvent
<D
>
Parameters
Parameter | Type |
---|---|
type | string |
opts ? | { details : D ; } |
opts.details ? | D |
Returns
CustomEvent
<D
>
Properties
details
readonly
details:null
|D
type
readonly
type:string
Returns the type of event, e.g. "click", "hashchange", or "submit".
Implementation of
EventTarget
EventTarget is an interface implemented by objects that can receive events and may have listeners for them.
Extended by
Constructors
new EventTarget()
new EventTarget():
EventTarget
Returns
Methods
addEventListener()
addEventListener(
type
:EventKey
,listener
:EventListener
,options
?:AddEventListenerOptions
):void
Adds a new handler for the type
event. Any given listener
is added only once per type
.
If the once
option is true, the listener
is removed after the next time a type
event is dispatched.
Parameters
Parameter | Type |
---|---|
type | EventKey |
listener | EventListener |
options ? | AddEventListenerOptions |
Returns
void
dispatchEvent()
dispatchEvent(
event
:Event
):void
Dispatches a synthetic event event to target
Parameters
Parameter | Type |
---|---|
event | Event |
Returns
void
removeEventListener()
removeEventListener(
type
:EventKey
,listener
:EventListener
):void
Removes the event listener in target's event listener list with the same type and callback
Parameters
Parameter | Type |
---|---|
type | EventKey |
listener | EventListener |
Returns
void
Interfaces
AddEventListenerOptions
Properties
once?
optional
once:boolean
When true
, the listener is automatically removed when it is first invoked. Default: false
.
Event
An event which takes place in the system.
Properties
type
readonly
type:EventKey
Returns the type of event, e.g. "click", "hashchange", or "submit".
EventListener()
EventListener(
evt
:Event
):void
Parameters
Parameter | Type |
---|---|
evt | Event |
Returns
void
Type Aliases
EventKey
EventKey:
string
|symbol