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.")
}
}