text: import { Subject } from 'rxjs/Subject';
  import { ToastData } from './toastr-config';
  /**
   * Reference to a dialog opened via the MdDialog service.
   */
  export var ToastRef = (function () {
      function ToastRef(_overlayRef) {
          this._overlayRef = _overlayRef;
          /** Subject for notifying the user that the dialog has finished closing. */
          this._afterClosed = new Subject();
          this._activate = new Subject();
      }
      /**
       * Close the dialog.
       * @param dialogResult Optional result to return to the dialog opener.
       */
      ToastRef.prototype.close = function () {
          this._overlayRef.detach();
          this._afterClosed.next();
          this._afterClosed.complete();
      };
      /** Gets an observable that is notified when the dialog is finished closing. */
      ToastRef.prototype.afterClosed = function () {
          return this._afterClosed.asObservable();
      };
      ToastRef.prototype.activate = function () {
          this._activate.next();
          this._activate.complete();
      };
      /** Gets an observable that is notified when the dialog has started opening. */
      ToastRef.prototype.afterActivate = function () {
          return this._activate.asObservable();
      };
      return ToastRef;
  }());
  /** Custom injector type specifically for instantiating components with a dialog. */
  export var ToastInjector = (function () {
      function ToastInjector(_dialogRef, _data, _parentInjector) {
          this._dialogRef = _dialogRef;
          this._data = _data;
          this._parentInjector = _parentInjector;
      }
      ToastInjector.prototype.get = function (token, notFoundValue) {
          if (token === ToastRef) {
              return this._dialogRef;
          }
          if (token === ToastData && this._data) {
              return this._data;
          }
          return this._parentInjector.get(token, notFoundValue);
      };
      return ToastInjector;
  }());
  