Skip to content

tyneq


tyneq / TyneqEnumerator

Abstract Class: TyneqEnumerator<TInput, TOutput>

Defined in: src/core/enumerators/TyneqEnumerator.ts:18

Base class for all pipeline operator enumerators (streaming and buffering).

Remarks

Extends TyneqBaseEnumerator with a typed source enumerator. Override initialize() to buffer or prepare state before the first handleNext(). Override disposeAdditional() to release resources beyond the source enumerator.

Extends

Type Parameters

Type ParameterDefault typeDescription
TInput-Source element type.
TOutputTInputOutput element type (defaults to TInput).

Constructors

Constructor

new TyneqEnumerator<TInput, TOutput>(sourceEnumerator): TyneqEnumerator<TInput, TOutput>

Defined in: src/core/enumerators/TyneqEnumerator.ts:22

Parameters

ParameterType
sourceEnumeratorEnumerator<TInput>

Returns

TyneqEnumerator<TInput, TOutput>

Overrides

TyneqBaseEnumerator.constructor

Properties

PropertyModifierTypeDefined in
sourceEnumeratorreadonlyEnumerator<TInput>src/core/enumerators/TyneqEnumerator.ts:19

Methods

next()

next(): IteratorResult<TOutput>

Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:29

Advances the iterator, calling initialize() on first call. Idempotent after completion.

Returns

IteratorResult<TOutput>

Inherited from

TyneqBaseEnumerator.next


return()

return(value?): IteratorResult<TOutput>

Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:54

Terminates iteration early, disposes resources, and marks completed. Idempotent.

Parameters

ParameterType
value?unknown

Returns

IteratorResult<TOutput>

Inherited from

TyneqBaseEnumerator.return


initialize()

protected initialize(): void

Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:64

Called once before the first handleNext() invocation. Override to set up state.

Returns

void

Inherited from

TyneqBaseEnumerator.initialize


yield()

protected yield(value): IteratorResult<TOutput>

Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:67

Wraps value in a non-done IteratorResult.

Parameters

ParameterType
valueTOutput

Returns

IteratorResult<TOutput>

Inherited from

TyneqBaseEnumerator.yield


done()

protected done(): IteratorResult<TOutput>

Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:72

Returns a done IteratorResult.

Returns

IteratorResult<TOutput>

Inherited from

TyneqBaseEnumerator.done


doneWithYield()

protected doneWithYield(value): IteratorResult<TOutput>

Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:82

Marks the enumerator completed and yields value as the final element.

Parameters

ParameterType
valueTOutput

Returns

IteratorResult<TOutput>

Remarks

Use when the last element must be emitted together with completion in one step.

Inherited from

TyneqBaseEnumerator.doneWithYield


earlyComplete()

protected earlyComplete(reason?): IteratorResult<TOutput>

Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:94

Disposes resources, marks completed, and returns a done result.

Parameters

ParameterType
reason?unknown

Returns

IteratorResult<TOutput>

Remarks

Use inside handleNext() to terminate iteration before the source is exhausted.

Inherited from

TyneqBaseEnumerator.earlyComplete


dispose()

protected dispose(value?): void

Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:101

Calls disposeSource() then disposeAdditional().

Parameters

ParameterType
value?unknown

Returns

void

Inherited from

TyneqBaseEnumerator.dispose


disposeAdditional()

protected disposeAdditional(_value?): void

Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:116

Override to release any additional resources.

Parameters

ParameterType
_value?unknown

Returns

void

Remarks

Called after disposeSource(). value is the return value passed to return(). Must be idempotent and must not throw.

Inherited from

TyneqBaseEnumerator.disposeAdditional


handleNext()

abstract protected handleNext(): IteratorResult<TOutput>

Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:119

Produces the next element. Return { done: true } to signal exhaustion.

Returns

IteratorResult<TOutput>

Inherited from

TyneqBaseEnumerator.handleNext


disposeSource()

protected disposeSource(): void

Defined in: src/core/enumerators/TyneqEnumerator.ts:29

Override to dispose the upstream source enumerator.

Returns

void

Overrides

TyneqBaseEnumerator.disposeSource