@energy8platform/platform-core 0.26.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +0 -3615
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -400
- package/dist/index.esm.js +1 -3613
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -9
- package/scripts/build-digit-font.mjs +72 -0
- package/src/index.ts +2 -17
- package/dist/shell.cjs.js +0 -3671
- package/dist/shell.cjs.js.map +0 -1
- package/dist/shell.d.ts +0 -433
- package/dist/shell.esm.js +0 -3664
- package/dist/shell.esm.js.map +0 -1
- package/scripts/gen-version.mjs +0 -21
- package/src/shell/GameShell.ts +0 -412
- package/src/shell/INTER-LICENSE.txt +0 -93
- package/src/shell/colors.ts +0 -32
- package/src/shell/components/BottomBar.ts +0 -237
- package/src/shell/components/BuyBonus.ts +0 -329
- package/src/shell/components/GameInfo.ts +0 -384
- package/src/shell/components/Modal.ts +0 -36
- package/src/shell/components/ReplayModal.ts +0 -57
- package/src/shell/components/Settings.ts +0 -59
- package/src/shell/components/icons.ts +0 -40
- package/src/shell/components/pickers.ts +0 -150
- package/src/shell/components/primitives.ts +0 -85
- package/src/shell/fonts.ts +0 -13
- package/src/shell/format.ts +0 -39
- package/src/shell/i18n.ts +0 -96
- package/src/shell/index.ts +0 -22
- package/src/shell/keyboard.ts +0 -229
- package/src/shell/locales.ts +0 -864
- package/src/shell/motion.ts +0 -43
- package/src/shell/shell.css.ts +0 -449
- package/src/shell/state.ts +0 -31
- package/src/shell/theme.ts +0 -54
- package/src/shell/types.ts +0 -262
- package/src/shell/version.ts +0 -3
package/dist/shell.d.ts
DELETED
|
@@ -1,433 +0,0 @@
|
|
|
1
|
-
type ShellMode = 'base' | 'freeSpins' | 'replay';
|
|
2
|
-
interface CurrencyConfig {
|
|
3
|
-
symbol: string;
|
|
4
|
-
position: 'left' | 'right';
|
|
5
|
-
/** Maximum fraction digits (default 2). Win / total-win readouts are rounded to this precision;
|
|
6
|
-
* balance / bet / prices stay fixed at `minDecimals`. */
|
|
7
|
-
maxDecimals?: number;
|
|
8
|
-
/** Minimum fraction digits (defaults to `maxDecimals`). For win / total-win, trailing zeros are
|
|
9
|
-
* trimmed down to this many places so small wins keep their significant digits (e.g. 0.0673)
|
|
10
|
-
* while round amounts stay compact (e.g. 0.30). Everything else is shown at exactly this many. */
|
|
11
|
-
minDecimals?: number;
|
|
12
|
-
separator?: {
|
|
13
|
-
thousands?: string;
|
|
14
|
-
decimal?: string;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
interface BonusOption {
|
|
18
|
-
id: string;
|
|
19
|
-
/** 'bonus' buys into a bonus round, 'feature' toggles a base-game modifier (e.g. Ante).
|
|
20
|
-
* Drives the card/button label and accent. Defaults to 'bonus'. */
|
|
21
|
-
type?: 'feature' | 'bonus';
|
|
22
|
-
title: string;
|
|
23
|
-
description: string;
|
|
24
|
-
/** Transparent art image shown at the top of the card (no background plate). */
|
|
25
|
-
thumbnail?: string;
|
|
26
|
-
volatility?: 1 | 2 | 3 | 4 | 5;
|
|
27
|
-
/** Card price = priceMultiplier × current bet, rendered in the shell currency. */
|
|
28
|
-
priceMultiplier: number;
|
|
29
|
-
/** Per-option accent override. Falls back to the type default (bonus → purple, feature → gold). */
|
|
30
|
-
accentColor?: string;
|
|
31
|
-
/** Override the card UI. Return the card's inner content; the shell keeps the grid wrapper,
|
|
32
|
-
* accent vars and live re-pricing, and runs the normal buy flow when you call `ctx.select()`. */
|
|
33
|
-
custom?: (ctx: BonusCardContext) => HTMLElement;
|
|
34
|
-
}
|
|
35
|
-
/** Context passed to a `BonusOption.custom` renderer. Render the card however you like and wire
|
|
36
|
-
* your own control to `select()` — the buy/confirm flow stays internal to the shell. */
|
|
37
|
-
interface BonusCardContext {
|
|
38
|
-
bonus: BonusOption;
|
|
39
|
-
/** Current bet. */
|
|
40
|
-
bet: number;
|
|
41
|
-
/** Card price = `bonus.priceMultiplier × bet`. */
|
|
42
|
-
price: number;
|
|
43
|
-
/** `price` formatted in the shell currency. */
|
|
44
|
-
priceText: string;
|
|
45
|
-
/** True when the option can't be bought right now (unaffordable / busy / buy-bonus disabled);
|
|
46
|
-
* reflect it in your UI. `select()` is a no-op while disabled. */
|
|
47
|
-
disabled: boolean;
|
|
48
|
-
/** Card accent (per-option override or the type default); also set as the `--card-acc` CSS var. */
|
|
49
|
-
accent: string;
|
|
50
|
-
/** Proceed through the shell's normal flow: opens the confirm modal, then emits `buyBonusSelect`
|
|
51
|
-
* / activates the feature. No-op while `disabled`. */
|
|
52
|
-
select: () => void;
|
|
53
|
-
}
|
|
54
|
-
interface ThemeConfig {
|
|
55
|
-
/** Palette scheme: 'dark' (default) for dark games, 'light' for light backgrounds. */
|
|
56
|
-
scheme?: 'dark' | 'light';
|
|
57
|
-
/** Brand accent — active states, the SPIN hover glow, and the BUY BONUS button.
|
|
58
|
-
* (Per-bonus card accents are set on each `BonusOption.accentColor`.) */
|
|
59
|
-
accent?: string;
|
|
60
|
-
}
|
|
61
|
-
/** One paytable entry: a symbol (text/image) and its win tiers, rendered "<count> x<multiplier>". */
|
|
62
|
-
interface PaytableRow {
|
|
63
|
-
symbol: {
|
|
64
|
-
text?: string;
|
|
65
|
-
image?: string;
|
|
66
|
-
};
|
|
67
|
-
wins: Array<{
|
|
68
|
-
count?: string;
|
|
69
|
-
multiplier: number;
|
|
70
|
-
}>;
|
|
71
|
-
}
|
|
72
|
-
/** One payline over a cols×rows grid: the row index (0 = top) the line takes in each column. */
|
|
73
|
-
interface PaylineDef {
|
|
74
|
-
/** length must equal grid.cols; each value in 0..rows-1 */
|
|
75
|
-
pattern: number[];
|
|
76
|
-
label?: string;
|
|
77
|
-
}
|
|
78
|
-
/** A single grid cell, 0-based, row 0 = top. */
|
|
79
|
-
type CellRef = [col: number, row: number];
|
|
80
|
-
/** A named winning shape: an arbitrary set of grid cells (not one-per-column like a payline),
|
|
81
|
-
* shown as a grid illustration with its name and optional description. */
|
|
82
|
-
interface ShapeDef {
|
|
83
|
-
/** The lit cells, in any pattern. */
|
|
84
|
-
cells: CellRef[];
|
|
85
|
-
name: string;
|
|
86
|
-
description?: string;
|
|
87
|
-
}
|
|
88
|
-
/** How a game pays — drives the GameInfo win-section illustration. One section = one kind.
|
|
89
|
-
* `example`/`winExample`/`loseExample` are optional; omit them for an auto-drawn illustration
|
|
90
|
-
* sized to `grid`. */
|
|
91
|
-
type WinSection = {
|
|
92
|
-
type: 'wins';
|
|
93
|
-
title?: string;
|
|
94
|
-
order?: number;
|
|
95
|
-
grid: {
|
|
96
|
-
cols: number;
|
|
97
|
-
rows: number;
|
|
98
|
-
};
|
|
99
|
-
/** Optional prose shown alongside the illustration. */
|
|
100
|
-
description?: string;
|
|
101
|
-
} & ({
|
|
102
|
-
kind: 'classic';
|
|
103
|
-
lines: Array<number[] | PaylineDef>;
|
|
104
|
-
} | {
|
|
105
|
-
kind: 'cluster';
|
|
106
|
-
minCount: number;
|
|
107
|
-
example?: CellRef[];
|
|
108
|
-
} | {
|
|
109
|
-
kind: 'anywhere';
|
|
110
|
-
minCount: number;
|
|
111
|
-
example?: CellRef[];
|
|
112
|
-
} | {
|
|
113
|
-
kind: 'ways';
|
|
114
|
-
winExample?: CellRef[];
|
|
115
|
-
loseExample?: CellRef[];
|
|
116
|
-
} | {
|
|
117
|
-
kind: 'shapes';
|
|
118
|
-
shapes: ShapeDef[];
|
|
119
|
-
});
|
|
120
|
-
/** A playable mode / bonus-buy option, shown for comparison (informational only). */
|
|
121
|
-
interface GameMode {
|
|
122
|
-
title: string;
|
|
123
|
-
price?: string;
|
|
124
|
-
rtp?: number;
|
|
125
|
-
maxWin?: string;
|
|
126
|
-
description?: string;
|
|
127
|
-
}
|
|
128
|
-
/** A preset game-info section. `order` overrides placement; by default `modes` comes
|
|
129
|
-
* first, `controls` second, and the rest follow in declaration order. */
|
|
130
|
-
type GameInfoSection = {
|
|
131
|
-
type: 'modes';
|
|
132
|
-
title?: string;
|
|
133
|
-
order?: number;
|
|
134
|
-
modes: GameMode[];
|
|
135
|
-
} | {
|
|
136
|
-
type: 'controls';
|
|
137
|
-
title?: string;
|
|
138
|
-
order?: number;
|
|
139
|
-
} | {
|
|
140
|
-
type: 'hotkeys';
|
|
141
|
-
title?: string;
|
|
142
|
-
order?: number;
|
|
143
|
-
} | {
|
|
144
|
-
type: 'paytable';
|
|
145
|
-
title?: string;
|
|
146
|
-
order?: number;
|
|
147
|
-
rows: PaytableRow[];
|
|
148
|
-
} | WinSection | {
|
|
149
|
-
type: 'custom';
|
|
150
|
-
title?: string;
|
|
151
|
-
order?: number;
|
|
152
|
-
node?: HTMLElement;
|
|
153
|
-
html?: string;
|
|
154
|
-
};
|
|
155
|
-
interface GameInfoContent {
|
|
156
|
-
sections?: GameInfoSection[];
|
|
157
|
-
}
|
|
158
|
-
/** Autoplay limits. Presence of this object (vs `null`) is what enables autoplay. */
|
|
159
|
-
interface AutoplayConfig {
|
|
160
|
-
/** Maximum selectable spin count in the autoplay picker. Caps the built-in presets and
|
|
161
|
-
* drops the unlimited (∞) choice; if it isn't already a preset it becomes the top choice.
|
|
162
|
-
* Omit for the default presets (including ∞). */
|
|
163
|
-
maxCount?: number;
|
|
164
|
-
}
|
|
165
|
-
interface ShellFeatures {
|
|
166
|
-
turbo: 0 | 1 | 2 | 3;
|
|
167
|
-
/** Master keyboard-shortcut switch. Defaults to `true`; set `false` to disable ALL hotkeys
|
|
168
|
-
* (overrides `spacebar` and any future hotkey). */
|
|
169
|
-
hotkeys?: boolean;
|
|
170
|
-
/** Spacebar starts a spin in base mode. Defaults to `true`; set `false` to disable the
|
|
171
|
-
* keyboard shortcut (e.g. jurisdictions that forbid quick-spin keys). */
|
|
172
|
-
spacebar?: boolean;
|
|
173
|
-
/** Autoplay: `null` (or omitted) disables it; an object enables it (optionally with limits). */
|
|
174
|
-
autoplay?: AutoplayConfig | null;
|
|
175
|
-
buyBonus: BonusOption[] | false;
|
|
176
|
-
}
|
|
177
|
-
interface AutoplayOptions {
|
|
178
|
-
active: boolean;
|
|
179
|
-
remaining: number;
|
|
180
|
-
}
|
|
181
|
-
interface FreeSpinsState {
|
|
182
|
-
/** Spin index for the `current / total` counter. Set to `null` (or omit) to instead show just
|
|
183
|
-
* `total` as a single number — drive a countdown by decrementing `total` each spin. */
|
|
184
|
-
current?: number | null;
|
|
185
|
-
total: number;
|
|
186
|
-
totalWin: number;
|
|
187
|
-
}
|
|
188
|
-
/** One footer button of a generic modal. Clicking it runs `on` (if any), then closes the modal. */
|
|
189
|
-
interface ModalAction {
|
|
190
|
-
title: string;
|
|
191
|
-
/** Button fill colour (any CSS colour). Omit for a neutral/secondary button. */
|
|
192
|
-
color?: string;
|
|
193
|
-
on?: () => void;
|
|
194
|
-
}
|
|
195
|
-
/** Options for `shell.openReplay()` — a non-dismissable replay summary modal.
|
|
196
|
-
* `bonusId` is matched against `features.buyBonus` to label the mode and read the cost
|
|
197
|
-
* multiplier. There is no ✕ and the backdrop never closes it; the only action is START
|
|
198
|
-
* REPLAY, which closes the modal, runs `onReplay`, then reopens it. */
|
|
199
|
-
interface ReplayModalOptions {
|
|
200
|
-
bonusId: string;
|
|
201
|
-
/** Base bet the replay was recorded at. */
|
|
202
|
-
bet: number;
|
|
203
|
-
payoutMultiplier: number;
|
|
204
|
-
/** Runs after the modal closes; the modal reopens once it resolves (immediately for sync). */
|
|
205
|
-
onReplay: () => void | Promise<void>;
|
|
206
|
-
}
|
|
207
|
-
/** Options for `shell.openModal()` — a generic, externally-triggered card modal. */
|
|
208
|
-
interface ModalOptions {
|
|
209
|
-
/** Show the ✕ in the overlay's top-right corner. */
|
|
210
|
-
availableClose: boolean;
|
|
211
|
-
title: string;
|
|
212
|
-
body: string;
|
|
213
|
-
/** Footer buttons; each closes the modal (after running its `on`). */
|
|
214
|
-
actions?: ModalAction[];
|
|
215
|
-
/** Backdrop blur in px (defaults to the shell's standard blur). */
|
|
216
|
-
blurLevel?: number;
|
|
217
|
-
/** Optional keyboard handler — called by the shell keyboard controller while this modal is
|
|
218
|
-
* open. Return true to consume the key (prevents bar actions + Escape close); false to let
|
|
219
|
-
* the controller handle it (Escape → closeModal). */
|
|
220
|
-
onKey?: (e: KeyboardEvent) => boolean;
|
|
221
|
-
}
|
|
222
|
-
interface ShellConfig {
|
|
223
|
-
mount: HTMLElement;
|
|
224
|
-
theme?: ThemeConfig;
|
|
225
|
-
gameInfo: GameInfoContent;
|
|
226
|
-
language: string;
|
|
227
|
-
/** Game version shown in the game-info footer (e.g. '1.2.0'). Defaults to '1.0.0'. The footer
|
|
228
|
-
* stamp is `${version}.${engineVersionWithoutDots}` — e.g. game 1.0.0 on engine 0.24.6 → '1.0.0.0246'. */
|
|
229
|
-
version?: string;
|
|
230
|
-
/** When true, all built-in shell text is shown in the social-casino vocabulary (derived from
|
|
231
|
-
* English via word-swap rules), regardless of `language`. Game-supplied content is untouched. */
|
|
232
|
-
isSocial?: boolean;
|
|
233
|
-
currency: CurrencyConfig;
|
|
234
|
-
availableBets: number[];
|
|
235
|
-
defaultBet: number;
|
|
236
|
-
currentBet: number | null;
|
|
237
|
-
balance: number;
|
|
238
|
-
win: number;
|
|
239
|
-
mode: ShellMode;
|
|
240
|
-
/** Mark this shell as a read-only historical-round replay. A replay never shows the player's
|
|
241
|
-
* balance (there's no live wallet), even while its free-spins phase runs in `freeSpins` mode.
|
|
242
|
-
* Defaults to `mode === 'replay'`; set explicitly when a replay starts in another mode. */
|
|
243
|
-
replay?: boolean;
|
|
244
|
-
features: ShellFeatures;
|
|
245
|
-
/** Override the BUY BONUS bar button's action: when set, tapping it calls this instead of
|
|
246
|
-
* opening the built-in buy-bonus overlay (e.g. the game shows its own bonus UI). The button
|
|
247
|
-
* is shown whenever this OR `features.buyBonus` is set. */
|
|
248
|
-
onBonusBuy?: () => void;
|
|
249
|
-
}
|
|
250
|
-
interface ShellState {
|
|
251
|
-
mode: ShellMode;
|
|
252
|
-
/** Sticky replay marker — true for a historical-round replay, regardless of the current
|
|
253
|
-
* `mode`. Set once (from config or when `mode` becomes 'replay') and never cleared, since a
|
|
254
|
-
* shell instance is either a live game or a replay viewer for its whole lifetime. */
|
|
255
|
-
replay: boolean;
|
|
256
|
-
balance: number;
|
|
257
|
-
win: number;
|
|
258
|
-
bet: number;
|
|
259
|
-
availableBets: number[];
|
|
260
|
-
busy: boolean;
|
|
261
|
-
autoplay: AutoplayOptions;
|
|
262
|
-
turbo: number;
|
|
263
|
-
buyBonusEnabled: boolean;
|
|
264
|
-
freeSpins: FreeSpinsState;
|
|
265
|
-
/** The currently activated `feature` option (e.g. Ante), or null. Drives the
|
|
266
|
-
* effective-bet readout tint and the BUY BONUS → DISABLE toggle on the bar. */
|
|
267
|
-
activeFeature: BonusOption | null;
|
|
268
|
-
}
|
|
269
|
-
interface ShellEvents {
|
|
270
|
-
spin: void;
|
|
271
|
-
betChange: number;
|
|
272
|
-
autoplayStart: AutoplayOptions;
|
|
273
|
-
autoplayStop: void;
|
|
274
|
-
turboChange: number;
|
|
275
|
-
buyBonusSelect: {
|
|
276
|
-
id: string;
|
|
277
|
-
};
|
|
278
|
-
featureActivate: {
|
|
279
|
-
id: string;
|
|
280
|
-
};
|
|
281
|
-
featureDeactivate: {
|
|
282
|
-
id: string;
|
|
283
|
-
};
|
|
284
|
-
menuOpen: void;
|
|
285
|
-
settingsOpen: void;
|
|
286
|
-
infoOpen: void;
|
|
287
|
-
settingChange: {
|
|
288
|
-
key: string;
|
|
289
|
-
value: unknown;
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Minimal typed event emitter — internal utility for platform-core.
|
|
295
|
-
*
|
|
296
|
-
* Supports `void` event types — events that carry no data can be emitted
|
|
297
|
-
* without arguments: `emitter.emit('eventName')`.
|
|
298
|
-
*
|
|
299
|
-
* Mirrors the EventEmitter shipped from game-engine's core, copied here
|
|
300
|
-
* so platform-core has no upward dependency on game-engine.
|
|
301
|
-
*/
|
|
302
|
-
declare class EventEmitter<TEvents extends {}> {
|
|
303
|
-
private listeners;
|
|
304
|
-
on<K extends keyof TEvents>(event: K, handler: (data: TEvents[K]) => void): this;
|
|
305
|
-
once<K extends keyof TEvents>(event: K, handler: (data: TEvents[K]) => void): this;
|
|
306
|
-
off<K extends keyof TEvents>(event: K, handler: (data: TEvents[K]) => void): this;
|
|
307
|
-
emit<K extends keyof TEvents>(...args: TEvents[K] extends void ? [event: K] : [event: K, data: TEvents[K]]): void;
|
|
308
|
-
removeAllListeners(event?: keyof TEvents): this;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
declare class GameShell extends EventEmitter<ShellEvents> {
|
|
312
|
-
readonly config: ShellConfig;
|
|
313
|
-
state: ShellState;
|
|
314
|
-
private root;
|
|
315
|
-
private styleEl;
|
|
316
|
-
private barHost;
|
|
317
|
-
private modalHost;
|
|
318
|
-
private destroyed;
|
|
319
|
-
layout: 'wide' | 'mobile';
|
|
320
|
-
private ro;
|
|
321
|
-
private prevBalance;
|
|
322
|
-
private prevWin;
|
|
323
|
-
private moneyAnims;
|
|
324
|
-
private kbd;
|
|
325
|
-
private i18n;
|
|
326
|
-
/** onKey handler of the currently open modal/overlay, if any (set in showModal, cleared in closeModal). */
|
|
327
|
-
private modalOnKey;
|
|
328
|
-
/** Shared sound on/off state — Settings speaker toggle and the Shift+M hotkey stay in sync. The
|
|
329
|
-
* game listens to `settingChange({ key: 'sound' })` to (un)mute audio. */
|
|
330
|
-
soundOn: boolean;
|
|
331
|
-
/** Set by the open Settings modal so Shift+M live-updates its speaker icon; cleared on close. */
|
|
332
|
-
private soundRefresh;
|
|
333
|
-
constructor(config: ShellConfig);
|
|
334
|
-
render(): void;
|
|
335
|
-
private cancelMoneyAnims;
|
|
336
|
-
/** Keep the WIN pill inline between the groups; float it above when it won't fit. */
|
|
337
|
-
/**
|
|
338
|
-
* Landscape bar fills the width when it fits. When it overflows, the WIN pill is
|
|
339
|
-
* lifted above the bar (unscaled, so it stays readable) and the remaining row is
|
|
340
|
-
* centred and scaled down to fit — keeping the controls as large as possible.
|
|
341
|
-
*/
|
|
342
|
-
private applyFitScale;
|
|
343
|
-
/** Pull window focus into the iframe on first pointer interaction so `document` keydown (the
|
|
344
|
-
* spacebar shortcut) fires. No-op / harmless when already focused or full-page. */
|
|
345
|
-
private pullFocus;
|
|
346
|
-
setLayout(layout: 'wide' | 'mobile'): void;
|
|
347
|
-
/** Resolve a built-in shell string through the i18n resolver (translation + optional socialize). */
|
|
348
|
-
t(text: string): string;
|
|
349
|
-
/** Toggle the social vocabulary at runtime (rebuilds resolver, re-renders bar). */
|
|
350
|
-
setSocial(isSocial: boolean): void;
|
|
351
|
-
/** Swap the active language at runtime (rebuilds resolver, re-renders bar). */
|
|
352
|
-
setLanguage(lang: string): void;
|
|
353
|
-
/** Recolour the shell at runtime (e.g. switch dark/light scheme). */
|
|
354
|
-
setTheme(theme: ThemeConfig): void;
|
|
355
|
-
private observeLayout;
|
|
356
|
-
private animateMoney;
|
|
357
|
-
setBalance(n: number): void;
|
|
358
|
-
setWin(n: number): void;
|
|
359
|
-
setBet(n: number): void;
|
|
360
|
-
setMode(mode: ShellMode): void;
|
|
361
|
-
setBusy(busy: boolean): void;
|
|
362
|
-
setAutoplay(a: AutoplayOptions): void;
|
|
363
|
-
setTurbo(level: number): void;
|
|
364
|
-
/** Currency-aware money formatter for WIN amounts (variable decimals: 0.0041 stays 0.0041, not
|
|
365
|
-
* 0.00). The host hands this to a scene so games format money without knowing the currency. */
|
|
366
|
-
formatWin(value: number): string;
|
|
367
|
-
setBuyBonusEnabled(enabled: boolean): void;
|
|
368
|
-
setFreeSpins(fs: FreeSpinsState): void;
|
|
369
|
-
private showModal;
|
|
370
|
-
/** Uniformly scale every open centred card modal (`.ge-sheet`) down so it fits a short/narrow
|
|
371
|
-
* popout — the same idea as the bar's fit-scale. Covers the pickers, generic + replay modals,
|
|
372
|
-
* AND the buy-bonus confirm (which is hosted inside the overlay, not directly in modalHost).
|
|
373
|
-
* Full-screen overlays handle their own responsiveness (scroll + vh-clamp). */
|
|
374
|
-
fitModals(): void;
|
|
375
|
-
/** Fraction of the frame a card modal may occupy; the rest is breathing-room margin. Keeps
|
|
376
|
-
* modals from filling a small popout edge-to-edge (so even short pickers scale down there). */
|
|
377
|
-
private static readonly MODAL_FIT;
|
|
378
|
-
/** The bar's design width (px). When the frame is narrower, the bar fit-scales DOWN with the
|
|
379
|
-
* screen — the SAME factor in every mode, so replay/free-spins shrink like base instead of
|
|
380
|
-
* staying full-size on a popout. */
|
|
381
|
-
private static readonly BAR_REF_WIDTH;
|
|
382
|
-
/** Lower bound on the bar fit-scale (guards a degenerate near-zero frame). */
|
|
383
|
-
private static readonly BAR_MIN_SCALE;
|
|
384
|
-
private fitSheet;
|
|
385
|
-
/** Activate a `feature` option (e.g. Ante): the bar shows the effective bet, tinted with
|
|
386
|
-
* the feature accent, and BUY BONUS becomes DISABLE. */
|
|
387
|
-
activateFeature(bonus: BonusOption): void;
|
|
388
|
-
/** Clear the active feature — reverts the bet readout and the BUY BONUS button. */
|
|
389
|
-
deactivateFeature(): void;
|
|
390
|
-
openMenu(): void;
|
|
391
|
-
openSettings(): void;
|
|
392
|
-
openInfo(): void;
|
|
393
|
-
openBuyBonus(): void;
|
|
394
|
-
/** Open a generic, externally-driven modal (title + body + optional action buttons).
|
|
395
|
-
* Each action runs its `on` then closes; the ✕ shows when `availableClose` is true. */
|
|
396
|
-
openModal(opts: ModalOptions): void;
|
|
397
|
-
/** Programmatically dismiss whatever modal/overlay is currently shown (e.g. auto-close the
|
|
398
|
-
* reconnect overlay once the link is restored). No-op when nothing is open. */
|
|
399
|
-
closeModal(): void;
|
|
400
|
-
/** Flip the shared sound state, notify the game (`settingChange({ key: 'sound' })`), and live-update
|
|
401
|
-
* the Settings speaker icon if that modal is open. Used by both the Settings toggle and Shift+M. */
|
|
402
|
-
setSound(on: boolean): void;
|
|
403
|
-
/** The Settings modal registers an icon-updater while open (cleared on close). */
|
|
404
|
-
setSoundRefresh(fn: ((on: boolean) => void) | null): void;
|
|
405
|
-
/** Open the non-dismissable replay summary modal (START REPLAY → onReplay → reopen). */
|
|
406
|
-
openReplay(opts: ReplayModalOptions): void;
|
|
407
|
-
/** Bet picker — list of available bets with an accent Confirm. */
|
|
408
|
-
openBetPicker(): void;
|
|
409
|
-
/** Autoplay picker — spin-count list; Confirm starts autoplay. */
|
|
410
|
-
openAutoplayPicker(): void;
|
|
411
|
-
destroy(): Promise<void>;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/** Rewrite restricted gambling terms in `text` to social-safe phrasing, preserving case. */
|
|
415
|
-
declare function socialize(text: string): string;
|
|
416
|
-
type Lang = 'de' | 'en' | 'es' | 'fi' | 'fr' | 'hi' | 'id' | 'ja' | 'ko' | 'pl' | 'pt' | 'ru' | 'tr' | 'vi' | 'zh' | 'da';
|
|
417
|
-
declare function normalizeLang(code: string | null | undefined): Lang;
|
|
418
|
-
interface I18nOptions {
|
|
419
|
-
language: string;
|
|
420
|
-
isSocial?: boolean;
|
|
421
|
-
messages?: Partial<Record<Lang, Record<string, string>>>;
|
|
422
|
-
}
|
|
423
|
-
interface I18n {
|
|
424
|
-
readonly lang: Lang;
|
|
425
|
-
t(src: string): string;
|
|
426
|
-
}
|
|
427
|
-
declare function createI18n(opts: I18nOptions): I18n;
|
|
428
|
-
|
|
429
|
-
declare function createGameShell(config: ShellConfig): GameShell;
|
|
430
|
-
declare function removeGameShell(): Promise<void>;
|
|
431
|
-
|
|
432
|
-
export { GameShell, createGameShell, createI18n, normalizeLang, removeGameShell, socialize };
|
|
433
|
-
export type { AutoplayConfig, AutoplayOptions, BonusCardContext, BonusOption, CellRef, CurrencyConfig, FreeSpinsState, GameInfoContent, GameInfoSection, GameMode, I18n, I18nOptions, Lang, ModalAction, ModalOptions, PaylineDef, PaytableRow, ReplayModalOptions, ShapeDef, ShellConfig, ShellEvents, ShellFeatures, ShellMode, ShellState, ThemeConfig, WinSection };
|