enhance: improve test case in 01367-medium-remove-index-signature (#12651)

This commit is contained in:
pq 2022-07-04 19:49:52 +08:00 committed by GitHub
parent f9d06bb112
commit d14f44bd38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,11 +8,13 @@ type Foo = {
type Bar = {
[key: number]: any
bar(): void
0: string
}
const foobar = Symbol('foobar')
type FooBar = {
[key: symbol]: any
foobar(): void
[foobar](): void
}
type Baz = {
@ -22,7 +24,7 @@ type Baz = {
type cases = [
Expect<Equal<RemoveIndexSignature<Foo>, { foo(): void }>>,
Expect<Equal<RemoveIndexSignature<Bar>, { bar(): void }>>,
Expect<Equal<RemoveIndexSignature<FooBar>, { foobar(): void }>>,
Expect<Equal<RemoveIndexSignature<Bar>, { bar(): void; 0: string }>>,
Expect<Equal<RemoveIndexSignature<FooBar>, { [foobar](): void }>>,
Expect<Equal<RemoveIndexSignature<Baz>, { bar(): void; baz: string }>>,
]