From a static dictionary of strings, infer a type/interface describing the dictionary precisely, using string literals for value types

前端 未结 0 736
广开言路
广开言路 2021-01-03 03:39

I have a static dictionary:

const myDict = {
  1: "one",
  2: "two"
}

The default inferred type for this is Record&

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