/** * Per-reel target shape for `ReelSet.setResult` and * `ReelSetBuilder.initialFrame`. One object per reel. * * Use this for every result grid that crosses a worker, network, or * serializer boundary. The shape survives `structuredClone`, JSON, and * `postMessage` round-trips. */ export interface ColumnTarget { /** Visible-area target symbols, indexed `0 ... visibleCells-1`. */ visible: string[]; /** * Buffer-above target symbols. `bufferStart[0]` is the slot closest to the * visible top cell; later indices go further above. Up to `bufferSymbols` * entries are honored. * * Big-symbol anchors may sit here. Place a multi-cell symbol id (one whose * `SymbolData.size.cells > 1`) at any `bufferStart[i]` and the coordinator * paints OCCUPIED stubs across the rest of the block, including any cells * that fall in visible. The block must fit on the strip end-to-end * (`anchor.cell + h <= visibleCells + bufferEnd`); the portion above * visible is clipped by the reel mask. This is the "tail-visible" * partial-landing pattern. */ bufferStart?: (string | undefined)[]; /** * Buffer-below target symbols. `bufferEnd[0]` is the slot closest to the * visible bottom cell; later indices go further below. Up to `bufferSymbols` * entries are honored. * * Big-symbol stubs may sit here. A block anchored at the last visible cell * with `h > 1` will have its non-anchor cells spill into `bufferEnd` * automatically. You can also place an anchor here, but the block then * lies entirely off-screen (legal but invisible). */ bufferEnd?: (string | undefined)[]; } /** * Read one slot of a `ColumnTarget` by **cell**, the engine's * visible-relative coordinate: `0` is the first visible cell, negative cells * address `bufferStart` (`-1` is the slot closest to the visible top cell), * and cells `>= visible.length` address `bufferEnd`. * * Returns `undefined` for any cell the target does not specify. */ export declare function getTargetSlot(target: ColumnTarget, cell: number): string | undefined; /** * Write one slot of a `ColumnTarget` by cell, using the same coordinate as * {@link getTargetSlot}. Creates and extends `bufferStart` / `bufferEnd` * as needed, so a caller can address any cell on the strip without knowing * whether the target declared a buffer. * * Mutates `target`. Clone first if the caller must not touch the original. */ export declare function setTargetSlot(target: ColumnTarget, cell: number, id: string): void; /** * Materialize a `ColumnTarget` into **strip form**: one entry per strip * slot, top to bottom. Index `0` is the furthest buffer-above cell, index * `bufferStart` is the first visible cell, and the tail holds buffer-below * cells. This is the same indexing `FrameBuilder.build` returns and * `Reel.placeStrip` consumes. * * Entries the target does not specify come back `undefined`; the caller * decides what to do with them (the engine random-fills). * * `bufferStart` is the reel's buffer-above *capacity*. Target entries past * it cannot reach the strip and are dropped here. `assertBufferCountsInRange` * rejects them at the public entry points so that drop is never silent. */ export declare function columnTargetToStrip(target: ColumnTarget, bufferStart: number): (string | undefined)[]; /** Deep-clone a `ColumnTarget` one level down, so slots can be rewritten safely. */ export declare function cloneColumnTarget(target: ColumnTarget): ColumnTarget; /** * Validate that a target grid does not carry more `bufferStart` / `bufferEnd` * entries than the engine can consume. Throws a `RangeError` with a * column-pointing message if it does; otherwise a no-op. * * Background: without this check the failure is silent. `columnTargetToStrip` * only lays down as many buffer slots as the reel actually has, so an entry * past that capacity never reaches the strip. Failing here at the entry point * is cheaper than a "why did not my target land" debugging session. * * `callerLabel` shows up in the thrown message so the caller knows which * public API surfaced the error. */ /** * Throw a readable error when a caller hands `setResult` / `initialFrame` * the pre-v2 `string[][]` instead of `ColumnTarget[]`. * * Without this the first thing to touch the value is a spread of * `target.visible`, so the caller gets `TypeError: target.visible is not * iterable` from deep inside the frame pipeline -- and, worse, the spin * promise never settles, because the throw happens after the reels are * already moving. The symptom is a reel that spins forever with no clue * why. A recipe on the docs site shipped exactly that. */ export declare function assertColumnTargets(grid: unknown, callerLabel: string): asserts grid is ColumnTarget[]; export declare function assertBufferCountsInRange(grid: ColumnTarget[], bufferStartPerReel: ReadonlyArray, bufferEndPerReel: ReadonlyArray, callerLabel: string): void; //# sourceMappingURL=ColumnTarget.d.ts.map