Generics on classes and interfaces
Classes can be generic too:
class Box<T> {
constructor(public value: T) {}
get(): T { return this.value; }
}
const b = new Box<number>(10);
b.get(); // number
The class stores and returns T, so a Box<number> only ever holds numbers. Generic interfaces constrain method contracts the same way.