import { ApplicationRef, ComponentFactoryResolver, ComponentRef, Injector, RendererFactory2, Type, ViewContainerRef, ElementRef } from '@angular/core'; export interface BaseComponent { el: ElementRef; } export interface DynamicComponentConfig { viewContainer?: ViewContainerRef; positionInBody?: 'before' | 'after'; } /** * @description This service uses for dynamic create components * @description for create component call createComponent method and send component * @description by default this method append your component to body * @description If you wanna insert as sibling, pass viewContainer in config(second argument) * @description Also you can create component in child, use method createChildComponent * @description And do not forget delete component, when you leave your component * @example const ref = gasDynamicComponentsService.createComponent(TestComponent); * @deprecated use `import { GasDynamicComponentsService } from '@gas/utils/services'` instead */ export declare class GasDynamicComponentsService { protected resolver: ComponentFactoryResolver; private document; protected appRef: ApplicationRef; protected injector: Injector; protected rendererFactory: RendererFactory2; private renderer; constructor(resolver: ComponentFactoryResolver, document: any, appRef: ApplicationRef, injector: Injector, rendererFactory: RendererFactory2); /** * @description Created dynamically component * Just send component and config, you can pass viewContainer to config for add component to current place */ createComponent(component: Type, config?: DynamicComponentConfig): ComponentRef; /** * @description Created dynamically component and pass it as child * Just send component and config, you can pass viewContainer to config for add component to current place */ createChildComponent(component: Type, viewContainer: ViewContainerRef): ComponentRef; /** * @description Удаляем компонент из дома и отписываемся от изменений */ deleteComponent(componentRef: ComponentRef, viewContainerRef?: ViewContainerRef): void; /** Отписываемся от компонента, комплитим */ private unsubscribeFromComponent; private isEventEmitterType; }