(TS) Type에서 Promise 제거하기

snippet: typescript
2022.12.30
1분

Awaited 문법을 통해서 Promise 타입을 벗겨낼 수 있다.

// A = string
type A = Awaited<Promise<string>>;

// B = number
type B = Awaited<Promise<Promise<number>>>;

참고 자료