import { ElementRef, OnInit, OnDestroy, AfterViewInit } from '@angular/core'; import { ChangeDetectorRef, ComponentFactoryResolver, Renderer2 } from '@angular/core'; import { Subscription } from 'rxjs'; import { BaseWidgetComponent } from '../../shared/base.component'; export interface IDynamicComponentEvent { id: string; type: string; location: string; data?: { [name: string]: any; }; model?: { [name: string]: any; }; value?: any; update: (model: { [name: string]: any; }) => void; close: () => void; } export declare class DynamicBaseComponent extends BaseWidgetComponent implements OnInit, OnDestroy, AfterViewInit { protected static instance_stack: any; protected static action: any; id: string; model: { [name: string]: any; }; cmp_ref: any; parent: any; container: string; service: any; rendered: boolean; events: any; box: ClientRect; cntr_box: ClientRect; protected static internal_state: any; protected uid: string; protected _cfr: ComponentFactoryResolver; protected _cdr: ChangeDetectorRef; protected renderer: Renderer2; protected state: { [name: string]: any; }; protected stack_id: string; protected type: string; protected body: ElementRef; private _content; constructor(); ngOnInit(): void; init(parent?: any, id?: string): void; ngAfterViewInit(): void; listenState(tries?: number): void; initBox(tries?: number): void; ngOnDestroy(): void; updateState(state: string): void; /** * Prevents close when element is tapped */ tap(): void; readonly top_id: any; /** * Enables/Disabled the auto-removal of this elment when event occurs outside it. * @param enable Enabled? */ canClose(enable?: boolean): void; /** * Posts a close event * @param e Element to compare collisions to prevent close */ close(e?: any): void; /** * Posts an event to the Observable. * @param type Type of event that has occured * @param location Location that the event has come from */ event(type: string | any, location?: string): void; /** * Listen to events on the component * @param next Callback for events on the component */ subscribe(next: (value: any) => void): Subscription; /** * Listen for events on the component * @param next Callback for events on the component */ watch(next: (value: any) => void): Subscription; /** * Event called when the window is resized */ resize(): void; /** * Set model of the component * @param data Dataset */ set(data: { [name: string]: any; }): void; /** * Update the model of the component * @param data Dataset */ protected update(data: { [name: string]: any; }): void; /** * Update content component model * @param data Dataset * @param tries Retry count */ protected updateComponent(data: { [name: string]: any; }, tries?: number): void; /** * Remove this component from it's parent */ protected remove(): void; /** * Resolves the factory, then creates the content component */ protected render(tries?: number): any; }