Skip to content

Document predefined types #24558

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

Closed
4 tasks done
mjomble opened this issue Jun 1, 2018 · 4 comments
Closed
4 tasks done

Document predefined types #24558

mjomble opened this issue Jun 1, 2018 · 4 comments
Labels
Docs The issue relates to how you learn TypeScript

Comments

@mjomble
Copy link

mjomble commented Jun 1, 2018

Search Terms

predefined, document, partial

Suggestion

TypeScript provides several predefined types that can be very useful, such as Partial<T>, Required<T>, etc.
It might be a good idea to have a separate page in the documentation that lists all of them.

Use Cases

These types are currently not very easily discoverable for new users.
A few are mentioned in the documentation under more generic topics and new ones are mentioned in "What's new in this version" posts.
They can be looked up in the declaration files, but a lot of future users likely won't know to go looking for them and will end up reinventing the wheel.

Examples

Flow documentation has a page like this called Utility Types

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript / JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. new expression-level syntax)
@mhegazy mhegazy added the Docs The issue relates to how you learn TypeScript label Jun 1, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Jun 1, 2018

A PR to https://github.com/Microsoft/TypeScript-Handbook would be appreciated.

@csantos42
Copy link
Contributor

Great idea 👍 -- I opened an issue (microsoft/TypeScript-Handbook#798) in the Handbook repo to track this effort (assuming we want to track this issue in the same repo that the PR will be submitted to)

@posva
Copy link

posva commented Mar 29, 2019

This can be closed now that the page exists at https://www.typescriptlang.org/docs/handbook/utility-types.html

@mjomble
Copy link
Author

mjomble commented Mar 29, 2019

Indeed. There's still no link to the page, but that's being tracked in a different issue: microsoft/TypeScript-Handbook#994

@mjomble mjomble closed this as completed Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs The issue relates to how you learn TypeScript
Projects
None yet
Development

No branches or pull requests

4 participants