79171242

Date: 2024-11-08 19:01:31
Score: 1.5
Natty:
Report link

Does making the argument a generic parameter instead work for you?

So something like this:

abstract class BaseClass {
  public abstract userAuth<
    TResponse extends MyResponse = MyResponse,
    TError extends unknown = unknown
  >(): TResponse | UIError<TError>;
}

class TestClass extends BaseClass {
  public userAuth<
    TResponse extends MyResponse = MyResponse, TError extends unknown = unknown>(): TResponse | UIError<TError> {
      throw new Error("Method not implemented.")
  }
}
Reasons:
  • Contains signature (1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Eri