UNPKG

openfin-browser-adapter

Version:
82 lines (81 loc) 2.5 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 windowRegistry_1 = require("../helper/windowRegistry"); var Application = (function (_super) { __extends(Application, _super); function Application() { return _super !== null && _super.apply(this, arguments) || this; } Application.getCurrent = function () { return new Application(); }; Application.prototype.close = function (force, callback, errorCallback) { try { window.close(); if (callback) { callback(); } } catch (e) { if (e) { errorCallback(e); } } }; Application.prototype.getChildWindows = function (callback, errorCallback) { if (callback) { setTimeout(function () { try { callback(Object.keys(windowRegistry_1.default).map(function (key) { return (windowRegistry_1.default[key]); })); } catch (e) { if (e) { errorCallback(e); } } }, 0); } }; Application.staticMethods = [ 'wrap', ]; Application.instanceMethods = [ 'getWindow', 'addEventListener', 'createFromManifest', 'getGroups', 'getInfo', 'getManifest', 'getParentUuid', 'getShortcuts', 'getTrayIconInfo', 'getZoomLevel', 'isRunning', 'registerUser', 'removeEventListener', 'removeTrayIcon', 'restart', 'run', 'scheduleRestart', 'setShortcuts', 'setTrayIcon', 'setZoomLevel', 'terminate', ]; return Application; }(Base_1.BaseApiClass)); exports.Application = Application;