I have several Items that they all inherit from the abstract Item. The object should contain a map with different Item implementations. With my current code I encountered the following error in the Object:
TS2314: Generic type 'Item<'T'>' requires 1 type argument(s)
In Java, that's not a problem. How do I get this to work in TypeScript?
Items
abstract class Item<T> {
}
class Item1 extends Item<boolean> {
}
class Item2 extends Item<number> {
}
Object.ts
class Object {
private itemMap: Map<number, Item>;
}