2020-02-10 14:23:58 -05:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 15:08:49 -04:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2020-02-10 14:23:58 -05:00
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Additional `EventTarget` methods added by `Zone.js`.
|
|
|
|
*
|
|
|
|
* 1. removeAllListeners, remove all event listeners of the given event name.
|
|
|
|
* 2. eventListeners, get all event listeners of the given event name.
|
|
|
|
*/
|
|
|
|
interface EventTarget {
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Remove all event listeners by name for this event target.
|
|
|
|
*
|
2020-03-09 06:48:48 -04:00
|
|
|
* This method is optional because it may not be available if you use `noop zone` when
|
|
|
|
* bootstrapping Angular application or disable the `EventTarget` monkey patch by `zone.js`.
|
|
|
|
*
|
2020-02-10 14:23:58 -05:00
|
|
|
* If the `eventName` is provided, will remove event listeners of that name.
|
|
|
|
* If the `eventName` is not provided, will remove all event listeners associated with
|
|
|
|
* `EventTarget`.
|
|
|
|
*
|
|
|
|
* @param eventName the name of the event, such as `click`. This parameter is optional.
|
|
|
|
*/
|
2020-03-09 06:48:48 -04:00
|
|
|
removeAllListeners?(eventName?: string): void;
|
2020-02-10 14:23:58 -05:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Retrieve all event listeners by name.
|
|
|
|
*
|
2020-03-09 06:48:48 -04:00
|
|
|
* This method is optional because it may not be available if you use `noop zone` when
|
|
|
|
* bootstrapping Angular application or disable the `EventTarget` monkey patch by `zone.js`.
|
|
|
|
*
|
2020-02-10 14:23:58 -05:00
|
|
|
* If the `eventName` is provided, will return an array of event handlers or event listener
|
|
|
|
* objects of the given event.
|
|
|
|
* If the `eventName` is not provided, will return all listeners.
|
|
|
|
*
|
|
|
|
* @param eventName the name of the event, such as click. This parameter is optional.
|
|
|
|
*/
|
2020-03-09 06:48:48 -04:00
|
|
|
eventListeners?(eventName?: string): EventListenerOrEventListenerObject[];
|
2020-02-10 14:23:58 -05:00
|
|
|
}
|