import { ReelSet } from '../core/ReelSet.js'; /** * Debug snapshot. plain JSON representation of the entire reel state. * * Designed for AI agents that cannot see the canvas. * Returns no PixiJS display objects, only serializable data. * * **Breaking note (since v0.3):** `visibleRows` is now `number[]` (one entry * per reel) so jagged shapes (pyramids, MultiWays) are representable. For * uniform slots every entry is the same value. Adapt downstream code that * deep-reads the snapshot. */ export interface DebugSnapshot { timestamp: number; isSpinning: boolean; currentSpeed: string; availableSpeeds: string[]; spotlightActive: boolean; reelCount: number; visibleRows: number[]; reels: DebugReelSnapshot[]; grid: string[][]; } export interface DebugReelSnapshot { index: number; speed: number; isStopping: boolean; allSymbols: { row: number; symbolId: string; y: number; }[]; visibleSymbols: string[]; } /** * Take a plain-JSON snapshot of the entire reel set state. * * This is the primary debugging tool for AI agents. The output is * a serializable object with no circular references, no PixiJS types. * * ```ts * const state = debugSnapshot(reelSet); * console.log(JSON.stringify(state, null, 2)); * ``` */ export declare function debugSnapshot(reelSet: ReelSet): DebugSnapshot; /** * Pretty-print the grid as an ASCII table. * * ``` * ┌────────┬────────┬────────┬────────┬────────┐ * │ cherry │ lemon │ bar │ seven │ cherry │ * │ plum │ cherry │ wild │ lemon │ orange │ * │ orange │ bell │ cherry │ plum │ bell │ * └────────┴────────┴────────┴────────┴────────┘ * ``` */ export declare function debugGrid(reelSet: ReelSet): string; /** * One captured frame from `startRecording()`. a `DebugSnapshot` plus the * tag the recording was started with and the spin event that triggered * the capture. */ export interface RecordedFrame { /** Recording tag at the time of capture. Useful for grouping multiple sessions. */ tag: string; /** Reel-set event that triggered the capture (`spin:start`, `spin:allLanded`, etc). */ trigger: string; /** Snapshot of `debugSnapshot(reelSet)` at the moment of capture. */ snapshot: DebugSnapshot; } /** Options for {@link startRecording}. */ export interface StartRecordingOptions { /** * Maximum number of frames retained across the whole process. When the * buffer is full the oldest frames are dropped. Default 1000. */ maxFrames?: number; } /** * Start recording the reel-set's frame state at every key spin event * (`spin:start`, `spin:reelLanded`, `spin:allLanded`, `spin:complete`). * Each event captures a `DebugSnapshot` and pushes it onto a process- * wide rolling log readable via {@link getFrames}. * * The `tag` is freeform. use it to label multiple recording sessions * so you can filter `getFrames(tag)` later. Call {@link stopRecording} * to detach the listeners (also fires automatically when the reel set * emits `'destroyed'`). * * Designed for AI agents and debug harnesses. Calling `startRecording` * twice on the same `reelSet` replaces the prior recording (the previous * tag's listeners are removed before the new ones attach). * * ```ts * import { startRecording, stopRecording, getFrames } from 'pixi-reels'; * * startRecording(reelSet, 'spin-1'); * await reelSet.spin(); * stopRecording(reelSet); * const frames = getFrames('spin-1'); // every snapshot tagged 'spin-1' * ``` */ export declare function startRecording(reelSet: ReelSet, tag?: string, options?: StartRecordingOptions): void; /** Detach the recorder previously installed by {@link startRecording}. No-op if none. */ export declare function stopRecording(reelSet: ReelSet): void; /** * All recorded frames in capture order. When `tag` is provided, only * frames tagged with it are returned. Frames are not cleared between * recording sessions. call {@link clearFrames} to reset. */ export declare function getFrames(tag?: string): readonly RecordedFrame[]; /** Empty the global recording log. */ export declare function clearFrames(): void; /** * Enable debug mode: attaches debug utilities to `window.__PIXI_REELS_DEBUG`. * * After calling this, an AI agent can run in the browser console: * ```js * __PIXI_REELS_DEBUG.snapshot() // full state JSON * __PIXI_REELS_DEBUG.grid() // ASCII grid * __PIXI_REELS_DEBUG.log() // console.log the grid * __PIXI_REELS_DEBUG.startRecording('myTag') * __PIXI_REELS_DEBUG.stopRecording() * __PIXI_REELS_DEBUG.getFrames('myTag') * ``` * * For a single reel set, leave `key` unset. With multiple reel sets, pass a * distinct `key` per call so they don't clobber each other on `window`: each is * reachable at `__PIXI_REELS_DEBUG_INSTANCES[key]`, and `__PIXI_REELS_DEBUG` * always points at the most recently enabled one for convenience. * * This attaches to `window` and logs — call it only in dev/QA builds, never in * a production bundle (the snapshot exposes internal state and is not * semver-protected, so do not wire monitoring/telemetry to it). */ export declare function enableDebug(reelSet: ReelSet, key?: string): void; //# sourceMappingURL=debug.d.ts.map