我已经见过this other question了,但尽管名称相似,但问题实际上是不同的,因为他们试图获取属性的类型,恰好与泛型类型参数相同,但我试图获取实际解析的类型参数,因为我想获取Array<T>的类型T,而数组类型中没有T类型的属性。所以我有一个这样的函数: import ts from 'typescrip
我试图在TypeScript中实现服务定位器模式。这是我的代码: private static serviceMap: Map<string, any>;public static get<T>(): T {
// firstly lazily register all of the necessary