addEventListener(type: string, fn: function, context?: any): T
addEventListener(eventMap: any, context?: any): T
Adds a listener function (fn) to a particular event type of the object. You
can optionally specify the context of the listener (object the this keyword
will point to). You can also pass several space-separated types (e.g. 'click
dblclick').
Removes all listeners to all events on the object.
Returns T
fire
fire(type: string, data?: any): T
Alias to fireEvent.
Parameters
type: string
Optional data: any
Returns T
fireEvent
fireEvent(type: string, data?: any): T
Fires an event of the specified type. You can optionally provide an data object
— the first argument of the listener function will contain its properties.
Parameters
type: string
Optional data: any
Returns T
hasEventListeners
hasEventListeners(type: string): boolean
Returns true if a particular event type has some listeners attached to it.
Parameters
type: string
Returns boolean
off
off(type: string, fn?: function, context?: any): T
Adds a listener function (fn) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. 'click dblclick').