import { ViewContainerRef, ComponentRef, Injector } from '@angular/core'; export interface ComponentType { new (...args: any[]): T; } /** * A `ComponentPortal` is a portal that instantiates some Component upon attachment. */ export declare class ComponentPortal { component: ComponentType; injector: Injector; private _attachedHost; /** * [Optional] Where the attached component should live in Angular's *logical* component tree. * This is different from where the component *renders*, which is determined by the PortalHost. * The origin necessary when the host is outside of the Angular application context. */ viewContainerRef: ViewContainerRef; constructor(component: ComponentType, injector: Injector); /** Attach this portal to a host. */ attach(host: BasePortalHost, newestOnTop: boolean): any; /** Detach this portal from its host */ detach(): void; /** Whether this portal is attached to a host. */ readonly isAttached: boolean; /** * Sets the PortalHost reference without performing `attach()`. This is used directly by * the PortalHost when it is performing an `attach()` or `detach()`. */ setAttachedHost(host: BasePortalHost): any; } /** * Partial implementation of PortalHost that only deals with attaching a * ComponentPortal */ export declare abstract class BasePortalHost { setToNullValue: any; /** The portal currently attached to the host. */ private _attachedPortal; /** A function that will permanently dispose this host. */ private _disposeFn; attach(portal: ComponentPortal, newestOnTop: boolean): ComponentRef; abstract attachComponentPortal(portal: ComponentPortal, newestOnTop: boolean): ComponentRef; detach(): void; setDisposeFn(fn: () => void): void; }