@@ -189,27 +189,26 @@ export const generateModuleDeclaration = (
189189 ) ;
190190 }
191191
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+ ) ;
199198 } ) ;
200199
201200 // original overloads copied from HTMLElement, because they are not inherited
202201 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: ${ _ . upperFirst ( module . name ) } , ev: HTMLElementEventMap[K]) => any, options ?: boolean | AddEventListenerOptions ): void;` ,
204203 ) ;
205204 moduleAPI . push (
206- `addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture ?: boolean): void;` ,
205+ `addEventListener(type: string, listener: EventListenerOrEventListenerObject, options ?: boolean | AddEventListenerOptions ): void;` ,
207206 ) ;
208207 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: ${ _ . upperFirst ( module . name ) } , ev: HTMLElementEventMap[K]) => any, options ?: boolean | EventListenerOptions ): void;` ,
210209 ) ;
211210 moduleAPI . push (
212- `removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture ?: boolean): void;` ,
211+ `removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options ?: boolean | EventListenerOptions ): void;` ,
213212 ) ;
214213 }
215214 }
0 commit comments