@betorigami/games 3.4.18 → 3.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.
Files changed (33) hide show
  1. package/dist/index.mjs +11224 -17275
  2. package/dist/src/components/advanced-dice/AdvancedDiceGame.d.ts +1 -3
  3. package/dist/src/components/advanced-dice/advanced-dice.api.d.ts +6 -1
  4. package/dist/src/components/advanced-dice/advanced-dice.mock.api.d.ts +6 -9
  5. package/dist/src/components/baccarat/BaccaratGame.d.ts +1 -3
  6. package/dist/src/components/baccarat/baccarat.api.d.ts +4 -1
  7. package/dist/src/components/baccarat/baccarat.mock.api.d.ts +4 -7
  8. package/dist/src/components/diamonds/DiamondsContent/DiamondsContent.d.ts +0 -1
  9. package/dist/src/components/diamonds/DiamondsGame.d.ts +1 -3
  10. package/dist/src/components/diamonds/diamonds.api.d.ts +4 -1
  11. package/dist/src/components/diamonds/diamonds.mock.api.d.ts +6 -9
  12. package/dist/src/components/diamonds/diamonds.utils.d.ts +8 -0
  13. package/dist/src/components/keno/KenoGame.d.ts +6 -3
  14. package/dist/src/components/keno/keno.api.d.ts +4 -1
  15. package/dist/src/components/keno/keno.mock.api.d.ts +6 -9
  16. package/dist/src/components/plinko/PlinkoGame.d.ts +1 -3
  17. package/dist/src/components/plinko/plinko.api.d.ts +4 -1
  18. package/dist/src/components/plinko/plinko.mock.api.d.ts +6 -9
  19. package/dist/src/components/roulette/RouletteGame.d.ts +1 -3
  20. package/dist/src/components/roulette/roulette.api.d.ts +6 -1
  21. package/dist/src/components/roulette/roulette.mock.api.d.ts +4 -7
  22. package/dist/test/advanced-dice/advanced-dice-api.test.d.ts +1 -0
  23. package/dist/test/blackjack/blackjack-api.test.d.ts +1 -0
  24. package/dist/test/blitz/blitz-api.test.d.ts +1 -0
  25. package/dist/test/diamonds/diamonds-api.test.d.ts +1 -0
  26. package/dist/test/diamonds/diamonds-highlight.test.d.ts +1 -0
  27. package/dist/test/dice/dice-api.test.d.ts +1 -0
  28. package/dist/test/limbo/limbo-api.test.d.ts +1 -0
  29. package/dist/test/mines/mines-api.test.d.ts +1 -0
  30. package/dist/test/plinko/plinko-api.test.d.ts +1 -0
  31. package/dist/test/plinko/plinko-mock-api.test.d.ts +1 -0
  32. package/dist/test/roulette/roulette-api.test.d.ts +1 -0
  33. package/package.json +3 -4
@@ -1,6 +1,4 @@
1
1
  import { AutobetSettingsWithId, GameBetResult, GameComponent } from '@betorigami/game-ui-shared';
