如何从打字稿中的键字符串类型中排除某些类型?

时间:2021-03-08 13:26:27

标签: javascript typescript

我想从键的字符串类型中排除 firstName 键。

enter image description here

但我收到了 An index signature parameter type must be either 'string' or 'number'.ts(1023) 错误。

沙盒演示: codesandbox.io/s/pzo4u?file=/index.ts

0 个答案:

没有答案