hyperlark (TypeScript)
    Preparing search index...

    Class TreeCursor

    A resumable traversal over a ParseHandle; yields node positions. Re-declared over the generated class to add iteration: for (const pos of cursor) drains it and frees the cursor on exhaustion AND on early exit (break). free() is idempotent (an already-freed cursor is a no-op), so an explicit free()/using after iteration never throws.

    Implements

    • Iterable<number>

    Indexable

    • [key: number]: () => void
    Index
    • Yields the remaining positions; frees the cursor when the loop ends, however it ends. A spent iterator yields { done: true }, never throws.

      Returns IterableIterator<number>

    • Idempotent: freeing an already-freed cursor is a no-op.

      Returns void

    • The next hit position, or undefined when exhausted (fused).

      Returns number | undefined

    • Up to n hit positions in one crossing (fewer — possibly zero — at exhaustion).

      Parameters

      • n: number

      Returns Uint32Array

    • Topdown cursors only: do NOT descend into the last-yielded node (no-op on the other orders).

      Returns void