import * as i0 from '@angular/core'; import { TemplateRef, ViewContainerRef, ComponentRef, EmbeddedViewRef, Injector, StaticProvider, ElementRef } from '@angular/core'; import { ComponentType, TemplatePortal, ComponentPortal } from '@angular/cdk/portal'; import { ConnectedPosition, OverlayConfig, OverlayRef, Overlay, PositionStrategy } from '@angular/cdk/overlay'; import { XPlace, XPlacement, XPosition } from '@ng-nest/ui/core'; declare class XPortalModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } /** * Portal * @selector x-portal * @decorator component */ declare const XPortalPrefix = "x-portal"; declare const XPortalResizablePrefix = "x-portal-resizable"; declare const XPortalPlacement: { [proptery: string]: ConnectedPosition; }; declare const XPortalConnectedPosition: Map; /** * Portal Property */ interface XPortalProperty { /** * @zh_CN 内容,模板/组件 * @en_US Content, template/component */ content?: TemplateRef | ComponentType; /** * @zh_CN 视图容器 * @en_US View container */ viewContainerRef?: ViewContainerRef; /** * @zh_CN 上下文 * @en_US Context */ context?: any; /** * @zh_CN 注入器 * @en_US Injector */ injector?: any; /** * @zh_CN 覆盖视图层配置 * @en_US Overlay view layer configuration */ overlayConfig?: OverlayConfig; } interface XPortalOverlayRef { /** * @zh_CN cdk 创建的覆盖视图层 * @en_US Overlay view layer created by cdk */ overlayRef?: OverlayRef; /** * @zh_CN cdk 模板视图 * @en_US Cdk template view */ templatePortal?: TemplatePortal; /** * @zh_CN cdk 组件视图 * @en_US Cdk component view */ componentPortal?: ComponentPortal; /** * @zh_CN 组件视图 * @en_US Component view */ componentRef?: ComponentRef; /** * @zh_CN 模板视图 * @en_US Template view */ embeddedViewRef?: EmbeddedViewRef; } /** * 动态创建视图服务 */ declare class XPortalService { overlay: Overlay; injector: Injector; private rendererFactory; renderer: i0.Renderer2; attach(option: XPortalProperty): XPortalOverlayRef; createInjector(providers: StaticProvider[], viewContainerRef?: ViewContainerRef): i0.DestroyableInjector; setPlacement(param?: { elementRef?: ElementRef; placement?: XPlace[] | XPlacement[]; transformOriginOn?: string; }): PositionStrategy; setPosition(position?: XPosition, width?: string, height?: string): PositionStrategy; setPlace(place?: XPlace, ...offset: string[]): PositionStrategy; setResizable(ele: HTMLElement, place?: XPlace): { marginLeft: string; marginTop: string; marginBottom: string; marginRight: string; }; setContainerStyle(place?: XPlace, ...offset: string[]): { top: string; left: string; right?: undefined; bottom?: undefined; } | { top: string; left?: undefined; right?: undefined; bottom?: undefined; } | { top: string; right: string; left?: undefined; bottom?: undefined; } | { left: string; top?: undefined; right?: undefined; bottom?: undefined; } | { top?: undefined; left?: undefined; right?: undefined; bottom?: undefined; } | { right: string; top?: undefined; left?: undefined; bottom?: undefined; } | { bottom: string; left: string; top?: undefined; right?: undefined; } | { bottom: string; top?: undefined; left?: undefined; right?: undefined; } | { bottom: string; right: string; top?: undefined; left?: undefined; }; getOffset(offset: string[]): string[]; createOverlayRef(option: XPortalProperty): OverlayRef; setConnectedPosition(...placement: XPlace[] | XPlacement[]): ConnectedPosition[]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { XPortalConnectedPosition, XPortalModule, XPortalPlacement, XPortalPrefix, XPortalResizablePrefix, XPortalService }; export type { XPortalOverlayRef, XPortalProperty };