Appearance
API Methods
The OperatorInterface class provides static methods to communicate with the operator.
Setup
setup
Initializes the OperatorInterface.
typescript
static setup(
operatorProtocol: OperatorProtocol,
gameCode: string,
currencyCode: string,
languageCode: string,
playerID: string,
mode: string,
lobbyURL: string,
isMobile?: boolean
): Promise<void>Parameters:
operatorProtocol: The operator protocol to use.gameCode: The game code.currencyCode: The 3-letter ISO currency code.languageCode: The 2-letter ISO language code.playerID: The player ID.mode: The game mode (e.g., "REAL", "DEMO").lobbyURL: The URL to the lobby.isMobile: (Optional) Whether the game is in mobile mode. Defaults tofalse.
Event Handling
addEventListener
Adds a listener to a given incoming event.
typescript
static addEventListener(event: OperatorInterfaceToGameMessage, callback: Callback): CallbackParameters:
event: The incoming event to listen for.callback: The callback function to call.
Returns:
- The callback function.
on
Adds a listener to a given incoming event. on is an alias for addEventListener.
typescript
static on(event: OperatorInterfaceToGameMessage, callback: Callback): CallbackParameters:
event: The incoming event to listen for.callback: The callback function to call.
Returns:
- The callback function.
once
Adds a listener to a given incoming event. The method removes the listener after the first call.
typescript
static once(event: OperatorInterfaceToGameMessage, callback: Callback): CallbackParameters:
event: The incoming event to listen for.callback: The callback function to call.
Returns:
- The callback function.
removeEventListener
Removes a listener for a given event.
typescript
static removeEventListener(event: OperatorInterfaceToGameMessage, callback: Callback): voidParameters:
event: The incoming event.callback: The callback function to remove.
Game State
gameReady
Call this method after the game loads and initializes.
typescript
static gameReady(): voidloadProgress
Call this method to update the casino with the loading progress. The casino displays the progress in a loading screen.
typescript
static loadProgress(progress: number): voidParameters:
progress: A number between 0 and 1 representing the loading progress (1 = 100%).
loadComplete
Call this method when loading is complete.
typescript
static loadComplete(): voidgameDataLoaded
Call this method when the game receives the loadConfig call.
typescript
static gameDataLoaded(): voidinitialGameState
Call this method before loading starts. It tells the operator whether the game will be muted.
typescript
static initialGameState(muted: boolean): voidParameters:
muted: Whether the game is muted.
retrievedStoredSettings
Call this method after the game retrieves stored user settings, such as the mute state.
typescript
static retrievedStoredSettings(): voidgameUIUpdated
Call this method when the buy feature menu opens or closes. Also call it when the splash screen appears or disappears, or when the game waits for user confirmation.
typescript
static gameUIUpdated(buyFeatureMenuOpen: boolean, splashScreenVisible: boolean, waitingForUserConfirmation: boolean): voidParameters:
buyFeatureMenuOpen: Whether the buy feature menu is open.splashScreenVisible: Whether the splash screen is visible.waitingForUserConfirmation: Whether the game is waiting for user confirmation.
Gameplay
autoPlayStarted
Call this method when the game starts autoplay.
typescript
static autoPlayStarted(): voidautoPlayFinished
Call this method when the game ends autoplay.
typescript
static autoPlayFinished(): voidspinAnimationStarted
Call this method when the spin animation starts.
typescript
static spinAnimationStarted(): voidspinAnimationStopped
Call this method when the spin animation ends.
typescript
static spinAnimationStopped(): voidroundStarted
Call this method when a new gameround starts.
typescript
static roundStarted(balance: number, stake: number): voidParameters:
balance: The player's balance in minor units.stake: The player's stake in minor units.
roundEnded
Call this method when a gameround ends.
typescript
static roundEnded(balance: number, stake: number, winAmount?: number, ticketsLeftAfter?: number): voidParameters:
balance: The player's balance in minor units.stake: The player's stake in minor units.winAmount: (Optional) The player's win amount in minor units. Defaults to 0.ticketsLeftAfter: (Optional) The number of tickets left after the gameround. Defaults to 0.
balanceUpdated
Call this method whenever the displayed balance changes.
typescript
static balanceUpdated(realBalance: number, demoBalance?: number, bonusBalance?: number, fudgeAmount?: number): voidParameters:
realBalance: The real balance of the player.demoBalance: (Optional) The demo balance of the player. Defaults to 0.bonusBalance: (Optional) The bonus balance of the player. Defaults to 0.fudgeAmount: (Optional) How much to fudge the displayed balance (if win animations have not yet finished). Defaults to 0.
stakeUpdated
Call this method to update the stake that the casino displays.
typescript
static stakeUpdated(stake: number): voidParameters:
stake: The player's stake in minor units.
cashWin
Call this method to update the win amount that the casino displays.
typescript
static cashWin(
winAmount: number,
stake: number,
winType?: 'normal' | 'big' | 'mega' | 'monster' | 'legendary',
isFreePlayWin?: boolean,
totalFreePlayWin?: number
): voidParameters:
winAmount: The player's win amount in minor units.stake: The player's bet amount in minor units.winType: (Optional) The type of win. Defaults to 'normal'.isFreePlayWin: (Optional) Whether the game awarded the win during freeplays. Defaults tofalse.totalFreePlayWin: (Optional) The total win during freeplays. Defaults to 0.
collected
Call this method when the player collects a win.
typescript
static collected(collectedAmount: number): voidParameters:
collectedAmount: The amount the player collected in minor units.
cashier
Call this method when the user runs out of funds, or attempts to spin with insufficient funds.
typescript
static cashier(): voidhelp
Call this method when the user requests help.
typescript
static help(): voidhistory
Call this method to navigate to the game history.
typescript
static history(): voidquit
Call this method when the user presses the quit button.
typescript
static quit(): voidresume
Call this method when the game regains focus.
typescript
static resume(): voidvisibleSymbols
Call this method to tell the operator which symbols are visible on the reels.
typescript
static visibleSymbols(visibleSymbols: number[][], stake: number): voidParameters:
visibleSymbols: The visible symbols.stake: The stake amount.
winningSymbols
Call this method to tell the operator which symbols appear in all winlines.
typescript
static winningSymbols(symbols: number[], stake: number): voidParameters:
symbols: The winning symbols.stake: The stake amount.
lineCountUpdated
Call this method when the number of winlines changes.
typescript
static lineCountUpdated(lineCount: number): voidParameters:
lineCount: The number of winlines.
cardGamble
Call this method when the player places a card gamble bet.
typescript
static cardGamble(): voidladderGamble
Call this method when the player places a ladder gamble bet.
typescript
static ladderGamble(): voidgambleWin
Call this method when the game awards a win after a gamble (bonus).
typescript
static gambleWin(winAmount: number, stake: number): voidParameters:
winAmount: The player's win amount in minor units.stake: The player's bet amount in minor units.
fullRow
Call this method when the game awards a full row winline.
typescript
static fullRow(rowCount: number, includesWilds: boolean, winlineSymbols: number[]): voidParameters:
rowCount: The number of symbols in the winline.includesWilds: Whether the winline includes a wild.winlineSymbols: The symbols in the winline.
scatterWin
Call this method when scatters award cash.
typescript
static scatterWin(winAmount: number, scatterSymbolID: number, positions: number[][]): voidParameters:
winAmount: The amount of cash the scatters awards.scatterSymbolID: The ID of the symbol which awarded the scatter win.positions: The position of the scatters on the reels.
Features
freeSpinsAwarded
Call this method when the game awards the free spins feature.
typescript
static freeSpinsAwarded(awarded: number, stake: number, inFreeSpins: boolean): voidParameters:
awarded: The number of free spins the game awarded.stake: The player's bet amount in minor units.inFreeSpins: Whether the game awarded the free spins during free spins.
featuredStarted
Call this method when the game enters a feature, such as free spins.
typescript
static featuredStarted(): voidfeaturedFinished
Call this method when the game finishes a feature, such as free spins.
typescript
static featuredFinished(): voidfreeplaysAwarded
Call this method when the game enters freeplays.
typescript
static freeplaysAwarded(awarded: number, stake: number): voidParameters:
awarded: The number of freeplays awarded.stake: The stake of the freeplays in minor units.
freeplaysSummary
Call this method when freeplays end.
typescript
static freeplaysSummary(used: number, stake: number, totalWin: number): voidParameters:
used: The number of freeplays used.stake: The stake of the freeplays in minor units.totalWin: The total win of the freeplays in minor units.
getPromoInfo
Call this method while the game is in freeplays.
typescript
static getPromoInfo(): voidsetPromoInfo
Call this method when the response contains response.ticketInfo.promotions.data.
typescript
static setPromoInfo(promoInfo: string): voidParameters:
promoInfo: The promo info passed by the game engine.
registerOption
You can call this method to tell the operator that the commonUI can display specific game options.
typescript
static registerOption(option: RegisterOption): voidParameters:
option: The game option to register.
realityCheck
Call this method to display the reality check dialog.
typescript
static realityCheck(elapsedMS: number, intervalMS: number, exitURL: string, historyURL: string): voidParameters:
elapsedMS: The elapsed time in milliseconds.intervalMS: The interval between reality checks in milliseconds.exitURL: The URL to redirect to when the player exits the game.historyURL: The URL to redirect to when the player wants to see their history.
sendRealityCheckResponse
Call this method when the player responds to the reality check dialog.
typescript
static sendRealityCheckResponse(backendURL: string, token: string, continued: boolean): Promise<GameAPIReply | ErrorResponse>Parameters:
backendURL: The backend URL received in the login call.token: The token received in the last successful call.continued: Whether the player chose to continue.
Returns:
- A promise that resolves to a
GameAPIReplyobject on success, or anErrorResponseon failure.
Audio & Turbo
muted
Call this method to tell the operator that the sound is now muted.
typescript
static muted(): voidunmuted
Call this method to tell the operator that the sound is now unmuted.
typescript
static unmuted(): voidsupport
Call this method when the user requests support.
typescript
static support(): voidturboEnabled
Call this method to tell the operator that turbo is now enabled.
typescript
static turboEnabled(): voidturboDisabled
Call this method to tell the operator that turbo is now disabled.
typescript
static turboDisabled(): voidOther
error
Call this method when the game shows an error.
typescript
static error(category: ErrorCategory, severity: ErrorSeverity, message: string, code?: string): voidParameters:
category: The error category.severity: The severity of the error.message: The message to display.code: (Optional, except required for Light and Wonder (LNW).)
orientationUpdated
Call this method when the orientation changes.
typescript
static orientationUpdated(): voidpassThroughMessage
Call this method with each message that the frontend receives.
typescript
static passThroughMessage(message: string): voidParameters:
message: The message to forward to the operator.
playerActivity
Call this method when the player performs an action in the game. This allows the lobby to control session inactivity requirements for specific jurisdictions.
Examples of actions that trigger this method:
- Clicking the spin button
- Changing the bet/stake amount
- Interacting with game menus or settings
- Clicking collect/gamble buttons
- Any touch or click input during gameplay
typescript
static playerActivity(): void