可以创建一个类型来获取索引签名的类型部分吗?示例:
type Foo = { [id: string]: Date }
type IndexSignatureType<T> = ???
const bar: IndexSignatureType<Foo>; // has type Date发布于 2019-07-05 22:12:56
您可以只使用索引型查询:
type Foo = { [id: string]: Date }
const bar: Foo[string]; // is Datehttps://stackoverflow.com/questions/56904622
复制相似问题