@@ -189,27 +189,26 @@ export const generateModuleDeclaration = (
189
189
) ;
190
190
}
191
191
192
- for ( let method of [ 'addEventListener' , 'removeEventListener' ] ) {
193
- moduleAPI . push (
194
- `${ method } (event: '${ domEvent . name } ', listener: (event: ${ eventType } ) => void${
195
- method === 'addEventListener' ? ', useCapture?: boolean' : ''
196
- } ): this;`,
197
- ) ;
198
- }
192
+ moduleAPI . push (
193
+ `addEventListener(event: '${ domEvent . name } ', listener: (event: ${ eventType } ) => void, options?: boolean | AddEventListenerOptions): void;` ,
194
+ ) ;
195
+ moduleAPI . push (
196
+ `removeEventListener(event: '${ domEvent . name } ', listener: (event: ${ eventType } ) => void, options?: boolean | EventListenerOptions): void;` ,
197
+ ) ;
199
198
} ) ;
200
199
201
200
// original overloads copied from HTMLElement, because they are not inherited
202
201
moduleAPI . push (
203
- `addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture ?: boolean): void;` ,
202
+ `addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options ?: boolean | AddEventListenerOptions ): void;` ,
204
203
) ;
205
204
moduleAPI . push (
206
- `addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture ?: boolean): void;` ,
205
+ `addEventListener(type: string, listener: EventListenerOrEventListenerObject, options ?: boolean | AddEventListenerOptions ): void;` ,
207
206
) ;
208
207
moduleAPI . push (
209
- `removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, useCapture ?: boolean): void;` ,
208
+ `removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options ?: boolean | EventListenerOptions ): void;` ,
210
209
) ;
211
210
moduleAPI . push (
212
- `removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture ?: boolean): void;` ,
211
+ `removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options ?: boolean | EventListenerOptions ): void;` ,
213
212
) ;
214
213
}
215
214
}
0 commit comments