-
-
Notifications
You must be signed in to change notification settings - Fork 392
Expand file tree
/
Copy pathhelpers.ts
More file actions
42 lines (34 loc) · 1003 Bytes
/
helpers.ts
File metadata and controls
42 lines (34 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import {
helpers,
type IGlobalUtils,
type IShareUtils,
} from '@module-federation/runtime-core';
import { getGlobalFederationInstance } from './utils';
export type {
IGlobalUtils,
IShareUtils,
} from '@module-federation/runtime-core';
type RuntimeGlobalUtils = IGlobalUtils & {
getGlobalFederationInstance: typeof getGlobalFederationInstance;
};
export const global: RuntimeGlobalUtils = {
...helpers.global,
getGlobalFederationInstance,
};
export const share: IShareUtils = helpers.share;
export interface IRuntimeUtils {
matchRemoteWithNameAndExpose: typeof import('@module-federation/runtime-core').matchRemoteWithNameAndExpose;
preloadAssets: (...args: any[]) => void;
getRemoteInfo: typeof import('@module-federation/runtime-core').getRemoteInfo;
}
export const utils: IRuntimeUtils = helpers.utils;
const runtimeHelpers: {
global: RuntimeGlobalUtils;
share: IShareUtils;
utils: IRuntimeUtils;
} = {
global,
share,
utils,
};
export default runtimeHelpers;