Back to Type Challenges

README

questions/01367-medium-remove-index-signature/README.md

latest1.4 KB
Original Source
<!--info-header-start--><h1>Remove Index Signature </h1><blockquote><p>by hiroya iizuka <a href="https://github.com/hiroyaiizuka" target="_blank">@hiroyaiizuka</a></p></blockquote><p><a href="https://tsch.js.org/1367/play" target="_blank"></a> &nbsp;&nbsp;&nbsp;<a href="./README.ko.md" target="_blank"></a> </p><!--info-header-end-->

Implement RemoveIndexSignature<T> , exclude the index signature from object types.

For example:

ts
type Foo = {
  [key: string]: any
  foo(): void
}

type A = RemoveIndexSignature<Foo> // expected { foo(): void }
<!--info-footer-start-->

<a href="../../README.md" target="_blank"></a> <a href="https://tsch.js.org/1367/answer" target="_blank"></a> <a href="https://tsch.js.org/1367/solutions" target="_blank"></a> <!--info-footer-end-->