TypeScript 型パズル 逆引き帳
Mapped types on tuples and arrays
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#mapped-types-on-tuples-and-arrays
可変長型引数をとるジェネリクスで、型引数を別の型にマップできる。
code:typescript
type MapToPromise<T> = { K in keyof T: Promise<TK> };
type Coordinate = number, number;
type PromiseCoordinate = MapToPromise<Coordinate>; // Promise<number>, Promise<number>