我有以下对象
[{ "key": "a1", ... }, { "key": "a2", ... }, ...]
是否可以"a1" | "a2" | ...从此对象中提取联合类型?我知道可以['a1', 'a2', ...]通过使用元组 API来提取它,这里介绍了TypeScript String Union to String Array,但我无法弄清楚对象数组
"a1" | "a2" | ...
['a1', 'a2', ...]
typescript typescript-typings
typescript ×1
typescript-typings ×1