Skip to content

ICursor

Defined in: packages/data/src/cursor/icursor.ts:14

A stable position in a sequence, surviving across calls — the extra a plain Iterator cannot offer, being single-pass, forward-only and positionless.

The interface guarantees only that valid reports the truth; it does not promise that a cursor survives a mutation of the sequence it was obtained from. Invalidation rules are documented per implementing class.

T extends DefinedValue = DefinedValue

The type of elements in the sequence. Anything except undefined.

readonly valid: boolean

Defined in: packages/data/src/cursor/icursor.ts:16

False once moved past the end, or once its element was removed.


readonly value: T | undefined

Defined in: packages/data/src/cursor/icursor.ts:19

The element at this position, undefined when not valid.

advance(): boolean

Defined in: packages/data/src/cursor/icursor.ts:26

Moves one position forward.

boolean

false if that moved past the end.


clone(): ICursor<T>

Defined in: packages/data/src/cursor/icursor.ts:29

An independent cursor at the same position.

ICursor<T>