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
TyneqBaseEnumerator<TInput,TOutput>
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TInput | - | Source element type. |
TOutput | TInput | Output element type (defaults to TInput). |
Constructors
Constructor
new TyneqEnumerator<
TInput,TOutput>(sourceEnumerator):TyneqEnumerator<TInput,TOutput>
Defined in: src/core/enumerators/TyneqEnumerator.ts:22
Parameters
| Parameter | Type |
|---|---|
sourceEnumerator | Enumerator<TInput> |
Returns
TyneqEnumerator<TInput, TOutput>
Overrides
TyneqBaseEnumerator.constructor
Properties
| Property | Modifier | Type | Defined in |
|---|---|---|---|
sourceEnumerator | readonly | Enumerator<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
return()
return(
value?):IteratorResult<TOutput>
Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:54
Terminates iteration early, disposes resources, and marks completed. Idempotent.
Parameters
| Parameter | Type |
|---|---|
value? | unknown |
Returns
IteratorResult<TOutput>
Inherited from
initialize()
protectedinitialize():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()
protectedyield(value):IteratorResult<TOutput>
Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:67
Wraps value in a non-done IteratorResult.
Parameters
| Parameter | Type |
|---|---|
value | TOutput |
Returns
IteratorResult<TOutput>
Inherited from
done()
protecteddone():IteratorResult<TOutput>
Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:72
Returns a done IteratorResult.
Returns
IteratorResult<TOutput>
Inherited from
doneWithYield()
protecteddoneWithYield(value):IteratorResult<TOutput>
Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:82
Marks the enumerator completed and yields value as the final element.
Parameters
| Parameter | Type |
|---|---|
value | TOutput |
Returns
IteratorResult<TOutput>
Remarks
Use when the last element must be emitted together with completion in one step.
Inherited from
TyneqBaseEnumerator.doneWithYield
earlyComplete()
protectedearlyComplete(reason?):IteratorResult<TOutput>
Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:94
Disposes resources, marks completed, and returns a done result.
Parameters
| Parameter | Type |
|---|---|
reason? | unknown |
Returns
IteratorResult<TOutput>
Remarks
Use inside handleNext() to terminate iteration before the source is exhausted.
Inherited from
TyneqBaseEnumerator.earlyComplete
dispose()
protecteddispose(value?):void
Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:101
Calls disposeSource() then disposeAdditional().
Parameters
| Parameter | Type |
|---|---|
value? | unknown |
Returns
void
Inherited from
disposeAdditional()
protecteddisposeAdditional(_value?):void
Defined in: src/core/enumerators/TyneqBaseEnumerator.ts:116
Override to release any additional resources.
Parameters
| Parameter | Type |
|---|---|
_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()
abstractprotectedhandleNext():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()
protecteddisposeSource():void
Defined in: src/core/enumerators/TyneqEnumerator.ts:29
Override to dispose the upstream source enumerator.
Returns
void