diff --git a/packages/golden-layout/src/utils/EventUtils.ts b/packages/golden-layout/src/utils/EventUtils.ts index 9268371dd..edcb8ecd9 100644 --- a/packages/golden-layout/src/utils/EventUtils.ts +++ b/packages/golden-layout/src/utils/EventUtils.ts @@ -27,7 +27,7 @@ export type EventListenerHook = ( * @param handler The handler to call when the event is emitted * @returns A function to stop listening for the event */ -export function listenForEvent( +export function listenForEvent( eventEmitter: EventEmitter, event: string, handler: EventHandlerFunction @@ -38,14 +38,14 @@ export function listenForEvent( }; } -export function makeListenFunction( +export function makeListenFunction( event: string ): EventListenFunction { return (eventEmitter, handler) => listenForEvent(eventEmitter, event, handler); } -export function makeEmitFunction( +export function makeEmitFunction( event: string ): EventEmitFunction { return (eventEmitter, ...parameters) => { @@ -53,7 +53,7 @@ export function makeEmitFunction( }; } -export function makeUseListenerFunction( +export function makeUseListenerFunction( event: string ): EventListenerHook { return (eventEmitter, handler) => { @@ -69,7 +69,9 @@ export function makeUseListenerFunction( * @param event Name of the event to create functions for * @returns Listener, Emitter, and Hook functions for the event */ -export function makeEventFunctions(event: string): { +export function makeEventFunctions( + event: string +): { listen: EventListenFunction; emit: EventEmitFunction; useListener: EventListenerHook;