wujie.d.ts 648 Bytes
/**
 * wujie 注入到子应用 iframe 的全局对象。
 * 只有 `window.$wujie`(= sandbox.provide)存在 props 与 bus;
 * 历史上误写的 __WUJIE_PROPS__ 从未被赋值过。
 */
export {};

declare global {
  interface WujieBus {
    $on: (event: string, handler: (...args: unknown[]) => void) => void;
    $off: (event: string, handler: (...args: unknown[]) => void) => void;
    $emit: (event: string, ...args: unknown[]) => void;
  }

  interface Window {
    $wujie?: { bus: WujieBus; props?: Record<string, unknown> };
    __POWERED_BY_WUJIE__?: boolean;
    __WUJIE_MOUNT?: () => void;
    __WUJIE_UNMOUNT?: () => void;
  }
}