Skip to content

Usage

Basic Setup

typescript
// Import statements
import { 
  ErrorCategory, 
  ErrorSeverity, 
  IncomingEvent, 
  OperatorInterface, 
  OpratorProtocol, 
  RegisterOption 
} from '@hoelle/operator-interface';

// Enable logging
OperatorInterface.log = true;

// Initialize OperatorInterface
const operatorProtocol = await OperatorInterface.setup(
  operatorProtocol, 
  gameCode, 
  currency, 
  language, 
  playerID, 
  walletMode, 
  lobbyURL, 
  isMobile
);

Event Handling

Listening for Events

typescript
// Listen for an incoming mute event and mute the game
OperatorInterface.on('muteRequested', this.mute.bind(this));

Broadcasting Events

typescript
// Broadcast an outgoing event
OperatorInterface.spinAnimationStarted();