import IEventDispatcher from 'gs-events/src/IEventDispatcher.js'Method Summary
| Public Methods | ||
| public |
addEventListener(type: String | Symbol, handler: Function | IEventListener, options: Boolean | IEventListenerOptions) 注册一个事件侦听器。 |
since 1.0.0 |
| public |
dispatchEvent(event: Event): Boolean 派发一个事件对象到目标对象的事件流中。 |
since 1.0.0 |
| public |
hasEventListener(type: String | Symbol): Boolean 检查是否注册了指定类型的事件侦听器。 |
since 1.0.0 |
| public |
removeEventListener(type: String | Symbol, handler: Function | IEventListener, useCapture: Boolean | IEventListenerOptions) 移除一个事件侦听器。 |
since 1.0.0 |
Public Methods
public addEventListener(type: String | Symbol, handler: Function | IEventListener, options: Boolean | IEventListenerOptions) since 1.0.0 source
注册一个事件侦听器。
Params:
| Name | Type | Attribute | Description |
| type | String | Symbol | 注册的事件类型。 |
|
| handler | Function | IEventListener | 指定事件处理函数或者是一个事件侦听器。 |
|
| options | Boolean | IEventListenerOptions |
|
指定侦听器配置选项。 |
public dispatchEvent(event: Event): Boolean since 1.0.0 source
派发一个事件对象到目标对象的事件流中。
Params:
| Name | Type | Attribute | Description |
| event | Event | 指定派发的事件对象。 |
public removeEventListener(type: String | Symbol, handler: Function | IEventListener, useCapture: Boolean | IEventListenerOptions) since 1.0.0 source
移除一个事件侦听器。
Params:
| Name | Type | Attribute | Description |
| type | String | Symbol | 移除的事件类型。 |
|
| handler | Function | IEventListener | 指定要移除的事件处理函数或者事件侦听器。 |
|
| useCapture | Boolean | IEventListenerOptions |
|
指定是移除捕获阶段( |
