I need to overload a method using TypeScript.
FooModel has 6 parameters, but 2 string parameters are the only mandatory params. So instead of creating a FooModel every time I want to use the myMethod, I want to overload myMethod and create the FooModel once in there and then the rest of the logic before return.
I've tried this based on what I found so far online, but it I get the following error:
TS2394: This overload signature is not compatible with its implementation signature.
The solutions for this error is not compatable with my method
static async myMethod(model: FooModel): Promise<BarResult>
static async myMethod(inputText: string, outputText: string): Promise<BarResult>{
//implementation;
return new BarResult(); //Different content based on the inputs
}