import { NgModuleRef } from "@angular/core"; import { Router } from "@angular/router"; import { Observable } from "rxjs"; import { StarComponentRef } from "../component/star-component-ref"; import { StarComponentConfig } from "../component/star-component.config"; import { StarPortalApplication } from "../portal/portal-application"; export interface BootstrapOptions { template: string; bootstrap: BootstrapAppModule; } export declare type BootstrapAppModule = (portalApp?: StarPortalApplication) => Promise>; export declare type StarComponentFactory = (componentName: string, config: StarComponentConfig) => StarComponentRef; export declare class StarApplicationRef { appModuleRef: NgModuleRef; template: string; private innerSelector; private name; private portalApp; private appModuleBootstrap; private componentFactory; readonly selector: string; readonly bootstrapped: boolean; constructor(name: string, options: BootstrapOptions); /** * 同步路由 */ private syncPortalRouteWhenNavigationEnd; /** * 引导启动 * @param app portal应用 */ bootstrap(app: StarPortalApplication): Observable; /** * 获取模块路由 */ getRouter(): Router; /** * 获取当前路由状态url */ getCurrentRouterStateUrl(): string; /** * 通过url跳转 * @param url url */ navigateByUrl(url: string): void; /** * 获取组件工厂 */ getComponentFactory(): StarComponentFactory; /** * 注册组件工厂 * @param componentFactory 组件工厂 */ registerComponentFactory(componentFactory: StarComponentFactory): void; /** * 销毁 */ destroy(): void; }