Skip to content

Commit 7ff1d87

Browse files
codebytereMarshallOfSound
authored andcommitted
fix: overzealous EventEmitter typings (#148)
1 parent 073e62b commit 7ff1d87

File tree

1 file changed

+24
-12
lines changed

1 file changed

+24
-12
lines changed

src/utils.ts

+24-12
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,30 @@ export const paramify = (paramName: string) => {
198198
};
199199
// TODO: Infer through electron-docs-linter/parser
200200
export const isEmitter = (module: Pick<ModuleDocumentationContainer, 'name'>) => {
201-
switch (module.name.toLowerCase()) {
202-
case 'menu':
203-
case 'menuitem':
204-
case 'nativeimage':
205-
case 'shell':
206-
case 'crashreporter':
207-
case 'dock':
208-
case 'commandline':
209-
return false;
210-
default:
211-
return true;
212-
}
201+
const nonEventEmitters = [
202+
'menu',
203+
'menuitem',
204+
'nativeimage',
205+
'shell',
206+
'browserview',
207+
'webrequest',
208+
'crashreporter',
209+
'dock',
210+
'commandline',
211+
'browserwindowproxy',
212+
'clipboard',
213+
'contenttracing',
214+
'desktopcapturer',
215+
'dialog',
216+
'globalshortcut',
217+
'powersaveblocker',
218+
'touchbar',
219+
'touchbarbutton',
220+
'net',
221+
'netlog',
222+
'protocol'
223+
];
224+
return !(nonEventEmitters.includes(module.name.toLowerCase()))
213225
};
214226
export const isPrimitive = (type: string) => {
215227
const primitives = ['boolean', 'number', 'any', 'string', 'void', 'unknown'];

0 commit comments

Comments
 (0)