2
- import { MockAdvancedDiceApi } from './advanced-dice.mock.api';
3
- import { AdvancedDiceApi } from './advanced-dice.api';
4
2
  export declare class AdvancedDiceGame extends GameComponent {
5
3
  private readonly limits;
6
4
  private readonly layout;
@@ -25,7 +23,7 @@ export declare class AdvancedDiceGame extends GameComponent {
25
23
  constructor();
26
24
  /** Cycles through roll types: Inside → Outside → Between → Inside */
27
25
  private cycleRollType;
28
- get advancedDiceApi(): AdvancedDiceApi | MockAdvancedDiceApi;
26
+ private readonly getAdvancedDiceApi;
29
27
  private buildGameInputs;
30
28
  private calculateWinChance;
31
29
  private calculateMultiplier;
@@ -3,7 +3,12 @@ import { AdvancedDiceInputs } from './advanced-dice.types';
3
3
  export interface AdvancedDiceStartArgs extends BaseStartArgs {
4
4
  language: Language;
5
5
  }
6
- export declare class AdvancedDiceApi {
6
+ export interface IAdvancedDiceApi {
7
+ startBet(data: AdvancedDiceStartArgs & {
8
+ gameInputs: AdvancedDiceInputs;
9
+ }): Promise<StartBetResponse>;
10
+ }
11
+ export declare class AdvancedDiceApi implements IAdvancedDiceApi {
7
12
  private readonly client;
8
13
  constructor(client: ProviderApi.Client);
9
14
  startBet(data: AdvancedDiceStartArgs & {
@@ -1,13 +1,10 @@
1
- import { BetResult } from '@betorigami/game-ui-shared';
2
- import { AdvancedDiceStartArgs } from './advanced-dice.api';
1
+ import { StartBetResponse } from '@betorigami/game-ui-shared';
2
+ import { AdvancedDiceStartArgs, IAdvancedDiceApi } from './advanced-dice.api';
3
3
  import { AdvancedDiceInputs } from './advanced-dice.types';
4
- export declare class MockAdvancedDiceApi {
5
- private readonly edge;
6
- constructor(edge: number);
4
+ export declare class MockAdvancedDiceApi implements IAdvancedDiceApi {
5
+ private readonly getEdge;
6
+ constructor(getEdge: () => number);
7
7
  startBet(data: AdvancedDiceStartArgs & {
8
8
  gameInputs: AdvancedDiceInputs;
9
- }): Promise<{
10
- success: true;
11
- data: BetResult;
12
- }>;
9
+ }): Promise<StartBetResponse>;
13
10
  }
@@ -1,6 +1,4 @@
1
1
  import { ChipTableGameComponent, ChipEvent, AutobetToggleEvent, AutobetSettingsWithId, GameBetResult } from '@betorigami/game-ui-shared';
2
- import { BaccaratApi } from './baccarat.api';
3
- import { MockBaccaratApi } from './baccarat.mock.api';
4
2
  export declare class BaccaratGame extends ChipTableGameComponent {
5
3
  private readonly layout;
6
4
  static styles: import('lit').CSSResult[];
@@ -17,7 +15,7 @@ export declare class BaccaratGame extends ChipTableGameComponent {
17
15
  private _baccaratManualEl?;
18
16
  private _baccaratAutoEl?;
19
17
  constructor();
20
- get baccaratApi(): BaccaratApi | MockBaccaratApi;
18
+ private readonly getBaccaratApi;
21
19
  get isToggleDisabled(): boolean;
22
20
  get areInputsDisabled(): boolean;
23
21
  private get isSlowRevealActive();
@@ -11,7 +11,10 @@ export type BaccaratStartArgs = {
11
11
  autobetSettings: AutobetApiSettings;
12
12
  };
13
13
  };
14
- export declare class BaccaratApi {
14
+ export interface IBaccaratApi {
15
+ startBet(data: BaccaratStartArgs): Promise<StartBetResponse>;
16
+ }
17
+ export declare class BaccaratApi implements IBaccaratApi {
15
18
  private readonly client;
16
19
  constructor(client: ProviderApi.Client);
17
20
  startBet(data: BaccaratStartArgs): Promise<StartBetResponse>;
@@ -1,8 +1,5 @@
1
- import { BetResult } from '@betorigami/game-ui-shared';
2
- import { BaccaratStartArgs } from './baccarat.api';
3
- export declare class MockBaccaratApi {
4
- startBet(data: BaccaratStartArgs): Promise<{
5
- success: true;
6
- data: BetResult;
7
- }>;
1
+ import { StartBetResponse } from '@betorigami/game-ui-shared';
2
+ import { BaccaratStartArgs, IBaccaratApi } from './baccarat.api';
3
+ export declare class MockBaccaratApi implements IBaccaratApi {
4
+ startBet(data: BaccaratStartArgs): Promise<StartBetResponse>;
8
5
  }
@@ -5,7 +5,6 @@ export declare class DiamondsContent extends OrigamiElement {
5
5
  private readonly preferences;
6
6
  private readonly layout;
7
7
  static styles: import('lit').CSSResult[];
8
- isPlaying: boolean;
9
8
  resultGems: number[] | null;
10
9
  autobetInProgress: boolean;
11
10
  private hoveredMultiplierIndex;
@@ -1,6 +1,4 @@
1
1
  import { AutobetSettingsWithId, GameBetResult, GameComponent } from '@betorigami/game-ui-shared';
2
- import { DiamondsApi } from './diamonds.api';
3
- import { MockDiamondsApi } from './diamonds.mock.api';
4
2
  export declare class DiamondsGame extends GameComponent {
5
3
  private readonly limits;
6
4
  private readonly layout;
@@ -11,7 +9,7 @@ export declare class DiamondsGame extends GameComponent {
11
9
  private _diamondsAutoEl?;
12
10
  constructor();
13
11
  get isToggleDisabled(): boolean;
14
- get diamondsApi(): DiamondsApi | MockDiamondsApi;
12
+ private readonly getDiamondsApi;
15
13
  private animationCompletedPromise;
16
14
  private handleBetExecution;
17
15
  diamondsManualPlay(): Promise<void>;
@@ -2,7 +2,10 @@ import { Language, ProviderApi, BaseStartArgs, StartBetResponse } from '@betorig
2
2
  export interface DiamondsStartArgs extends BaseStartArgs {
3
3
  language: Language;
4
4
  }
5
- export declare class DiamondsApi {
5
+ export interface IDiamondsApi {
6
+ startBet(data: DiamondsStartArgs): Promise<StartBetResponse>;
7
+ }
8
+ export declare class DiamondsApi implements IDiamondsApi {
6
9
  private readonly client;
7
10
  constructor(client: ProviderApi.Client);
8
11
  startBet(data: DiamondsStartArgs): Promise<StartBetResponse>;
@@ -1,10 +1,7 @@
1
- import { SupportedEdgePercentages, BetResult } from '@betorigami/game-ui-shared';
2
- import { DiamondsStartArgs } from './diamonds.api';
3
- export declare class MockDiamondsApi {
4
- private readonly edge;
5
- constructor(edge: SupportedEdgePercentages);
6
- startBet(data: DiamondsStartArgs): Promise<{
7
- success: true;
8
- data: BetResult;
9
- }>;
1
+ import { SupportedEdgePercentages, StartBetResponse } from '@betorigami/game-ui-shared';
2
+ import { DiamondsStartArgs, IDiamondsApi } from './diamonds.api';
3
+ export declare class MockDiamondsApi implements IDiamondsApi {
4
+ private readonly getEdge;
5
+ constructor(getEdge: () => SupportedEdgePercentages);
6
+ startBet(data: DiamondsStartArgs): Promise<StartBetResponse>;
10
7
  }
@@ -63,6 +63,14 @@ export type DiamondMatchInfo = {
63
63
  * @returns Object containing level and matched gem details
64
64
  */
65
65
  export declare function calculateDiamondsMatch(gemIndices: number[], appearedMask: boolean[]): DiamondMatchInfo;
66
+ /**
67
+ * Gets the payout level to highlight, or null until at least one gem has appeared
68
+ *
69
+ * @param gemIndices - Array of gem type indices (0-6)
70
+ * @param appearedMask - Boolean array indicating which gems have appeared
71
+ * @returns The current level (0-6), or null when no gem has appeared
72
+ */
73
+ export declare function getHighlightedLevel(gemIndices: number[], appearedMask: boolean[]): number | null;
66
74
  /**
67
75
  * Calculates which slots should have color highlights based on matched gems
68
76
  *
@@ -1,6 +1,4 @@
1
1
  import { KenoRiskChangeEvent, KenoTileClickEvent, AutobetSettingsWithId, GameBetResult, GameComponent } from '@betorigami/game-ui-shared';
2
- import { KenoApi } from './keno.api';
3
- import { MockKenoApi } from './keno.mock.api';
4
2
  export interface KenoHistory {
5
3
  multiplier: number;
6
4
  won: boolean;
@@ -27,7 +25,12 @@ export declare class KenoGame extends GameComponent {
27
25
  private getDisplayMultiplier;
28
26
  get isToggleDisabled(): boolean;
29
27
  get areInputsDisabled(): boolean;
30
- get kenoApi(): KenoApi | MockKenoApi;
28
+ private readonly getKenoApi;
29
+ /**
30
+ * The gap between result tiles in an animated reveal. Operators can change it with the
31
+ * --keno-tile-reveal-interval theme variable; anything unset or unparseable keeps the default.
32
+ */
33
+ private getTileRevealInterval;
31
34
  private _getGemPitchFromHits;
32
35
  private playGemRevealFeedback;
33
36
  private playLossGemRevealFeedback;
@@ -6,7 +6,10 @@ export interface KenoStartArgs extends BaseStartArgs {
6
6
  riskLevel: KenoRiskLevel;
7
7
  selectedNumbers: number[];
8
8
  }
9
- export declare class KenoApi {
9
+ export interface IKenoApi {
10
+ startBet(data: KenoStartArgs): Promise<StartBetResponse>;
11
+ }
12
+ export declare class KenoApi implements IKenoApi {
10
13
  private readonly client;
11
14
  constructor(client: ProviderApi.Client);
12
15
  startBet(data: KenoStartArgs): Promise<StartBetResponse>;
@@ -1,18 +1,15 @@
1
- import { BetResult, KenoEdge } from '@betorigami/game-ui-shared';
2
- import { KenoStartArgs } from './keno.api';
1
+ import { StartBetResponse, KenoEdge } from '@betorigami/game-ui-shared';
2
+ import { KenoStartArgs, IKenoApi } from './keno.api';
3
3
  export interface MockKenoSettings {
4
4
  shouldWin?: boolean;
5
5
  resultTiles?: number[];
6
6
  multiplier?: number;
7
7
  hitCount?: number;
8
8
  }
9
- export declare class MockKenoApi {
10
- private readonly edge;
11
- constructor(edge: KenoEdge);
12
- startBet(data: KenoStartArgs): Promise<{
13
- success: true;
14
- data: BetResult;
15
- }>;
9
+ export declare class MockKenoApi implements IKenoApi {
10
+ private readonly getEdge;
11
+ constructor(getEdge: () => KenoEdge);
12
+ startBet(data: KenoStartArgs): Promise<StartBetResponse>;
16
13
  private static generateRandomTiles;
17
14
  private calculateMultiplier;
18
15
  }
@@ -1,6 +1,4 @@
1
1
  import { AutobetSettingsWithId, GameBetResult, GameComponent } from '@betorigami/game-ui-shared';
2
- import { PlinkoApi } from './plinko.api';
3
- import { MockPlinkoApi } from './plinko.mock.api';
4
2
  export interface PlinkoHistory {
5
3
  multiplier: number;
6
4
  won: boolean;
@@ -25,7 +23,7 @@ export declare class PlinkoGame extends GameComponent {
25
23
  private _plinkoAutoEl?;
26
24
  private _plinkoContentEl?;
27
25
  get isGameInProgress(): boolean;
28
- get plinkoApi(): PlinkoApi | MockPlinkoApi;
26
+ private readonly getPlinkoApi;
29
27
  constructor();
30
28
  private get customBinColors();
31
29
  get binMultipliers(): number[];
@@ -5,7 +5,10 @@ export interface PlinkoStartArgs extends BaseStartArgs {
5
5
  riskLevel: PlinkoRiskLevel;
6
6
  rowCount: PlinkoRowCount;
7
7
  }
8
- export declare class PlinkoApi {
8
+ export interface IPlinkoApi {
9
+ startBet(data: PlinkoStartArgs): Promise<StartBetResponse>;
10
+ }
11
+ export declare class PlinkoApi implements IPlinkoApi {
9
12
  private readonly client;
10
13
  constructor(client: ProviderApi.Client);
11
14
  startBet(data: PlinkoStartArgs): Promise<StartBetResponse>;
@@ -1,10 +1,7 @@
1
- import { SupportedEdgePercentages, BetResult } from '@betorigami/game-ui-shared';
2
- import { PlinkoStartArgs } from './plinko.api';
3
- export declare class MockPlinkoApi {
4
- private readonly edge;
5
- constructor(edge: SupportedEdgePercentages);
6
- startBet(data: PlinkoStartArgs): Promise<{
7
- success: true;
8
- data: BetResult;
9
- }>;
1
+ import { SupportedEdgePercentages, StartBetResponse } from '@betorigami/game-ui-shared';
2
+ import { PlinkoStartArgs, IPlinkoApi } from './plinko.api';
3
+ export declare class MockPlinkoApi implements IPlinkoApi {
4
+ private readonly getEdge;
5
+ constructor(getEdge: () => SupportedEdgePercentages);
6
+ startBet(data: PlinkoStartArgs): Promise<StartBetResponse>;
10
7
  }
@@ -1,6 +1,4 @@
1
1
  import { ChipTableGameComponent, AutobetSettingsWithId, GameBetResult, ChipEvent } from '@betorigami/game-ui-shared';
2
- import { RouletteApi } from './roulette.api';
3
- import { MockRouletteApi } from './roulette.mock.api';
4
2
  import { RouletteType } from './roulette.constants';
5
3
  export declare class RouletteGame extends ChipTableGameComponent {
6
4
  private readonly layout;
@@ -19,7 +17,7 @@ export declare class RouletteGame extends ChipTableGameComponent {
19
17
  private _autoEl?;
20
18
  constructor();
21
19
  get rouletteType(): RouletteType;
22
- get rouletteApi(): RouletteApi | MockRouletteApi;
20
+ private readonly getRouletteApi;
23
21
  get isToggleDisabled(): boolean;
24
22
  get areInputsDisabled(): boolean;
25
23
  protected isMaxPayoutExceeded(chipEvents: ChipEvent[]): boolean;
@@ -5,7 +5,12 @@ export type RouletteStartArgs = {
5
5
  autobetSettings: AutobetApiSettings;
6
6
  };
7
7
  };
8
- export declare class RouletteApi {
8
+ export interface IRouletteApi {
9
+ startBet(data: RouletteStartArgs & {
10
+ gameInputs: RouletteStartAction;
11
+ }): Promise<StartBetResponse>;
12
+ }
13
+ export declare class RouletteApi implements IRouletteApi {
9
14
  private readonly client;
10
15
  constructor(client: ProviderApi.Client);
11
16
  startBet(data: RouletteStartArgs & {
@@ -1,10 +1,7 @@
1
- import { BetResult, RouletteStartAction } from '@betorigami/game-ui-shared';
2
- import { RouletteStartArgs } from './roulette.api';
3
- export declare class MockRouletteApi {
1
+ import { StartBetResponse, RouletteStartAction } from '@betorigami/game-ui-shared';
2
+ import { RouletteStartArgs, IRouletteApi } from './roulette.api';
3
+ export declare class MockRouletteApi implements IRouletteApi {
4
4
  startBet(data: RouletteStartArgs & {
5
5
  gameInputs: RouletteStartAction;
6
- }): Promise<{
7
- success: true;
8
- data: BetResult;
9
- }>;
6
+ }): Promise<StartBetResponse>;
10
7
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betorigami/games",
3
- "version": "3.4.18",
3
+ "version": "3.5.0",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",
@@ -26,11 +26,10 @@
26
26
  "@lit/context": "^1.1.5",
27
27
  "big.js": "^7.0.1",
28
28
  "lit": "^3.3.0",
29
- "lottie-web": "^5.13.0",
30
29
  "matter-js": "^0.18.0",
31
30
  "web-haptics": "^0.0.6",
32
- "@betorigami/game-ui-shared": "4.1.0",
33
- "@betorigami/game-ui-wheel": "1.1.11"
31
+ "@betorigami/game-ui-shared": "5.0.0",
32
+ "@betorigami/game-ui-wheel": "1.2.0"
34
33
  },
35
34
  "devDependencies": {
36
35
  "@playwright/test": "^1.53.0",