Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

New page for Utility Types. #801

Merged
merged 4 commits into from
Aug 21, 2018

Conversation

csantos42
Copy link
Contributor

@csantos42 csantos42 commented Aug 5, 2018

Fixes #798

This PR introduces documentation for TypeScript Utility Types.

The majority of the sample code was either borrowed or inspired by the release notes of TS 2.1 and TS 2.8, and the sample code for ThisType<T> was taken from the PR that introduced this functionality.

The documented Utility Types are:

  • Partial<T>
  • Readonly<T>
  • Record<K, T>
  • Pick<T, K>
  • Exclude<T, U>
  • Extract<T, U>
  • NonNullable<T>
  • ReturnType<T>
  • InstanceType<T>
  • Required<T>
  • ThisType<T> (fixes Document ThisType<T> #649)

@csantos42 csantos42 changed the title Utility types page New page for Utility Types. Aug 5, 2018
@csantos42
Copy link
Contributor Author

Hey guys @RyanCavanaugh @DanielRosenwasser -- would love to get some eyes on this 🙏

@RyanCavanaugh
Copy link
Member

Thank you!

@RyanCavanaugh RyanCavanaugh merged commit 8a166ad into microsoft:master Aug 21, 2018
@Retsam
Copy link
Contributor

Retsam commented Feb 1, 2019

Should this page be published to the website? I don't see it linked from the "Handbook" sidebar on the main typescript website.

@mweststrate
Copy link

It is not linked indeed, but can found under: https://www.typescriptlang.org/docs/handbook/utility-types.html

alipiry pushed a commit to alipiry/TypeScript-Handbook that referenced this pull request Jan 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document Utility Types (Predefined types) Document ThisType<T>
4 participants