///
///
import angular from 'angular';
interface Modal {
element: JQuery;
id: string;
scope: angular.IScope;
deferred: ng.IDeferred;
}
export default class MflyModalService {
private $compile;
private $document;
private $q;
private $rootScope;
private $timeout;
currentModal: Modal | undefined;
constructor($compile: ng.ICompileService, $document: ng.IDocumentService, $q: ng.IQService, $rootScope: ng.IRootScopeService, $timeout: ng.ITimeoutService);
/**
* Closes the current modal "successfully", resolving the open promise.
*
* @param data Optional data to pass with the resolving promise.
*/
close(data?: {}): void;
/**
* Closes the current modal "unsuccessfully" (i.e., user clicked Cancel).
*/
dismiss(): void;
/**
* Compiles and opens a modal component.
*
* @param modalId
* The name of the modal component to open.
* @param bindings
* An object containing data that will be one-way bound into the component.
* @returns
* A promise which will be resolved or rejected when `close` or `dismiss` are
* called from inside the modal component.
*/
open(modalId: string, bindings?: {}): ng.IPromise;
/**
* Handles cleanup of all DOM changes that were done _outside_ the modal, such
* as the no-scroll body class and the various aria attributes.
*/
cleanupDOM(): void;
/**
* Builds a tag string representing an Angular component.
*
* @param tagname
* The name of the component. It will be converted to kebab case.
* @param bindings
* An object representing data that will be one-way bound into the component.
*/
private buildComponentTag;
}
export {};