// export const runtime: Window = new Proxy(_runtime, {
//   get: (_, prop) => {
//     if (typeof _runtime[prop] === 'function') {
//       return _runtime[prop].bind(_runtime);
//     }
//     return _runtime[prop];
//   },
// });

import { IAppAPI, IPageAPI } from '../../app/global-api';
import * as Mobx from 'mobx';
import * as React from 'react';
declare global {
  interface Window {
    mobx?: typeof Mobx;
    app?: IAppAPI;
    $app?: IAppAPI;
    $page?: IPageAPI;
    $w?: any;
    WedaAppContext: React.Context<{}>;
    WedaClientSDK: any;
    $$global?: any;
    _aegis?: any;
    _aegis_inited?: number; // timesnap
  }
}

export let runtime = window;

export function registerRuntime(_runtime = window) {
  runtime = _runtime;
}
