Skip to content

Commit

Permalink
Merge pull request #904 from yytypescript/feature/903
Browse files Browse the repository at this point in the history
docs: ✏️ はじめににReturnType<T>の説明を追加
  • Loading branch information
jamashita authored Oct 11, 2024
2 parents b538c3b + 0c73522 commit 879cebe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1536,6 +1536,19 @@ type T2 = NonNullable<T1>;
// ^?
```

### ReturnType

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

```typescript twoslash
function stringify(value: number): string {
return `${value}`;
}

type StringifyReturnType = ReturnType<typeof stringify>;
// ^?
```

### Mapped types

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

0 comments on commit 879cebe

Please sign in to comment.