@taiga-ui/cdk
Version:
Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance
34 lines (33 loc) • 1.54 kB
TypeScript
import type { ComponentRef, EmbeddedViewRef, Provider, TemplateRef, ViewRef } from '@angular/core';
import type { PolymorpheusComponent } from '@taiga-ui/polymorpheus';
import * as i0 from "@angular/core";
/**
* Abstract class for host element for dynamically created portals.
*/
export declare abstract class TuiPortals {
private readonly vcr;
private readonly injector;
protected readonly nothing: void;
addComponentChild<C>(component: PolymorpheusComponent<C>): ComponentRef<C>;
addTemplateChild<C>(templateRef: TemplateRef<C>, context?: C): EmbeddedViewRef<C>;
static ɵfac: i0.ɵɵFactoryDeclaration<TuiPortals, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<TuiPortals, never, never, {}, {}, never, never, false, never>;
}
/**
* Abstract service for displaying portals
*/
export declare abstract class TuiPortalService {
protected host?: TuiPortals;
attach(host: TuiPortals): void;
add<C>(component: PolymorpheusComponent<C>): ComponentRef<C>;
remove<C>({ hostView }: ComponentRef<C>): void;
addTemplate<C>(templateRef: TemplateRef<C>, context?: C): EmbeddedViewRef<C>;
removeTemplate<C>(viewRef: EmbeddedViewRef<C> | ViewRef): void;
protected get safeHost(): TuiPortals;
static ɵfac: i0.ɵɵFactoryDeclaration<TuiPortalService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<TuiPortalService>;
}
export declare function tuiAsPortal(portal: typeof TuiPortalService): Provider;
export declare class TuiNoHostException extends Error {
constructor();
}