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
#47920 https://github.com/microsoft/TypeScript/pull/47898/files
as
Record<string, unknown>
someExpression satisfies SomeType & Record<string, unknown>
Record<string, never>
x satisfies T as T
never[]
satisfies
extends
implements
as const
is
expr as Satisfies<T>
#45974
Yes, we will now narrow any element access reference.
const sym = Symbol(); declare let x: { [sym]: number | string; }; if (typeof x[sym] === "number") { let a = x[sym]; // 'number | string' today, 'number' with this PR }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Contextually Typed and Satisfies Operator
#47920
https://github.com/microsoft/TypeScript/pull/47898/files
as
but safe - so a safe type assertion.Record<string, unknown>
to opt out.someExpression satisfies SomeType & Record<string, unknown>
Record<string, never>
x satisfies T as T
never[]
a lot of the time, which is useless.satisfies
?extends
? We use that for type parameters that must be assignable to a constraint.implements
is what we use for classes - also closer in intuitionas
syntax likeas const
?is
? Could conflict with pattern matching.expr as Satisfies<T>
Definite Assignment Checks for Computed Keys
#45974
Yes, we will now narrow any element access reference.
The text was updated successfully, but these errors were encountered: