Files
TERES_web_frontend/packages/iframe-bridge/src/index.ts

42 lines
999 B
TypeScript
Raw Normal View History

// 入口文件:仅聚合与导出 API不承载具体逻辑
export type { HostApi, ChildApi } from './types';
export { isEmbedded, toHostPath, toChildPath } from './path';
export {
getClientHostApi,
clientNavigate,
clientClose,
clientReady,
initChildBridge,
} from './client';
export { createPenpalHostBridge } from './host';
// 默认导出一个聚合对象:
// - 兼容某些只识别 default 的打包方案或联邦场景
// - 同时保留命名导出,建议优先使用命名导出
import { isEmbedded, toHostPath, toChildPath } from './path';
import {
getClientHostApi,
clientNavigate,
clientClose,
clientReady,
initChildBridge,
} from './client';
import { createPenpalHostBridge } from './host';
/**
* API
*/
const bridge = {
isEmbedded,
toHostPath,
toChildPath,
getClientHostApi,
clientNavigate,
clientClose,
clientReady,
createPenpalHostBridge,
initChildBridge,
};
export default bridge;