Add more tsdoc comments

This commit is contained in:
Jon Staab
2024-12-13 15:11:48 -08:00
parent 474555ff4d
commit 6235c3f6bb
5 changed files with 79 additions and 0 deletions
+9
View File
@@ -1,6 +1,15 @@
import {EventEmitter} from 'events'
/**
* Extended EventEmitter that also emits all events to '*' listeners
*/
export class Emitter extends EventEmitter {
/**
* Emits an event to listeners and to '*' listeners
* @param type - Event type/name
* @param args - Arguments to pass to listeners
* @returns True if event had listeners
*/
emit(type: string, ...args: any[]) {
const a = super.emit(type, ...args)
const b = super.emit('*', type, ...args)