import { ComponentRef, Injector, ViewContainerRef } 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 { private _attachedHost?; /** The type of the component that will be instantiated for attachment. */ component: ComponentType; /** * [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; /** Injector used for the instantiation of the component. */ injector: Injector; constructor(component: ComponentType, injector: Injector); /** Attach this portal to a host. */ attach(host: BasePortalHost, newestOnTop: boolean): ComponentRef; /** Detach this portal from its host */ detach(): void; /** Whether this portal is attached to a host. */ get 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): void; } /** * Partial implementation of PortalHost that only deals with attaching a * ComponentPortal */ export declare abstract class BasePortalHost { /** 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; }