Skip to content

ICursorSequence

Defined in: packages/data/src/cursor/icursor-sequence.ts:12

Forward-only cursor editing — the shape a singly-linked list can honour.

T extends DefinedValue = DefinedValue

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

C extends ICursor<T> = ICursor<T>

The cursor type this sequence produces.

begin(): C

Defined in: packages/data/src/cursor/icursor-sequence.ts:17

The first element; invalid when empty.

C


cursorAt(index): C

Defined in: packages/data/src/cursor/icursor-sequence.ts:23

O(1) for random-access backings, O(n) otherwise.

number

C


end(): C

Defined in: packages/data/src/cursor/icursor-sequence.ts:20

The past-the-end position, used to append.

C


insertAfter(cursor, item): void

Defined in: packages/data/src/cursor/icursor-sequence.ts:31

Inserts an item after cursor. O(1).

C

The position after which to insert.

T

The item to insert.

void


insertAllAfter(cursor, items): void

Defined in: packages/data/src/cursor/icursor-sequence.ts:40

Inserts every item after cursor, keeping their relative order. O(n) in the number of items.

C

The position after which to insert.

readonly T[]

The items to insert.

void


removeAfter(cursor): T | undefined

Defined in: packages/data/src/cursor/icursor-sequence.ts:49

Removes the element after cursor. O(1). Cursors at the removed element become invalid.

C

The position before the element to remove.

T | undefined

The removed element, or undefined if there was none.


setAt(cursor, item): void

Defined in: packages/data/src/cursor/icursor-sequence.ts:57

Replaces the element at cursor.

C

The position to replace.

T

The new item.

void