import { ApplicationRef, NgModuleRef, NgZone } from '@angular/core'; import { ComponentType } from '@angular/cdk/portal'; import { Observable } from 'rxjs'; import { StarComponentRef } from './star-component-ref'; import { StarComponentConfig } from './star-component.config'; export interface StarComponent { name: string; component: ComponentType; } export declare class StarComponentLoader { private applicationRef; private ngModuleRef; private ngZone; private document; private domPortalOutletCache; private readonly applicationLoader; private readonly applicationService; private readonly componentService; constructor(applicationRef: ApplicationRef, ngModuleRef: NgModuleRef, ngZone: NgZone, document: any); /** * 根据应用名称获取应用的引用 * @param name 应用名称 */ private getStarAppRef; /** * 创建注入器 * @param appModuleRef 模块引用 * @param componentRef 组件引用 */ private createInjector; /** * 获取容器节点 * @param config 参数 */ private getContainerElement; /** * 节点包装 * @param config 参数 */ private createWrapperElement; /** * 创造组件 * @param starComponent 需要被创造的组件 * @param appModuleRef 应用模块的引用 * @param config 设置 */ private attachComponent; /** * 注册组件工厂 * @param componentOrComponents 需要注册的组件 */ private registerComponentFactory; /** * 注册 * @param components 组件 */ register(components: StarComponent | StarComponent[]): void; /** * 加载组件 * @param app 应用 * @param componentName 组件名 * @param config 配置类 */ load(app: string, componentName: string, config: StarComponentConfig): Observable>; }