export interface ObjectInterface{
[key: string]: string | number | string[];
}
this is a interface I'm using, imported to the function(given below) from types.ts
the code below is for a function doing something
async createTaskService({
A,
B,
C,
}: ObjectInterface) {
A = A as string
B = B as string[]
C = C as number
//other stuff --unrelated
}
Restrictions are that the keys of ObjectInterface cannot be "named" as in the keys must remain variable strings. What I want to know is if there's a better way to accept the parameters and set their types rather than doing X = X as string etc.