import { ComponentRef, Type, ViewContainerRef } from '@angular/core'; import { List } from '../../collections'; import { IComponentResolverService, IModalService } from '../interfaces'; import { ModalActionType } from '../enums'; import { ModalButtonList } from '../models'; export declare class ModalService implements IModalService { private _componentResolverService; buttons: ModalButtonList; visible: boolean; wrapper: ViewContainerRef; overlayIsBlocking: boolean; modalComponent: ComponentRef; closeCallbacks: List; completeCallbacks: List; additionalClasses: string; constructor(_componentResolverService: IComponentResolverService); /** * Returns the current modal component, which is the component that is rendered * within the modal wrapper. * @return {ComponentRef} The component to render inside the modal */ getModalComponent(): ComponentRef; /** * Returns whether there is currently a modal component specified * @return {boolean} True if the child modal component exists, otherwise false */ hasModalComponent(): boolean; /** * Sets whether the overlay is blocking (blocking = clicking overlay does *not* close * the modal). * @param {boolean} overlayBlocking True if clicking the overlay does not close the modal, * otherwise, false. */ setOverlayBlocking(overlayBlocking: boolean): void; /** * Returns whether the overlay is blocking. * @return {boolean} True if cllicking the overlay does *not* close the modal, otherwise false. */ isOverlayBlocking(): boolean; /** * Click handler for the overlay click event */ overlayClick(): void; /** * Returns whether or not the modal is visible * @return {boolean} True if the modal is visible, otherwise false */ isVisible(): boolean; /** * Sets whether the modal is visible or not * @param {boolean} isVisible True to make the modal visible, otherwise false */ setVisibility(isVisible: boolean): void; /** * Adds the given button type to the button list * @param {string} name The name of the button * @param {string} text The text to display in the button * @param {ModalActionType} type The modal action type of the button */ addButton(text: string, type: ModalActionType): void; /** * Adds the given function as a click event handler to the button with the give type * @param {ModalActionType} type The type of button to pass the action to * @param {Function} action The action function to execute when the button is clicked */ onButtonClick(type: ModalActionType, action: Function): void; /** * Opens a new modal window, optionally inserting it into a target container, with a blocking * or non-blocking overlay * * @param {Type} componentType The component type to create which contains a template * to use as the contents of the modal. * @param {boolean} blocking Optionally specify whether the overlay behind the modal * is blocking (it blocks click events to the document * beneath the overlay), or non-blocking (the user can close * the modal by clicking on the overlay). */ open(component: Type, blocking?: boolean, additionalClasses?: string[]): void; private _setAdditionalClasses(additionalClasses); /** * Closes the modal, destroying the modal child (if exists) and overlay components */ close(): void; /** * Registers a callback to occur when the modal closes * @param {Function} callback The callback to execute */ onClose(callback: Function): void; /** * Triggers when the modal primary action is completed */ complete(): void; /** * Registers callback functions to execute when the modal complete method is invoked * @param {Function} callback [description] */ onComplete(callback: Function): void; /** * Sets the target warpper container in which to inject the modal. * @param {ViewContainerRef} wrapper The warpper container */ setWrapper(wrapper: ViewContainerRef): void; /** * Checks that there is a valid wrapper, which is a ViewContainerRef, * otherwise throws an error * @param {ViewContainerRef} wrapper A ViewContainerRef for the modal contents */ private _checkWrapper(wrapper); }