You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

102 lines
4.8 KiB

/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { ComponentFactoryResolver, ComponentRef, EmbeddedViewRef, EventEmitter, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
import { BasePortalOutlet, ComponentPortal, Portal, TemplatePortal, DomPortal } from './portal';
/**
* Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal,
* the directive instance itself can be attached to a host, enabling declarative use of portals.
*/
import * as ɵngcc0 from '@angular/core';
export declare class CdkPortal extends TemplatePortal {
constructor(templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef);
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<CdkPortal, never>;
static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<CdkPortal, "[cdkPortal]", ["cdkPortal"], {}, {}, never>;
}
/**
* @deprecated Use `CdkPortal` instead.
* @breaking-change 9.0.0
*/
export declare class TemplatePortalDirective extends CdkPortal {
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<TemplatePortalDirective, never>;
static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<TemplatePortalDirective, "[cdk-portal], [portal]", ["cdkPortal"], {}, {}, never>;
}
/**
* Possible attached references to the CdkPortalOutlet.
*/
export declare type CdkPortalOutletAttachedRef = ComponentRef<any> | EmbeddedViewRef<any> | null;
/**
* Directive version of a PortalOutlet. Because the directive *is* a PortalOutlet, portals can be
* directly attached to it, enabling declarative use.
*
* Usage:
* `<ng-template [cdkPortalOutlet]="greeting"></ng-template>`
*/
export declare class CdkPortalOutlet extends BasePortalOutlet implements OnInit, OnDestroy {
private _componentFactoryResolver;
private _viewContainerRef;
private _document;
/** Whether the portal component is initialized. */
private _isInitialized;
/** Reference to the currently-attached component/view ref. */
private _attachedRef;
constructor(_componentFactoryResolver: ComponentFactoryResolver, _viewContainerRef: ViewContainerRef,
/**
* @deprecated `_document` parameter to be made required.
* @breaking-change 9.0.0
*/
_document?: any);
/** Portal associated with the Portal outlet. */
get portal(): Portal<any> | null;
set portal(portal: Portal<any> | null);
/** Emits when a portal is attached to the outlet. */
readonly attached: EventEmitter<CdkPortalOutletAttachedRef>;
/** Component or view reference that is attached to the portal. */
get attachedRef(): CdkPortalOutletAttachedRef;
ngOnInit(): void;
ngOnDestroy(): void;
/**
* Attach the given ComponentPortal to this PortalOutlet using the ComponentFactoryResolver.
*
* @param portal Portal to be attached to the portal outlet.
* @returns Reference to the created component.
*/
attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
/**
* Attach the given TemplatePortal to this PortalHost as an embedded View.
* @param portal Portal to be attached.
* @returns Reference to the created embedded view.
*/
attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
/**
* Attaches the given DomPortal to this PortalHost by moving all of the portal content into it.
* @param portal Portal to be attached.
* @deprecated To be turned into a method.
* @breaking-change 10.0.0
*/
attachDomPortal: (portal: DomPortal) => void;
/** Gets the root node of the portal outlet. */
private _getRootNode;
static ngAcceptInputType_portal: Portal<any> | null | undefined | '';
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<CdkPortalOutlet, never>;
static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<CdkPortalOutlet, "[cdkPortalOutlet]", ["cdkPortalOutlet"], { "portal": "cdkPortalOutlet"; }, { "attached": "attached"; }, never>;
}
/**
* @deprecated Use `CdkPortalOutlet` instead.
* @breaking-change 9.0.0
*/
export declare class PortalHostDirective extends CdkPortalOutlet {
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<PortalHostDirective, never>;
static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<PortalHostDirective, "[cdkPortalHost], [portalHost]", ["cdkPortalHost"], { "portal": "cdkPortalHost"; }, {}, never>;
}
export declare class PortalModule {
static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<PortalModule, never>;
static ɵmod: ɵngcc0.ɵɵNgModuleDeclaration<PortalModule, [typeof CdkPortal, typeof CdkPortalOutlet, typeof TemplatePortalDirective, typeof PortalHostDirective], never, [typeof CdkPortal, typeof CdkPortalOutlet, typeof TemplatePortalDirective, typeof PortalHostDirective]>;
static ɵinj: ɵngcc0.ɵɵInjectorDeclaration<PortalModule>;
}
//# sourceMappingURL=portal-directives.d.ts.map