Open DanielRosenwasser opened 2 months ago
TReturn
TYield
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
Related: #46150
TReturn
andTYield
for Iterators and Other Types58243
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
?