Typescript: how to return the proper class and generic type in a dependency
问题 I'm trying to find a way to inject an object into another object (dependency injection), in which the container object can return the proper injected object type , and no need to explicitly pass types to the function (type inference). To make sure the injected objects have a common interface and a default behavior, they'd be instances of an Abstract class. Given that I'd need such a behavior at some ponctual place, I would like to avoid using a dependency injection framework to do so. It