UNPKG

openfin-browser-adapter

Version:
45 lines (44 loc) 1.82 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 ChannelProvider_1 = require("./ChannelProvider"); var ChannelClient_1 = require("./ChannelClient"); var OpenFinMock_1 = require("../OpenFinMock"); var _ChannelProvider = OpenFinMock_1.OpenFinMock.generateMethods('InterApplicationBus.Channel#ChannelProvider', ChannelProvider_1.ChannelProvider); var _ChannelClient = OpenFinMock_1.OpenFinMock.generateMethods('InterApplicationBus.Channel#ChannelClient', ChannelClient_1.ChannelClient); var Channel = (function (_super) { __extends(Channel, _super); function Channel() { return _super !== null && _super.apply(this, arguments) || this; } Channel.create = function () { return new Promise(function (resolve, reject) { resolve(new _ChannelProvider()); }); }; Channel.connect = function () { return new Promise(function (resolve, reject) { resolve(new _ChannelClient()); }); }; Channel.staticMethods = [ 'onChannelConnect', 'onChannelDisconnect', ]; Channel.instanceMethods = []; return Channel; }(Base_1.BaseApiClass)); exports.Channel = Channel;