import { ComponentFactoryResolver, Type, Renderer2, NgZone } from '@angular/core'; import { Observable } from 'rxjs'; import { SimpleModalOptions, SimpleModalOptionsOverrides } from './simple-modal-options'; import { SimpleModalComponent } from './simple-modal.component'; /** * View container manager which manages a list of modals currently active * inside the viewvontainer */ export declare class SimpleModalHolderComponent { private resolver; private renderer; private ngZone; private defaultSimpleModalOptions; /** * Target viewContainer to insert modals */ viewContainer: any; /** * modal collection, maintained by addModal and removeModal * @type {Array } */ modals: Array>; /** * if auto focus is on and no element focused, store it here to be restored back after close */ previousActiveElement: any; /** * Constructor * @param {ComponentFactoryResolver} resolver * @param renderer * @param ngZone * @param defaultSimpleModalOptions */ constructor(resolver: ComponentFactoryResolver, renderer: Renderer2, ngZone: NgZone, defaultSimpleModalOptions: SimpleModalOptions); /** * Configures then adds modal to the modals array, and populates with data passed in * @param {Type} component * @param {object?} data * @param {SimpleModalOptionsOverrides?} options * @return {Observable<*>} */ addModal(component: Type>, data?: T, options?: SimpleModalOptionsOverrides): Observable; /** * triggers components close function * to take effect * @returns {Promise} * @param closingModal */ removeModal(closingModal: SimpleModalComponent): Promise; /** * Instructs all open modals to */ removeAllModals(): Promise; /** * Bind a body class 'modal-open' to a condition of modals in pool > 0 * @param bodyClass - string to add and remove from body in document */ private toggleBodyClass; /** * if the option to close on background click is set, then hook up a callback * @param modalWrapper */ private configureCloseOnClickOutside; /** * Auto focus o the first element if autofocus is on * @param componentWrapper * @param autoFocus */ private autoFocusFirstElement; /** * Restores the last focus is there was one */ private restorePreviousFocus; /** * Configure the adding and removal of a wrapper class - predominantly animation focused * @param modalWrapperEl * @param wrapperClass */ private toggleWrapperClass; /** * Enables the drag option on the modal if the options have it enabled * @param component * @param options * @private */ private setDraggable; /** * Helper function for a more readable timeout * @param ms */ private wait; /** * Instructs the holder to remove the modal and * removes this component from the collection * @param {SimpleModalComponent} component */ private removeModalFromArray; }