Skip to content

tyneq


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 ParameterDescription
TElement type.

Methods

next()

next(): IteratorResult<T>

Defined in: src/types/core.ts:20

Returns

IteratorResult<T>

Overrides

Iterator.next


return()?

optional return(value?): IteratorResult<T>

Defined in: src/types/core.ts:28

Terminates the iterator early and releases resources.

Parameters

ParameterType
value?unknown

Returns

IteratorResult<T>

Remarks

Idempotent - safe to call multiple times. Calling next() after return() returns { done: true }.

Overrides

Iterator.return


throw()?

optional throw(e?): IteratorResult<T, any>

Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:45

Parameters

ParameterType
e?any

Returns

IteratorResult<T, any>

Inherited from

Iterator.throw