Can I use a generic type as object index type in TypesScript?

前端 未结 0 576
面向向阳花
面向向阳花 2021-01-30 23:18

I have a use case similar to the following:



type StringKeysOf = [{
  [K in keyof T]-?: T[K] extends string ? K :         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题