I'm using the following code to overload a function defining an 'event' handler.
export function on(eventName: 'created', eventCallback: (args: { uuid: string }) => void): any;
export function on(eventName: 'updated', eventCallback: (args: { id: number }) => void): any;
export function on(eventName: any, eventCallback: any) {
}
Is there any way I can template this process so that I can overload this function with an abitruary number of events:
type Events = ['created',{uuid: string}] | ['updated',{id: number}];
export function on(eventName: any, eventCallback: any) {
}