2025-11-14 20:07:08 +08:00
|
|
|
|
// 入口文件:仅聚合与导出 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';
|
|
|
|
|
|
|
2025-11-10 16:11:21 +08:00
|
|
|
|
/**
|
2025-11-14 20:07:08 +08:00
|
|
|
|
* 默认聚合导出对象:包含全部对外 API。
|
2025-11-10 16:11:21 +08:00
|
|
|
|
*/
|
|
|
|
|
|
const bridge = {
|
|
|
|
|
|
isEmbedded,
|
|
|
|
|
|
toHostPath,
|
|
|
|
|
|
toChildPath,
|
|
|
|
|
|
getClientHostApi,
|
|
|
|
|
|
clientNavigate,
|
|
|
|
|
|
clientClose,
|
|
|
|
|
|
clientReady,
|
|
|
|
|
|
createPenpalHostBridge,
|
2025-11-14 20:07:08 +08:00
|
|
|
|
initChildBridge,
|
2025-11-10 16:11:21 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default bridge;
|