declare type Docs = {
  [key: string]: unknown;
};

type Megabit = number;
type Millisecond = number;
type EffectiveConnectionType = "2g" | "3g" | "4g" | "5g" | "slow-2g";
type ConnectionType =
  | "bluetooth"
  | "cellular"
  | "ethernet"
  | "mixed"
  | "none"
  | "other"
  | "unknown"
  | "wifi"
  | "wimax";
interface NetworkInformation extends EventTarget {
  readonly type?: ConnectionType;
  readonly effectiveType?: EffectiveConnectionType;
  readonly downlinkMax?: Megabit;
  readonly downlink?: Megabit;
  readonly rtt?: Millisecond;
  readonly saveData?: boolean;
  onchange?: EventListener;
}
declare interface Window {
  readonly PalfishBridgeAndroid?: Docs;
  readonly webkit?: {
    readonly messageHandlers?: {
      readonly PalfishBridgeIOS: Docs;
    };
  };
  readonly mozRequestAnimationFrame: typeof requestAnimationFrame;
  readonly webkitRequestAnimationFrame: typeof requestAnimationFrame;
  readonly msRequestAnimationFrame: typeof requestAnimationFrame;

  readonly SENTRY_RELEASE?: { id: string };

  /**
   * iOS微信6.5.3及其之后的版本 window.__wxjs_is_wkwebview 为true时是使用WKWebview，为 false或者 “undefine”时是 UIWebview
   */
  readonly __wxjs_is_wkwebview?: boolean | undefined;
  wx: WX;
  WeixinJSBridge: {
    invoke: (name: string, config: Docs, callback?: AnyNoop) => void;
    on: (eventName: string, callback: AnyNoop) => void;
    call: (name: string) => void;
  };
}

declare interface Navigator {
  readonly connection?: NetworkInformation;
}

declare type Noop = () => void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare type AnyNoop = (...args: any[]) => any;

declare interface Document {
  attachEvent: (eventName: string, callback: AnyNoop) => void;
}

declare const ROUTES = [];
