Generics are bivariant in TypeScript and so unsound:
class Base {}
class Derived1 extends Base {}
class Derived2 extends Base {}
class Box<T> {
constructor(public value: T) {}
};
var a: Derived1 = new Derived1();
var b: Box<Base> = new Box<Base>(a);
var c: Box<Derived2> = b;
var d: Derived2 = c.value;
TypeScript is structurally typed; there's nothing in your example that suggests that Derived1 and Derived2 have different types, instances of each are the same type.