import { SymbolData } from '../config/types.js'; import { RandomSymbolControl, SymbolPool, SymbolPoolScope } from './SymbolPool.js'; /** * Which slot the engine is filling. `'buffer'` is a LAYER, never a slot: a * real cell is always on one side or the other. */ export type DrawSlot = 'spinning' | 'bufferStart' | 'bufferEnd'; /** * Weighted random symbol selector using binary search on cumulative weights. * * On top of the registered weights it carries layers of `SymbolPool` * overrides. global and per-reel, for the spinning strip, for both buffer * ends at once, and for either end on its own. See `SymbolPoolScope` for * how they resolve. */ export declare class RandomSymbolProvider implements RandomSymbolControl { private _symbols; private _baseWeights; /** Installed pools, keyed by `${slots}:${reel}`. */ private _pools; /** Compiled tables, same key shape. Dropped wholesale on any mutation. */ private _tables; private _rng; /** * @param symbolsData - Symbol id → weight/data map. * @param rng - Source of randomness returning a value in [0, 1). Defaults to * `Math.random`. Regulated / provably-fair deployments must inject a * seeded, audited PRNG so the on-screen strip can be replayed from a seed. */ constructor(symbolsData: Record, rng?: () => number); /** * Get a random symbol for one slot. * * @param slot - Which slot is being filled. A buffer slot names its side, * so the pools for that side apply on top of the wider ones. * @param reelIndex - Reel the slot belongs to. Omit for a draw that * belongs to no particular reel; per-reel pools then don't apply. */ next(slot?: DrawSlot, reelIndex?: number): string; /** @inheritdoc */ set(pool: SymbolPool | null, scope?: SymbolPoolScope): void; /** @inheritdoc */ clear(): void; /** @inheritdoc */ weights(scope?: SymbolPoolScope): Record; /** * Set symbols to exclude during spinning. * * Sugar for `set({ exclude }, { slots: 'spinning' })` that leaves any * weight overrides on the global spinning pool alone. */ setExcludeSpinning(symbolIds: string[]): void; /** * Set symbols to exclude from buffer (above/below) areas. * * Sugar for `set({ exclude }, { slots: 'buffer' })` that leaves any * weight overrides on the global buffer pool alone. */ setExcludeBuffer(symbolIds: string[]): void; /** Update weights at runtime (e.g., for different game modes). */ updateWeights(symbolsData: Record): void; private _setExclude; private _key; private _readBaseWeights; /** * The layer keys that apply to one draw, widest first. * * A `'bufferStart'` cell reads the spinning layers, then the both-sides * buffer layers, then its own side's - so every layer only ever narrows * the one before it. Asking for `'buffer'` stops before the side layers: * that is what both sides inherit, and what `weights()` reports for it. */ private _layerKeys; /** * Effective weight per symbol id for one draw, excluded ids flattened to * `0`. See `_layerKeys` for the order. */ private _resolve; private _table; private _compile; private _assertKnownIds; /** * Every scope a draw can reach must still have something to draw. Checked * on mutation so a pool that empties the strip fails at the call that * caused it, not mid-spin on whichever reel happens to wrap first. */ private _assertDrawable; private _emptyPoolMessage; private _scopeName; private _assertUsable; } //# sourceMappingURL=RandomSymbolProvider.d.ts.map