Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🎸 トップにAwaitedの説明を追加 #920

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1536,7 +1536,7 @@ type T2 = NonNullable<T1>;
// ^?
```

### ReturnType
#### ReturnType

- [`ReturnType`](reference/type-reuse/utility-types/return-type.md)は、関数の戻り値の型を取得するユーティリティ型。

Expand All @@ -1549,6 +1549,20 @@ type StringifyReturnType = ReturnType<typeof stringify>;
// ^?
```

#### Awaited

- [`Awaited`](reference/type-reuse/utility-types/awaited.md)は、Promiseの戻り値の型を取得するユーティリティ型。

```typescript twoslash
const promise1 = Promise.resolve("data");
const promise2 = Promise.resolve(Promise.resolve("data"));

type Data1 = Awaited<typeof promise1>;
// ^?
type Data2 = Awaited<typeof promise2>;
// ^?
```

### Mapped types

- [Mapped types](reference/type-reuse/mapped-types.md)を使うと、既存の型から新しい型を生成できる。
Expand Down
Loading