【发布时间】:2021-08-14 17:53:51
【问题描述】:
我想声明一个Map<T, K> 类型,映射中的键是类,映射的值应该是对应键的实例。例如:
class X {}
type InstanceMap = // the type that I want to declare
const map: InstanceMap = new Map();
map.set( X, new X() );
【问题讨论】:
标签: javascript typescript