Good afternoon,
This seems simple enough, but I am unsure how to proceed. I'd like to create an object that has a function for every key in an enum. But each function has a different set of parameters.
How can I type this object so that accessing the function from the object has the correct parameters as the original function?
Using ...params: any[] isn't giving me the outcome I was expecting.
export const functions: {
[key in Functions]: (...params: any[]) => void;
} = {
[Functions.One]: (userId: number) => {},
[Functions.Two]: (
userId: number,
x: number,
y: number
) => {},
};
Thanks!