@taiga-ui/cdk
Version:
Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance
25 lines (24 loc) • 1.31 kB
TypeScript
import { type Provider, type Type } from '@angular/core';
import { type TuiContext } from '@taiga-ui/cdk/types';
import { PolymorpheusComponent, type PolymorpheusContent } from '@taiga-ui/polymorpheus';
import { Observable, type Observer } from 'rxjs';
import { type TuiPortalService } from './service';
import * as i0 from "@angular/core";
export type TuiPortalContext<T, O = void> = T & TuiContext<Observer<O>> & {
readonly content: PolymorpheusContent<TuiPortalContext<T, O>>;
readonly createdAt: number;
readonly id: string;
completeWith(value: O): void;
};
export declare abstract class TuiPortal<T, K = void> {
protected readonly service: TuiPortalService;
protected abstract readonly component: Type<any>;
protected abstract readonly options: T;
private readonly injector;
constructor(service: TuiPortalService);
open<G = void>(content: PolymorpheusContent<TuiPortalContext<T, K extends void ? G : K>>, options?: Partial<T>): Observable<K extends void ? G : K>;
protected add(component: PolymorpheusComponent<unknown>): () => void;
static ɵfac: i0.ɵɵFactoryDeclaration<TuiPortal<any, any>, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<TuiPortal<any, any>>;
}
export declare function tuiAsPortal(portal: typeof TuiPortal<any>): Provider;