export * from '@softarc/native-federation/domain'; import { type NativeFederationResult } from '@softarc/native-federation-orchestrator'; import { type LogType } from '@softarc/native-federation-orchestrator/options'; export type Imports = Record; export type Scopes = Record; export type ImportMap = { imports: Imports; scopes: Scopes; }; /** * Options for {@link loadRemoteModule}. Mirrors the shape in * `@softarc/native-federation-runtime`. * * @property remoteEntry - URL to the remote's `remoteEntry.json`. Enables * lazy-loading remotes not registered during `initFederation`. * @property remoteName - Name of the remote. If omitted, derived from * `remoteEntry` (its manifest's `name`). * @property exposedModule - Key exposed by the remote (e.g. `'./Component'`). * @property fallback - Value returned on failure. Truthy-only — `null`/`0`/`''` * count as "no fallback". */ export type LoadRemoteModuleOptions = { remoteEntry?: string; remoteName?: string; exposedModule: string; fallback?: T; }; export interface InitFederationOptions { cacheTag?: string; logging?: LogType; } export declare function initFederation(remotesOrManifestUrl?: Record | string, options?: InitFederationOptions): Promise; /** * Dynamically loads a remote module. Spec-compatible with `loadRemoteModule` * from `@softarc/native-federation-runtime`; bridges to the orchestrator * (`@softarc/native-federation-orchestrator`) under the hood. * * ```ts * await loadRemoteModule({ remoteName: 'mfe1', exposedModule: './Component' }); * await loadRemoteModule('mfe1', './Component'); * ``` * * Flow: normalize args → await `federationPromise` (may be called before * `initFederation`, then waits) → if only `remoteEntry` was given, fetch its * manifest for the name → if `remoteEntry` set, `initRemoteEntry(...)` first → * delegate to the orchestrator's `loadRemoteModule(remoteName, exposedModule)`. * On error, return truthy `fallback` (logging `console.error` in browsers) or * rethrow. * * @throws on bad arg combos, unresolvable `remoteName`, or load failure when * no truthy `fallback` is set. * * @deprecated Prefer the `loadRemoteModule` returned by the `initFederation` * promise. This top-level helper relies on a module-scoped federation * instance and only resolves against the most recent `initFederation` call, * which is brittle in tests and multi-host setups. Example: * ```ts * const { loadRemoteModule } = await initFederation(...); * await loadRemoteModule('mfe1', './Component'); * ``` */ export declare function loadRemoteModule(options: LoadRemoteModuleOptions): Promise; export declare function loadRemoteModule(remoteName: string, exposedModule: string): Promise; export { type NativeFederationResult } from '@softarc/native-federation-orchestrator'; //# sourceMappingURL=index.d.ts.map