My current challenge involves a set of arguments structured like so:
const args: FeatureEventArg[] = [
{
name: 'username',
type: 'string',
},
{
name: 'message',
type: 'string',
},
{
name: 'totalMessagesSent',
type: 'number',
},
];
The objective is to transform this list using some type, possibly
FeatreEventArgs<typeof args>
, in order to generate arguments for a callback function that resembles the following:
function callback(username: string, message: string, totalMessagesSent: number) {
// Other stuff
}
I have managed to tackle the types aspect through various adjustments and enhancements such as
extends "string" ? string
. However, I am encountering difficulty with the names which currently present as arg_0
instead of the specified names within the object.
If you have any recommendations, suggestions, or alternative solutions to address this issue, please feel free to share your insights. Thank you!