@energy8platform/shell 0.4.0 → 0.5.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/pixi.d.ts CHANGED
@@ -18,7 +18,11 @@ declare class EventEmitter<TEvents extends {}> {
18
18
  removeAllListeners(event?: keyof TEvents): this;
19
19
  }
20
20
 
21
- type ShellMode = 'base' | 'freeSpins' | 'replay';
21
+ /** `freeSpins` and `bonus` are the SAME bar layout (host-driven hero + Total Win); `freeSpins` is
22
+ * kept as a back-compat alias for the common case (its readout is derived current/total), while
23
+ * `bonus` pairs with `setBonus()` to show a game-supplied label + value (adventure, hold-and-spin,
24
+ * respins — anything that isn't a plain free-spins counter). */
25
+ type ShellMode = 'base' | 'bonus' | 'freeSpins' | 'replay';
22
26
  interface CurrencyConfig {
23
27
  symbol: string;
24
28
  position: 'left' | 'right';
@@ -207,6 +211,19 @@ interface FreeSpinsState {
207
211
  total: number;
208
212
  totalWin: number;
209
213
  }
214
+ /** A game-supplied bonus readout for the bar hero, set via `setBonus()`. Generalizes the
215
+ * free-spins counter: the shell renders `label` (localized via the shell translator, so a game
216
+ * i18n entry for it is honoured) + `value` (a pre-formatted string, shown verbatim — "2 / 10",
217
+ * "3", "×5", "7 coins") + the Total Win accumulator. The shell stays free of any per-game bonus
218
+ * concept — the label/value semantics live in the game/host. */
219
+ interface BonusReadout {
220
+ /** Bar label, e.g. 'Free spins' | 'Adventure' | 'Hold & Spin'. Run through the shell translator. */
221
+ label: string;
222
+ /** Pre-formatted counter value shown verbatim (NOT translated). */
223
+ value: string;
224
+ /** Cumulative bonus win for the Total Win readout. */
225
+ totalWin: number;
226
+ }
210
227
  /** One footer button of a generic modal. Clicking it runs `on` (if any), then closes the modal. */
211
228
  interface ModalAction {
212
229
  title: string;
@@ -285,6 +302,12 @@ interface ShellState {
285
302
  turbo: number;
286
303
  buyBonusEnabled: boolean;
287
304
  freeSpins: FreeSpinsState;
305
+ /** Game-supplied bonus label + value override (from `setBonus()`). When null the bar derives the
306
+ * readout from `freeSpins` (label 'Free spins', value current/total) — the back-compat default. */
307
+ bonus: {
308
+ label: string;
309
+ value: string;
310
+ } | null;
288
311
  /** The currently activated `feature` option (e.g. Ante), or null. Drives the
289
312
  * effective-bet readout tint and the BUY BONUS → DISABLE toggle on the bar. */
290
313
  activeFeature: BonusOption$1 | null;
@@ -473,7 +496,7 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
473
496
  tokens: ShellTokens;
474
497
  layout: ShellLayoutMode;
475
498
  soundOn: boolean;
476
- readonly engineVersion = "0.4.0";
499
+ readonly engineVersion = "0.5.0";
477
500
  readonly actions: ShellActions;
478
501
  private renderer;
479
502
  private i18n;
@@ -516,6 +539,10 @@ declare class ShellController extends EventEmitter<ShellEvents> implements Shell
516
539
  setTurbo(level: number): void;
517
540
  setBuyBonusEnabled(enabled: boolean): void;
518
541
  setFreeSpins(fs: FreeSpinsState): void;
542
+ /** Generic bonus readout (adventure / hold-and-spin / respins). Sets a game-supplied label+value
543
+ * override for the bar hero and folds `totalWin` into the shared accumulator. Pairs with
544
+ * `setMode('bonus')`. `setFreeSpins()` clears the override back to the derived current/total. */
545
+ setBonus(b: BonusReadout): void;
519
546
  setTheme(theme: ThemeConfig): void;
520
547
  setLanguage(lang: string): void;
521
548
  setSocial(isSocial: boolean): void;
@@ -539,7 +566,7 @@ interface I18n {
539
566
  declare function createI18n(opts: I18nOptions): I18n;
540
567
 
541
568
  /** The @energy8platform/shell package version, stamped into the game-info footer. */
542
- declare const PACKAGE_VERSION = "0.4.0";
569
+ declare const PACKAGE_VERSION = "0.5.0";
543
570
 
544
571
  /** A shell: the renderer-agnostic controller plus the surface facade (safeArea/barHeight/setVisible)
545
572
  * an embedding host reads. `createShell`, `createGameShell` and `createPixiShell` all return this. */
@@ -679,4 +706,4 @@ declare function createPixiShell(config: PixiShellConfig): PixiGameShell;
679
706
  declare function removePixiShell(): Promise<void>;
680
707
 
681
708
  export { DEFAULT_ACCENT, PACKAGE_VERSION, PixiRenderer, SCHEMES, ShellController, createI18n, createPixiShell, createShell, normalizeLang, removePixiShell, resolveConfig, resolveTheme, socialize };
682
- export type { AutoplayConfig, AutoplayOptions, BonusCardContext, BonusOption, CellRef, CreateShellOptions, CurrencyConfig, FreeSpinsState, GameInfoContent, GameInfoSection, GameMode, I18n, I18nOptions, Lang, ModalAction, ModalOptions, OverlayHandle, OverlayRequest, PaylineDef, PaytableRow, PixiGameShell, PixiShellConfig, PixiShellSurface, ReplayModalOptions, ResolvedShellConfig, SafeArea, ShapeDef, Shell, ShellActions, ShellConfig, ShellEvents, ShellFeatures, ShellHost, ShellLayoutMode, ShellMode, ShellRenderer, ShellState, ShellSurface, ShellTokens, ThemeConfig, WinSection };
709
+ export type { AutoplayConfig, AutoplayOptions, BonusCardContext, BonusOption, BonusReadout, CellRef, CreateShellOptions, CurrencyConfig, FreeSpinsState, GameInfoContent, GameInfoSection, GameMode, I18n, I18nOptions, Lang, ModalAction, ModalOptions, OverlayHandle, OverlayRequest, PaylineDef, PaytableRow, PixiGameShell, PixiShellConfig, PixiShellSurface, ReplayModalOptions, ResolvedShellConfig, SafeArea, ShapeDef, Shell, ShellActions, ShellConfig, ShellEvents, ShellFeatures, ShellHost, ShellLayoutMode, ShellMode, ShellRenderer, ShellState, ShellSurface, ShellTokens, ThemeConfig, WinSection };