File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ export const generateModuleDeclaration = (
96
96
...parentModules . map ( m => m . instanceEvents || [ ] ) ,
97
97
)
98
98
. sort ( ( a , b ) => a . name . localeCompare ( b . name ) )
99
- . forEach ( moduleEvent => {
99
+ . forEach ( ( moduleEvent , i , events ) => {
100
100
utils . extendArray (
101
101
moduleAPI ,
102
102
utils . wrapComment ( moduleEvent . description , moduleEvent . additionalTags ) ,
@@ -198,6 +198,15 @@ export const generateModuleDeclaration = (
198
198
}
199
199
moduleAPI . push ( `${ method } (event: '${ moduleEvent . name } ', listener: ${ listener } ): this;` ) ;
200
200
}
201
+
202
+ // EventEmitter methods get overriden above. In order to not break untyped usage, we need to add them back after the last event.
203
+ if ( module . name === 'process' && i === events . length - 1 ) {
204
+ for ( const method of methods ) {
205
+ moduleAPI . push (
206
+ `${ method } (eventName: string | symbol, listener: (...args: any[]) => void): this;` ,
207
+ ) ;
208
+ }
209
+ }
201
210
} ) ;
202
211
}
203
212
You can’t perform that action at this time.
0 commit comments