chibicode / TypeScript-for-Beginner-Programmers

TypeScript for Beginner Programmers

Home Page:https://ts.chibicode.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The ReadOnly<...> mapped type is included in utility types

AndyOGo opened this issue · comments

First thank you for your effort to explain it for beginners.

The Readonly<Type> utility type is part of the utilities Typescript offers.
https://www.typescriptlang.org/docs/handbook/utility-types.html

In fact one can build his own mapped types as is documented here:
https://www.typescriptlang.org/docs/handbook/utility-types.html

I'm suggesting to rename it and maybe link to the official typescript documentation.

From:

The ReadOnly<...> mapped type

To:
The ReadOnly<...> utility type

and

From:

In TypeScript, if you use the Readonly<...> keyword on an object type,

To:
In TypeScript, if you use the Readonly<...> utility on an object type,

and

From:

In TypeScript, you can use keywords like Readonly<...>

To:
In TypeScript, you can use utilities like Readonly<...>