UNPKG

ngx-mfe

Version:

A library for working with MFE in Angular in a plugin-based approach and with Angular routing.

31 lines (30 loc) 1.57 kB
import { Injector, NgZone, Type } from '@angular/core'; import { LoadMfeOptions } from '../helpers'; import { RemoteComponentWithModule, StandaloneRemoteComponent } from '../interfaces'; import { ComponentWithNgModuleRef } from '../types'; import { RemoteComponentsCache } from './remote-components-cache'; import * as i0 from "@angular/core"; /** * A low-level service for loading a remote micro-frontend component. */ export declare class RemoteComponentLoader { private readonly _ngZone; private readonly _injector; private readonly _cache; constructor(_ngZone: NgZone, _injector: Injector, _cache: RemoteComponentsCache); /** * Loads a remote component with module where was declared this component. * @param remoteComponent Remote component. * @param injector (Optional) Injector, use root injector by default. * @param options (Optional) object of options. */ loadComponentWithModule<TComponent = unknown, TModule = unknown>(remoteComponent: RemoteComponentWithModule, injector?: Injector, options?: LoadMfeOptions): Promise<ComponentWithNgModuleRef<TComponent, TModule>>; /** * Loads a standalone remote component. * @param remoteComponent Remote component * @param options (Optional) object of options. */ loadStandaloneComponent<C = unknown>(remoteComponent: StandaloneRemoteComponent, options?: LoadMfeOptions): Promise<Type<C>>; static ɵfac: i0.ɵɵFactoryDeclaration<RemoteComponentLoader, never>; static ɵprov: i0.ɵɵInjectableDeclaration<RemoteComponentLoader>; }