export * from "@softarc/native-federation/domain"; import { type NativeFederationResult } from "@softarc/native-federation-orchestrator"; import { type NFOptions } 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 type NgOrchestratorOptions = { /** * @deprecated Use `hostRemoteEntry` instead and pass the cache tag there: * ```ts * hostRemoteEntry: { url: "./remoteEntry.json", cacheTag: "your-cache-tag" } * ``` */ cacheTag?: string; /** * Use es-module-shims shim mode (default `true`). Set `false` for native * import maps; the build option `esmsInitOptions: { shimMode: false }` must * match. See #70 for when native mode is needed (e.g. DevExtreme). */ shimMode?: boolean; }; export type NgNFOptions = NgOrchestratorOptions & NFOptions; export declare function initFederation(remotesOrManifestUrl?: Record | string, options?: NgNFOptions): 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