I have a list of arguments looking a little something like this:
const args: FeatureEventArg[] = [
{
name: 'username',
type: 'string',
},
{
name: 'message',
type: 'string',
},
{
name: 'totalMessagesSent',
type: 'number',
},
];
And my goal is to take that list and with some type, like FeatreEventArgs<typeof args> or something, to get arguments for a callback function that would end up looking something like this:
function callback(username: string, message: string, totalMessagesSent: number) {
// Other stuff
}
I've managed to get the types part with a lot of fidelling and a lot of extends "string" ? string kinda thing. But the names are just arg_0 instead of the name in the object above.
Anyways, if you have any tips or ideas of how I can achieve this or any other solutions to the problem please let me know.
(username: string, message: string, totalMessagesSent: number)=>voidand(x: string, y: string, z: number)=>voidare identical. Also, what exactly do you mean by "get arguments for a callback function"? Is this in a type? Or an actual function implementation?