1 | export class SignatureEventTarget {
|
2 |
|
3 | private _et: EventTarget;
|
4 |
|
5 |
|
6 | constructor() {
|
7 | try {
|
8 | this._et = new EventTarget();
|
9 | } catch (error) {
|
10 |
|
11 |
|
12 | this._et = document;
|
13 | }
|
14 | }
|
15 |
|
16 | addEventListener(
|
17 | type: string,
|
18 | listener: EventListenerOrEventListenerObject | null,
|
19 | options?: boolean | AddEventListenerOptions,
|
20 | ): void {
|
21 | this._et.addEventListener(type, listener, options);
|
22 | }
|
23 |
|
24 | dispatchEvent(event: Event): boolean {
|
25 | return this._et.dispatchEvent(event);
|
26 | }
|
27 |
|
28 | removeEventListener(
|
29 | type: string,
|
30 | callback: EventListenerOrEventListenerObject | null,
|
31 | options?: boolean | EventListenerOptions,
|
32 | ): void {
|
33 | this._et.removeEventListener(type, callback, options);
|
34 | }
|
35 | }
|