import * as React from 'react';
import * as ReactDOM from 'react-dom';
import * as antd from 'antd';

declare global {
  interface Window {
    React: typeof React;
    ReactDOM: typeof ReactDOM;
    antd: typeof antd;
  }
}

export function ensureOneosWebLegacyGlobals(): void {
  if (typeof window === 'undefined') return;
  window.React = React;
  window.ReactDOM = ReactDOM;
  window.antd = antd;
}

// Legacy jsx 可能在模块顶层使用 React.createElement，须在页面 import 之前完成注入。
ensureOneosWebLegacyGlobals();
