import { Ticker } from 'pixi.js'; import { ReelSet } from '../core/ReelSet.js'; import { Disposable } from '../utils/Disposable.js'; /** * A single visual debug layer. * * - `mask` Mask bounding box + per-reel rects. * - `cells` Every visible cell from `getCellBounds`, with `reel,cell` labels. * - `buffers` The off-window strip cells (bufferStart / bufferEnd), dimmer. * - `axis` One arrow per reel along the travel axis, pointing the way * it goes. The whole point of the v2 refactor is invisible in * a canvas otherwise: reverse polarity and horizontal * orientation become obvious instead of inferred. * - `feed` A marker on the strip edge new symbols enter from. * Confirms `feedEdge` derives from polarity rather than * being set twice. * - `thresholds` The wrap lines. a symbol crossing one wraps to the other * end of the array (contract law L7 / L9, watchable). * - `bounds` Actual `view.getBounds()` per visible symbol (spine overrun). * - `blocks` `getBlockBounds` outline for big symbols. * - `pins` Pin cells and pin-overlay positions. * - `hud` Per-reel text: orientation, direction, speed, phase, cells. */ export type DebugOverlayLayer = 'mask' | 'cells' | 'buffers' | 'axis' | 'feed' | 'thresholds' | 'bounds' | 'blocks' | 'pins' | 'hud'; /** Container / layer label prefix. Used by the Pixi devtools and by tests. */ export declare const OVERLAY_LABEL = "pixi-reels:debugOverlay"; export interface DebugOverlayOptions { /** * Which layers to draw. An explicit list, or `'all'` for every C3 layer. * Defaults to `'all'`. */ layers?: DebugOverlayLayer[] | 'all'; /** * When `true`, the live layers (`bounds` / `blocks` / `pins` / `hud`) * redraw every tick. When `false` (default) the overlay draws once and * only updates on `redraw()` / `setLayers()` and reshape events. */ live?: boolean; /** * Ticker driving the live redraw when `live: true`. Defaults to * `Ticker.shared`. Pass the reel set's own ticker (e.g. `app.ticker`, or a * `FakeTicker` in tests) to keep the overlay in lock-step with it. Ignored * when `live` is falsy. */ ticker?: Ticker; } /** What the axis-family layers drew for one reel, as plain numbers. */ export interface DebugOverlayReelInfo { reel: number; orientation: 'vertical' | 'horizontal'; direction: 'forward' | 'reverse'; /** Which strip edge new symbols arrive at. Derived from polarity. */ feedEdge: 'start' | 'end'; /** * The travel arrow in reel-local MAIN coordinates. `to - from` is signed, * so its sign is the reel's travel direction - which a bounding box * cannot tell you, because a mirrored arrow has identical bounds. */ axisArrow: { fromMain: number; toMain: number; }; /** Main coordinate of the feed marker. */ feedMain: number; /** The two wrap lines, in main coordinates. */ thresholds: { start: number; end: number; }; visibleCells: number; /** Last phase seen on this reel's bus, or 'idle'. */ phase: string; } /** Serializable summary of the overlay. the text half of a visual debugger. */ export interface DebugOverlaySnapshot { layers: DebugOverlayLayer[]; reels: DebugOverlayReelInfo[]; } /** Handle returned by {@link debugOverlay}. Owns its display objects. */ export interface DebugOverlayHandle extends Disposable { /** Swap the active layer set and redraw. Accepts a list or `'all'`. */ setLayers(layers: DebugOverlayLayer[] | 'all'): void; /** Force a full redraw (static + live layers). */ redraw(): void; /** * Plain-JSON description of what the axis / feed / thresholds layers * represent, per reel. PixiJS renders to a canvas, which CLAUDE.md notes * AI agents and CI cannot see; this is the same information in a form * they (and `expect`) can read. No PixiJS types, safe to `JSON.stringify`. */ describe(): DebugOverlaySnapshot; /** Remove the overlay from the reel set and dispose every allocation. */ destroy(): void; readonly isDestroyed: boolean; } /** * A layered visual debug overlay for a {@link ReelSet}. Draws mask, cell, * buffer, symbol-bounds, big-symbol-block, pin and hud layers into a * `Container` added to the reel set itself. because `ReelSet extends * Container`, that renders the overlay above the viewport (including the * spotlight container), unlike the older `showMask` which drew inside the * viewport and was covered by the spotlight. * * Dev-only. It reads engine internals through the public accessors, is not * semver-protected, and must not reach a production bundle. * * ```ts * const overlay = debugOverlay(reelSet, { layers: ['cells', 'bounds'], live: true }); * overlay.setLayers(['cells', 'pins']); * overlay.redraw(); * overlay.destroy(); * ``` */ export declare function debugOverlay(reelSet: ReelSet, options?: DebugOverlayOptions): DebugOverlayHandle; //# sourceMappingURL=debugOverlay.d.ts.map