42 lines
999 B
TypeScript
42 lines
999 B
TypeScript
// 入口文件:仅聚合与导出 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;
|