tyneq / Enumerator
Interface: Enumerator<T>
Defined in: src/types/core.ts:19
A pull-based iterator over a sequence.
Remarks
Extends the native Iterator<T> protocol. return() disposes the iterator early; throw() is not supported and throws NotSupportedError if called.
Extends
Iterator<T>
Type Parameters
| Type Parameter | Description |
|---|---|
T | Element type. |
Methods
next()
next():
IteratorResult<T>
Defined in: src/types/core.ts:20
Returns
IteratorResult<T>
Overrides
Iterator.next
return()?
optionalreturn(value?):IteratorResult<T>
Defined in: src/types/core.ts:28
Terminates the iterator early and releases resources.
Parameters
| Parameter | Type |
|---|---|
value? | unknown |
Returns
IteratorResult<T>
Remarks
Idempotent - safe to call multiple times. Calling next() after return() returns { done: true }.
Overrides
Iterator.return
throw()?
optionalthrow(e?):IteratorResult<T,any>
Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:45
Parameters
| Parameter | Type |
|---|---|
e? | any |
Returns
IteratorResult<T, any>
Inherited from
Iterator.throw