We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
readonly
#29435
Readonly<T>
ReadonlyArray
(...args: ReadonlyArray<Whatever>) => any
Readonly
#29478
[[Couldn't follow what the explanation of the original complications were.]]
globalThis
#29332
window
Window & typeof globalThis
globalThis.globalThis.globalThis.globalThis.foo
globalThis.globalThis
SymbolFlags.Const
__globalThis()
__globalThis().globalThis
const
typeof globalThis
this
undefined
any
[number, string] as const
<const>[number, string]
T extends const
DeepReadonly
The text was updated successfully, but these errors were encountered:
No branches or pull requests
readonly
modifier#29435
Readonly<T>
mapped type does nothing when given a tuple or array.ReadonlyArray
s, and we don't have a readonly version of a tuple.readonly
modifier that goes on array types and tuple types.readonly
modifier, regular arrays and tuples are mapped to their readonly form.Readonly<T>
, given an array or tuple, gives you a(...args: ReadonlyArray<Whatever>) => any
now just works.readonly
type operator/modifier that applies for every type.readonly
modifier is a special thing for arrays and tuples, butReadonly
is a general purpose type alias.readonly
meanReadonly
for now?Infer contextual types from generic return types
#29478
[[Couldn't follow what the explanation of the original complications were.]]
globalThis
- the global environment handle#29332
window
has the typeWindow & typeof globalThis
globalThis
is a property onglobalThis
globalThis.globalThis.globalThis.globalThis.foo
globalThis.globalThis
?SymbolFlags.Const
__globalThis()
in mind__globalThis().globalThis
won't work.const
-declared globals are consideredreadonly
properties?window
typeof globalThis
this
has the typeundefined
, but it used to be implicitlyany
.const
contextsconst
context, all literals become singleton types, properties becomereadonly
, arrays become tuples.[number, string] as const
<const>[number, string]
const
and notreadonly
?const
is a stronger guarantee - means nobody ever can change the value, whereasreadonly
is a strong guarantee on the handle to a value.T extends const
?readonly
constraint, but that's separate and it seems strange that it would be non-local?const
readonly
?DeepReadonly
.The text was updated successfully, but these errors were encountered: