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
TReturn
TYield
#58243
IteratorResult
Iterator
IterableIterator
AsyncIterable
value
any
Iterator<number>
size > 0
undefined
ExpectType
ExpectError
.next()
T
T | void
if (something.size === 1) { something.values().nexT().value.getTasks(); }
void
!
myGenerator().map(x => x * x)
strictBindCallApply
noUncheckedIndexedAccess
noUncheckedIteratorAccess
noUncheckedIteratorResult
tsc --init
"module": "commonjs"
--init
target: esnext
module
node16
bundler
verbatimModuleSyntax
skipLibCheck
The text was updated successfully, but these errors were encountered:
Related: #46150
Sorry, something went wrong.
#58420
No branches or pull requests
TReturn
andTYield
for Iterators and Other Types#58243
TReturn
is the type of values returned by a generator.TYield
is the type of values yielded by a generator.IteratorResult
Iterator
,IterableIterator
,AsyncIterable
, etc.value
off of mostIteratorResult
s, then you'll getany
.TReturn
andTYield
that isany
.Iterator<number>
, TypeScript should preserve that type as-is.size > 0
impliesvalue
is notundefined
.ExpectType
andExpectError
utility types..next()
to return aT
now getT | void
.if (something.size === 1) { something.values().nexT().value.getTasks(); }
void
and notundefined
?undefined
?void
instead ofundefined
.!
to get rid ofvoid
?myGenerator().map(x => x * x)
and you want theTReturn
preserved.!
, is that so bad?strictBindCallApply
.noUncheckedIndexedAccess
..next()
, the famous indexed access syntax.noUncheckedIteratorAccess
ornoUncheckedIteratorResult
).tsc --init
Updates?tsc --init
adds"module": "commonjs"
- which our docs said to never ever ever do.--init
?tsc --init
generating a file today?target: esnext
?module
-node16
orbundler
?verbatimModuleSyntax
?skipLibCheck
?The text was updated successfully, but these errors were encountered: