game-sdk.d.ts 393 B

1234567891011121314151617181920
  1. interface GameSDKResult {
  2. ok: true
  3. rank: number
  4. }
  5. interface GameSDKError {
  6. ok: false
  7. error: string
  8. }
  9. interface IGameSDK {
  10. /** This game's id string */
  11. gameId: string
  12. /** Current player's display name */
  13. getPlayerName(): string
  14. /** Submit a score. Returns rank on success. */
  15. submit(score: number): Promise<GameSDKResult | GameSDKError>
  16. }
  17. declare const GameSDK: IGameSDK