Skip to content

Document predefined types #24558

@mjomble

Description

@mjomble

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsThe issue relates to how you learn TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions