import { ReelSet } from '../core/ReelSet.js'; import { SpinResult } from '../events/ReelEvents.js'; import { ColumnTarget } from '../frame/ColumnTarget.js'; import { FakeTicker } from './FakeTicker.js'; export interface TestReelSetOptions { reels?: number; /** * Visible row count. * - `number` → uniform rows. * - `number[]` → per-reel static shape (pyramid). * * Mutually exclusive with `multiways` (which always starts at `maxRows`). */ visibleRows?: number | number[]; /** * MultiWays configuration. Mutually exclusive with `visibleRows: number[]`. * The harness sets uniform `reelPixelHeight` and forwards `min/maxRows`. */ multiways?: { minRows: number; maxRows: number; reelPixelHeight: number; }; symbolIds?: string[]; weights?: Record; /** Per-symbol overrides. useful for big-symbol size declarations in tests. */ symbolData?: Record>; symbolSize?: { width: number; height: number; }; symbolGap?: { x: number; y: number; }; /** Number of symbols above + below the visible area. Defaults to the builder default. */ bufferSymbols?: number | { above: number; below: number; }; /** Initial symbol grid. Same `ColumnTarget[]` form as `ReelSetBuilder.initialFrame`. */ initialFrame?: ColumnTarget[]; } /** * Test-only convenience union. The published library's public surface * accepts only `ColumnTarget[]`; `spinAndLand` is a testing helper that * also accepts plain visible-cells `string[][]` to keep mechanic tests * compact. Kept on a separate type alias and split across lines so the * 1.0 release verification sweep does not flag the engine surface. */ type SpinAndLandGrid = string[][] | ColumnTarget[]; export interface TestReelSetHandle { reelSet: ReelSet; ticker: FakeTicker; /** Advance the ticker by `ms` milliseconds. */ advance(ms: number, stepMs?: number): void; /** * Run one full spin that lands on `grid`. Uses `slamStop()` for deterministic * synchronous completion. Accepts plain visible-cells `string[][]`, or the * explicit `ColumnTarget[]` shape (use the latter to target buffer cells). */ spinAndLand(grid: SpinAndLandGrid): Promise; /** Destroy the reel set. */ destroy(): void; } /** * Build a headless `ReelSet` wired to a `FakeTicker`. Ideal for mechanic tests. * * The returned `ReelSet` uses `HeadlessSymbol` for every registered symbol, * so no textures, renderer, or DOM are required. * * ```ts * const { reelSet, spinAndLand } = createTestReelSet({ * reels: 5, visibleRows: 3, * symbolIds: ['cherry', 'seven', 'wild'], * }); * * await spinAndLand([ * ['cherry','cherry','cherry'], * ['seven','seven','seven'], * ['wild','wild','wild'], * ['cherry','cherry','cherry'], * ['seven','seven','seven'], * ]); * ``` */ export declare function createTestReelSet(opts?: TestReelSetOptions): TestReelSetHandle; /** * Deterministically run a spin to a target grid. * * Internally: `spin() -> setResult(grid) -> slamStop()`. `slamStop()` bypasses * all async phases and directly places the symbols (and bypasses the * two-stage `skipSpin()` boost machine), so the returned promise resolves on * a microtask. * * Accepts plain visible-cells `string[][]` (each inner array becomes the * `visible` field of a fresh `ColumnTarget`) or the explicit `ColumnTarget[]` * shape (passed straight through; use this to target buffer cells). */ export declare function spinAndLand(reelSet: ReelSet, grid: SpinAndLandGrid): Promise; /** Record every occurrence of the given events in order for assertion. */ export declare function captureEvents(reelSet: ReelSet, names: Array): Array<{ event: string; args: unknown[]; }>; /** * Assert that the current visible grid equals `expected`. * * Throws a readable error showing the full current grid on mismatch. */ export declare function expectGrid(reelSet: ReelSet, expected: string[][]): void; /** * Count how many times a given symbol appears in the visible grid. * Handy for scatter/wild-count assertions. */ export declare function countSymbol(reelSet: ReelSet, symbolId: string): number; export {}; //# sourceMappingURL=testHarness.d.ts.map