Back to Type Challenges

README.Ko

questions/00189-easy-awaited/README.ko.md

latest2.1 KB
Original Source
<!--info-header-start--><h1>Awaited </h1><blockquote><p>by Maciej Sikora <a href="https://github.com/maciejsikora" target="_blank">@maciejsikora</a></p></blockquote><p><a href="https://tsch.js.org/189/play/ko" target="_blank"></a> &nbsp;&nbsp;&nbsp;<a href="./README.md" target="_blank"></a> <a href="./README.zh-CN.md" target="_blank"></a> <a href="./README.ja.md" target="_blank"></a> </p><!--info-header-end-->

Promise와 같은 타입에 감싸인 타입이 있을 때, 안에 감싸인 타입이 무엇인지 어떻게 알 수 있을까요?

예시: 들어 Promise<ExampleType>이 있을 때, ExampleType을 어떻게 얻을 수 있을까요?

ts
type ExampleType = Promise<string>

type Result = MyAwaited<ExampleType> // string

출처: original article by @maciejsikora

<!--info-footer-start-->

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