ngx-mfe
Version:
A library for working with MFE in Angular in a plugin-based approach and with Angular routing.
24 lines (23 loc) • 856 B
TypeScript
import { LoadRemoteModuleOptions } from '@angular-architects/module-federation';
import { Type } from '@angular/core';
/**
* Options for ```loadMfe``` function.
*/
export type LoadMfeOptions = {
/**
* Set custom exposed module name, by default module name = exposedItem + 'Module'.
*/
moduleName?: string;
/**
* Type of loaded module as a ```script``` or as a ```module```.
*/
type?: LoadRemoteModuleOptions['type'];
};
/**
* Loads remote bundle.
*
* @param remoteApp The name of the micro-frontend app decalred in ModuleFederationPlugin.
* @param exposedModule The key of the exposed module decalred in ModuleFederationPlugin.
* @param options (Optional) object of options.
*/
export declare function loadMfe<T = unknown>(remoteApp: string, exposedModule: string, options?: LoadMfeOptions): Promise<Type<T>>;