export type ToEventMap<TRecord extends Record<string, any[]>, TResponses extends Record<keyof TRecord, any> | undefined = undefined> = { [TKey in keyof TRecord]: [ event: TResponses extends Record<keyof TRecord, any> ? { ack(): Promise<void>; reply(data: TResponses[TKey]): Promise<void>; } : { ack(): Promise<void>; data: TRecord[TKey]; } ];};