export type AdPlatform = "applovin" | "unity" | "playturbo" | "mintegral" | "google";

export interface AdPlatformAdapter {
  readonly platform: AdPlatform;
  init(): void;
  onResourcesLoaded(): void;
  onGameStart(): void;
  onGameEnd(): void;
  openStore(): void;
  shouldUseCustomLoading(): boolean;
  shouldShowAdBadge(): boolean;
}

export interface Mraid {
  getState(): string;
  open(url: string): void;
  useCustomClose(use: boolean): void;
  addEventListener(event: string, cb: () => void): void;
  removeEventListener(event: string, cb: () => void): void;
}

declare global {
  interface Window {
    mraid?: Mraid;
    ExitApi?: { exit: () => void };
    dapi?: {
      gameReady: () => void;
      isReady: () => boolean;
      addEventListener: (event: string, cb: () => void) => void;
    };
    install?: () => void;
    gameReady?: () => void;
    gameEnd?: () => void;
    gameRetry?: () => void;
    gameStart?: () => void;
    gameClose?: () => void;
    HttpAPI?: {
      sendPoint?: (payload: string) => void;
    };
  }
}
