I have a class that has some pretty complicated types based on the generics passed to the class. I use these same types in a few places and I'm trying to figure out how to make them reusable:
class Foo<T> {
method(): SomeComplicateType<T> {}
method2(): SomeComplicateType<T> {}
}
The only thing I can come up with is this, but it allows the user to overwrite the type which I don't want:
class Foo<T, U=SomeComplicatedType<T>> {
method(): U {}
method2(): U {}
}