UNPKG

openfin-browser-adapter

Version:
46 lines (45 loc) 1.58 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var Base_1 = require("./Base"); var Notification = (function (_super) { __extends(Notification, _super); function Notification(options, callback) { var _this = _super.call(this) || this; if (options && options.url) { window.open(options.url, '_blank'); } setTimeout(function () { if (Notification.connection) { Notification.connection.send({ topic: 'onNotificationMessage', message: options.message }); } }, 500); if (callback) { setTimeout(callback, 0); } return _this; } Notification.staticMethods = [ 'getCurrent', ]; Notification.instanceMethods = [ 'close', 'sendMessage', 'sendMessageToApplication', ]; Notification.connection = null; return Notification; }(Base_1.BaseApiClass)); exports.Notification = Notification;