I need help completing this type:
interface ReturnTypes {
string: string;
number: number;
boolean: boolean;
}
interface CommandOption {
type: keyof ReturnTypes;
}
interface Command<Options extends CommandOption[] = CommandOption[]> {
options?: Options;
handler: (...args: ?) => void; // Complete the type.
}
const command = {
options: [
{
type: "string",
},
{
type: "number",
},
{
type: "boolean",
},
],
handler(string, number, boolean) {
},
} satisfies Command;
I know ReturnTypes would be used at some point, but not sure how to do the rest.