type Foo = {
[key: string]: any
foo(): void
}
type A = RemoveIndexSignature<Foo> // expected { foo(): void }
type RemoveIndexSignature<T> = {
[K in keyof T as string extends K ? never : K]: T[K]
}
这里面的 K in keyof T as string extends K
是怎么执行的呢, 是把每一个键都变成字符串然后 extends K 吗? foo() as string
为什么不相等呢