// 入口文件：仅聚合与导出 API，不承载具体逻辑
export type { HostApi, ChildApi } from './types.js';
export { isEmbedded, toHostPath, toChildPath } from './path.js';
export {
  getClientHostApi,
  clientNavigate,
  clientClose,
  clientReady,
  initChildBridge,
} from './client.js';
export { createPenpalHostBridge } from './host.js';

// 默认导出一个聚合对象：
// - 兼容某些只识别 default 的打包方案或联邦场景
// - 同时保留命名导出，建议优先使用命名导出
import { isEmbedded, toHostPath, toChildPath } from './path.js';
import {
  getClientHostApi,
  clientNavigate,
  clientClose,
  clientReady,
  initChildBridge,
} from './client.js';
import { createPenpalHostBridge } from './host.js';

/**
 * 默认聚合导出对象：包含全部对外 API。
 */
const bridge = {
  isEmbedded,
  toHostPath,
  toChildPath,
  getClientHostApi,
  clientNavigate,
  clientClose,
  clientReady,
  createPenpalHostBridge,
  initChildBridge,
};

export default bridge;
