@raydiant/playlist-window-manager 0.20.0-rc.1 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,13 +5,14 @@ export default class BrowserViewRenderer implements PresentationWindowRenderer {
5
5
  private offscreenWindow;
6
6
  private windows;
7
7
  constructor(mainWindow: BrowserWindow, offscreenWindow: BrowserWindow);
8
- createWindow({ windowId, parentWindowId, bounds, backgroundColor, receiveMessageCallback }: CreateWindowOptions): Promise<void>;
8
+ createWindow({ windowId, parentWindowId, bounds, backgroundColor, receiveMessageCallback, }: CreateWindowOptions): Promise<void>;
9
9
  loadWindow(windowId: string, url: string): Promise<void>;
10
10
  updateWindowBounds(windowId: string, bounds: WindowBounds): void;
11
11
  showWindow(windowId: string, isFocused: boolean): void;
12
12
  hideWindow(windowId: string): void;
13
13
  removeWindow(windowId: string): Promise<void>;
14
- sendMessage(windowId: string, message: string): void;
14
+ sendMessageString(windowId: string, message: string): void;
15
+ sendMessageObject(windowId: string, type: string, payload?: any): void;
15
16
  muteWindow(windowId: string): void;
16
17
  unMuteWindow(windowId: string): void;
17
18
  private getWindow;
@@ -10,11 +10,35 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
13
36
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
38
  return new (P || (P = Promise))(function (resolve, reject) {
15
39
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
40
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
42
  step((generator = generator.apply(thisArg, _arguments || [])).next());
19
43
  });
20
44
  };
@@ -24,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
24
48
  function verb(n) { return function (v) { return step([n, v]); }; }
25
49
  function step(op) {
26
50
  if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
51
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
52
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
53
  if (y = 0, t) op = [op[0] & 2, t.value];
30
54
  switch (op[0]) {
@@ -45,13 +69,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
69
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
70
  }
47
71
  };
48
- var __importStar = (this && this.__importStar) || function (mod) {
49
- if (mod && mod.__esModule) return mod;
50
- var result = {};
51
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
52
- result["default"] = mod;
53
- return result;
54
- };
55
72
  Object.defineProperty(exports, "__esModule", { value: true });
56
73
  var path = __importStar(require("path"));
57
74
  var electron_1 = require("electron");
@@ -69,15 +86,15 @@ var BrowserViewRenderer = /** @class */ (function () {
69
86
  window = {
70
87
  view: new electron_1.BrowserView({
71
88
  webPreferences: {
72
- preload: path.join(__dirname, 'preload.js')
73
- }
89
+ preload: path.join(__dirname, 'preload.js'),
90
+ },
74
91
  }),
75
- bounds: bounds || __assign({}, this.mainWindow.getBounds(), { x: 0, y: 0 }),
92
+ bounds: bounds || __assign(__assign({}, this.mainWindow.getBounds()), { x: 0, y: 0 }),
76
93
  receiveMessageCallback: function (_, type, payload) {
77
94
  if (receiveMessageCallback) {
78
95
  receiveMessageCallback(type, payload);
79
96
  }
80
- }
97
+ },
81
98
  };
82
99
  this.windows[windowId] = window;
83
100
  electron_1.ipcMain.on(windowId, window.receiveMessageCallback);
@@ -91,7 +108,7 @@ var BrowserViewRenderer = /** @class */ (function () {
91
108
  if (!parentWindowId) {
92
109
  window.view.setAutoResize({
93
110
  width: true,
94
- height: true
111
+ height: true,
95
112
  });
96
113
  }
97
114
  return [2 /*return*/];
@@ -106,7 +123,7 @@ var BrowserViewRenderer = /** @class */ (function () {
106
123
  case 0:
107
124
  window = this.getWindow(windowId);
108
125
  if (!window) {
109
- throw new Error("Failed to load window, missing window id '" + windowId + "'");
126
+ throw new Error("Failed to load window, missing window id '".concat(windowId, "'"));
110
127
  }
111
128
  return [4 /*yield*/, window.view.webContents.loadURL(url)];
112
129
  case 1:
@@ -119,7 +136,7 @@ var BrowserViewRenderer = /** @class */ (function () {
119
136
  BrowserViewRenderer.prototype.updateWindowBounds = function (windowId, bounds) {
120
137
  var window = this.getWindow(windowId);
121
138
  if (!window) {
122
- throw new Error("Failed to update window bounds, missing window id '" + windowId + "'");
139
+ throw new Error("Failed to update window bounds, missing window id '".concat(windowId, "'"));
123
140
  }
124
141
  window.bounds = bounds;
125
142
  window.view.setBounds(window.bounds);
@@ -127,7 +144,7 @@ var BrowserViewRenderer = /** @class */ (function () {
127
144
  BrowserViewRenderer.prototype.showWindow = function (windowId, isFocused) {
128
145
  var window = this.getWindow(windowId);
129
146
  if (!window) {
130
- throw new Error("Failed to show window, missing window id '" + windowId + "'");
147
+ throw new Error("Failed to show window, missing window id '".concat(windowId, "'"));
131
148
  }
132
149
  this.mainWindow.addBrowserView(window.view);
133
150
  if (isFocused) {
@@ -139,7 +156,7 @@ var BrowserViewRenderer = /** @class */ (function () {
139
156
  BrowserViewRenderer.prototype.hideWindow = function (windowId) {
140
157
  var window = this.getWindow(windowId);
141
158
  if (!window) {
142
- throw new Error("Failed to hide window, missing window id '" + windowId + "'");
159
+ throw new Error("Failed to hide window, missing window id '".concat(windowId, "'"));
143
160
  }
144
161
  this.offscreenWindow.addBrowserView(window.view);
145
162
  };
@@ -149,7 +166,7 @@ var BrowserViewRenderer = /** @class */ (function () {
149
166
  return __generator(this, function (_a) {
150
167
  window = this.getWindow(windowId);
151
168
  if (!window) {
152
- throw new Error("Failed to hide window, missing window id '" + windowId + "'");
169
+ throw new Error("Failed to hide window, missing window id '".concat(windowId, "'"));
153
170
  }
154
171
  this.hideWindow(windowId);
155
172
  window.view.webContents.loadURL('about:blank');
@@ -159,24 +176,31 @@ var BrowserViewRenderer = /** @class */ (function () {
159
176
  });
160
177
  });
161
178
  };
162
- BrowserViewRenderer.prototype.sendMessage = function (windowId, message) {
179
+ BrowserViewRenderer.prototype.sendMessageString = function (windowId, message) {
163
180
  var window = this.getWindow(windowId);
164
181
  if (!window) {
165
- throw new Error("Failed to send message to window, missing window id '" + windowId + "'");
182
+ throw new Error("Failed to send message to window, missing window id '".concat(windowId, "'"));
166
183
  }
167
184
  window.view.webContents.send('electron-main', message);
168
185
  };
186
+ BrowserViewRenderer.prototype.sendMessageObject = function (windowId, type, payload) {
187
+ var window = this.getWindow(windowId);
188
+ if (!window) {
189
+ throw new Error("Failed to send message to window, missing window id '".concat(windowId, "'"));
190
+ }
191
+ window.view.webContents.send('electron-main', { type: type, payload: payload });
192
+ };
169
193
  BrowserViewRenderer.prototype.muteWindow = function (windowId) {
170
194
  var window = this.getWindow(windowId);
171
195
  if (!window) {
172
- throw new Error("Failed to mute window, missing window id '" + windowId + "'");
196
+ throw new Error("Failed to mute window, missing window id '".concat(windowId, "'"));
173
197
  }
174
198
  window.view.webContents.setAudioMuted(true);
175
199
  };
176
200
  BrowserViewRenderer.prototype.unMuteWindow = function (windowId) {
177
201
  var window = this.getWindow(windowId);
178
202
  if (!window) {
179
- throw new Error("Failed to unmute window, missing window id '" + windowId + "'");
203
+ throw new Error("Failed to unmute window, missing window id '".concat(windowId, "'"));
180
204
  }
181
205
  window.view.webContents.setAudioMuted(false);
182
206
  };
@@ -23,13 +23,14 @@ export default class BrowserWindowRenderer implements PresentationWindowRenderer
23
23
  private proxySettings;
24
24
  private logger;
25
25
  constructor(opts: BrowserWindowRendererOptions);
26
- createWindow({ windowId, parentWindowId, bounds, backgroundColor, receiveMessageCallback, errorCallback }: CreateWindowOptions): Promise<void>;
26
+ createWindow({ windowId, parentWindowId, bounds, backgroundColor, receiveMessageCallback, errorCallback, }: CreateWindowOptions): Promise<void>;
27
27
  loadWindow(windowId: string, url: string): Promise<void>;
28
28
  updateWindowBounds(windowId: string, bounds: WindowBounds): void;
29
29
  showWindow(windowId: string, isFocused: boolean): void;
30
30
  hideWindow(windowId: string): void;
31
31
  removeWindow(windowId: string): Promise<void>;
32
- sendMessage(windowId: string, message: string): void;
32
+ sendMessageString(windowId: string, message: string): void;
33
+ sendMessageObject(windowId: string, type: string, payload?: any): void;
33
34
  muteWindow(windowId: string): void;
34
35
  unMuteWindow(windowId: string): void;
35
36
  private getWindow;
@@ -10,11 +10,35 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
13
36
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
38
  return new (P || (P = Promise))(function (resolve, reject) {
15
39
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
40
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
42
  step((generator = generator.apply(thisArg, _arguments || [])).next());
19
43
  });
20
44
  };
@@ -24,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
24
48
  function verb(n) { return function (v) { return step([n, v]); }; }
25
49
  function step(op) {
26
50
  if (f) throw new TypeError("Generator is already executing.");
27
- while (_) try {
51
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
52
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
53
  if (y = 0, t) op = [op[0] & 2, t.value];
30
54
  switch (op[0]) {
@@ -45,13 +69,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
69
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
70
  }
47
71
  };
48
- var __importStar = (this && this.__importStar) || function (mod) {
49
- if (mod && mod.__esModule) return mod;
50
- var result = {};
51
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
52
- result["default"] = mod;
53
- return result;
54
- };
55
72
  var __importDefault = (this && this.__importDefault) || function (mod) {
56
73
  return (mod && mod.__esModule) ? mod : { "default": mod };
57
74
  };
@@ -72,8 +89,8 @@ var BrowserWindowRenderer = /** @class */ (function () {
72
89
  frame: this.opts.frame,
73
90
  hasShadow: this.opts.hasShadow,
74
91
  webPreferences: {
75
- preload: path.join(__dirname, 'preload.js')
76
- }
92
+ preload: path.join(__dirname, 'preload.js'),
93
+ },
77
94
  });
78
95
  this.proxySettings = null;
79
96
  this.offscreenWindow.setBounds(opts.bounds);
@@ -100,8 +117,8 @@ var BrowserWindowRenderer = /** @class */ (function () {
100
117
  view: parentWindowId && this.opts.renderChildWindowsAsBrowserViews
101
118
  ? this.createOrGetPooledBrowserView(windowId, {
102
119
  webPreferences: {
103
- preload: path.join(__dirname, 'preload.js')
104
- }
120
+ preload: path.join(__dirname, 'preload.js'),
121
+ },
105
122
  })
106
123
  : this.createOrGetPooledBrowserWindow(windowId, {
107
124
  show: false,
@@ -114,15 +131,15 @@ var BrowserWindowRenderer = /** @class */ (function () {
114
131
  transparent: backgroundColor === 'transparent',
115
132
  hasShadow: this.opts.hasShadow,
116
133
  webPreferences: {
117
- preload: path.join(__dirname, 'preload.js')
118
- }
134
+ preload: path.join(__dirname, 'preload.js'),
135
+ },
119
136
  }),
120
137
  // If we are creating a child window and renderChildWindowsAsBrowserViews is false that means
121
138
  // we are rendering child windows with BrowserWindow. BrowserWindows are positioned absolutely so
122
139
  // to place them in the correct spot relative to their parent we need to add the main window's x / y.
123
140
  // BrowserViews are relatively positioned so we don't need to do that.
124
141
  bounds: parentWindowId && !this.opts.renderChildWindowsAsBrowserViews
125
- ? __assign({}, bounds, { x: bounds.x + this.opts.bounds.x, y: bounds.y + this.opts.bounds.y }) : bounds,
142
+ ? __assign(__assign({}, bounds), { x: bounds.x + this.opts.bounds.x, y: bounds.y + this.opts.bounds.y }) : bounds,
126
143
  receiveMessageCallback: function (_, type, payload) {
127
144
  if (receiveMessageCallback) {
128
145
  receiveMessageCallback(type, payload);
@@ -131,15 +148,15 @@ var BrowserWindowRenderer = /** @class */ (function () {
131
148
  unresponsiveCallback: function () {
132
149
  _this.logger.error("Window received 'unresponsive' event", { windowId: windowId });
133
150
  _this.windowCrashHandler('unresponsive');
134
- errorCallback(new WindowUnresponsiveError_1.default("Window '" + windowId + "' is unresponsive"));
151
+ errorCallback(new WindowUnresponsiveError_1.default("Window '".concat(windowId, "' is unresponsive")));
135
152
  },
136
153
  renderProcessGoneCallback: function (_, details) {
137
- _this.logger.error("Window received 'render-process-gone' event. Reason: " + details.reason, { windowId: windowId });
154
+ _this.logger.error("Window received 'render-process-gone' event. Reason: ".concat(details.reason), { windowId: windowId });
138
155
  // TODO: Handle different reasons for render-process-gone?
139
156
  // https://www.electronjs.org/docs/api/web-contents#event-render-process-gone
140
157
  _this.windowCrashHandler('render-process-gone');
141
- errorCallback(new WindowUnresponsiveError_1.default("Window '" + windowId + "' render process gone"));
142
- }
158
+ errorCallback(new WindowUnresponsiveError_1.default("Window '".concat(windowId, "' render process gone")));
159
+ },
143
160
  };
144
161
  // Attached crash handlers to skip presentation on error.
145
162
  window.view.webContents.on('render-process-gone', window.renderProcessGoneCallback);
@@ -178,7 +195,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
178
195
  case 0:
179
196
  window = this.getWindow(windowId);
180
197
  if (!window) {
181
- throw new Error("Failed to load window, missing window id '" + windowId + "'");
198
+ throw new Error("Failed to load window, missing window id '".concat(windowId, "'"));
182
199
  }
183
200
  return [4 /*yield*/, window.view.webContents.loadURL(url)];
184
201
  case 1:
@@ -191,13 +208,13 @@ var BrowserWindowRenderer = /** @class */ (function () {
191
208
  BrowserWindowRenderer.prototype.updateWindowBounds = function (windowId, bounds) {
192
209
  var window = this.getWindow(windowId);
193
210
  if (!window) {
194
- throw new Error("Failed to update window bounds, missing window id '" + windowId + "'");
211
+ throw new Error("Failed to update window bounds, missing window id '".concat(windowId, "'"));
195
212
  }
196
213
  window.bounds = bounds;
197
214
  if (window.view instanceof electron_1.BrowserWindow && window.parentWindowId) {
198
215
  // Child BrowserWindows are absolutely positioned so we need to add the main windows
199
216
  // x/y to when updating the child window's bounds.
200
- window.view.setBounds(__assign({}, window.bounds, { x: window.bounds.x + this.opts.bounds.x, y: window.bounds.y + this.opts.bounds.y }));
217
+ window.view.setBounds(__assign(__assign({}, window.bounds), { x: window.bounds.x + this.opts.bounds.x, y: window.bounds.y + this.opts.bounds.y }));
201
218
  }
202
219
  else {
203
220
  window.view.setBounds(window.bounds);
@@ -206,7 +223,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
206
223
  BrowserWindowRenderer.prototype.showWindow = function (windowId, isFocused) {
207
224
  var window = this.getWindow(windowId);
208
225
  if (!window) {
209
- throw new Error("Failed to show window, missing window id '" + windowId + "'");
226
+ throw new Error("Failed to show window, missing window id '".concat(windowId, "'"));
210
227
  }
211
228
  if (window.view instanceof electron_1.BrowserWindow) {
212
229
  if (isFocused) {
@@ -228,7 +245,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
228
245
  BrowserWindowRenderer.prototype.hideWindow = function (windowId) {
229
246
  var window = this.getWindow(windowId);
230
247
  if (!window) {
231
- throw new Error("Failed to hide window, missing window id '" + windowId + "'");
248
+ throw new Error("Failed to hide window, missing window id '".concat(windowId, "'"));
232
249
  }
233
250
  if (window.view instanceof electron_1.BrowserWindow) {
234
251
  window.view.hide();
@@ -245,7 +262,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
245
262
  case 0:
246
263
  window = this.getWindow(windowId);
247
264
  if (!window) {
248
- throw new Error("Failed to remove window, missing window id '" + windowId + "'");
265
+ throw new Error("Failed to remove window, missing window id '".concat(windowId, "'"));
249
266
  }
250
267
  // Remove crash handlers
251
268
  window.view.webContents.removeListener('render-process-gone', window.renderProcessGoneCallback);
@@ -276,24 +293,31 @@ var BrowserWindowRenderer = /** @class */ (function () {
276
293
  });
277
294
  });
278
295
  };
279
- BrowserWindowRenderer.prototype.sendMessage = function (windowId, message) {
296
+ BrowserWindowRenderer.prototype.sendMessageString = function (windowId, message) {
280
297
  var window = this.getWindow(windowId);
281
298
  if (!window) {
282
- throw new Error("Failed to send message to window, missing window id '" + windowId + "'");
299
+ throw new Error("Failed to send message to window, missing window id '".concat(windowId, "'"));
283
300
  }
284
301
  window.view.webContents.send('electron-main', message);
285
302
  };
303
+ BrowserWindowRenderer.prototype.sendMessageObject = function (windowId, type, payload) {
304
+ var window = this.getWindow(windowId);
305
+ if (!window) {
306
+ throw new Error("Failed to send message to window, missing window id '".concat(windowId, "'"));
307
+ }
308
+ window.view.webContents.send('electron-main', { type: type, payload: payload });
309
+ };
286
310
  BrowserWindowRenderer.prototype.muteWindow = function (windowId) {
287
311
  var window = this.getWindow(windowId);
288
312
  if (!window) {
289
- throw new Error("Failed to mute window, missing window id '" + windowId + "'");
313
+ throw new Error("Failed to mute window, missing window id '".concat(windowId, "'"));
290
314
  }
291
315
  window.view.webContents.setAudioMuted(true);
292
316
  };
293
317
  BrowserWindowRenderer.prototype.unMuteWindow = function (windowId) {
294
318
  var window = this.getWindow(windowId);
295
319
  if (!window) {
296
- throw new Error("Failed to unmute window, missing window id '" + windowId + "'");
320
+ throw new Error("Failed to unmute window, missing window id '".concat(windowId, "'"));
297
321
  }
298
322
  window.view.webContents.setAudioMuted(false);
299
323
  };
@@ -312,7 +336,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
312
336
  BrowserWindowRenderer.prototype.addWindowToParent = function (parentWindowId, window) {
313
337
  var parentWindow = this.getWindow(parentWindowId);
314
338
  if (!parentWindow) {
315
- throw new Error("Failed to add window to parent, missing parent window id '" + parentWindowId + "'");
339
+ throw new Error("Failed to add window to parent, missing parent window id '".concat(parentWindowId, "'"));
316
340
  }
317
341
  if (parentWindow.view instanceof electron_1.BrowserWindow) {
318
342
  if (window.view instanceof electron_1.BrowserView) {
@@ -320,34 +344,34 @@ var BrowserWindowRenderer = /** @class */ (function () {
320
344
  parentWindow.view.addBrowserView(window.view);
321
345
  }
322
346
  else {
323
- throw new Error("Failed add window to parent window id '" + parentWindowId + "', child window is not a BrowserView");
347
+ throw new Error("Failed add window to parent window id '".concat(parentWindowId, "', child window is not a BrowserView"));
324
348
  }
325
349
  }
326
350
  else {
327
- throw new Error("Failed add window to parent window id '" + parentWindowId + "', parent window is not a BrowserWindow");
351
+ throw new Error("Failed add window to parent window id '".concat(parentWindowId, "', parent window is not a BrowserWindow"));
328
352
  }
329
353
  };
330
354
  BrowserWindowRenderer.prototype.removeWindowFromParent = function (parentWindowId, window) {
331
355
  var parentWindow = this.getWindow(parentWindowId);
332
356
  if (!parentWindow) {
333
- throw new Error("Failed to remove window from parent, missing parent window id '" + parentWindowId + "'");
357
+ throw new Error("Failed to remove window from parent, missing parent window id '".concat(parentWindowId, "'"));
334
358
  }
335
359
  if (parentWindow.view instanceof electron_1.BrowserWindow) {
336
360
  if (window.view instanceof electron_1.BrowserView) {
337
361
  parentWindow.view.removeBrowserView(window.view);
338
362
  }
339
363
  else {
340
- throw new Error("Failed remove window from parent window id '" + parentWindowId + "', child window is not a BrowserView");
364
+ throw new Error("Failed remove window from parent window id '".concat(parentWindowId, "', child window is not a BrowserView"));
341
365
  }
342
366
  }
343
367
  else {
344
- throw new Error("Failed remove window from parent window id '" + parentWindowId + "', parent window is not a BrowserWindow");
368
+ throw new Error("Failed remove window from parent window id '".concat(parentWindowId, "', parent window is not a BrowserWindow"));
345
369
  }
346
370
  };
347
371
  BrowserWindowRenderer.prototype.getParentBrowserView = function (parentWindowId) {
348
372
  var parentWindow = this.getWindow(parentWindowId);
349
373
  if (!parentWindow) {
350
- throw new Error("Failed to get parent BrowserView, missing parent window id '" + parentWindowId + "'");
374
+ throw new Error("Failed to get parent BrowserView, missing parent window id '".concat(parentWindowId, "'"));
351
375
  }
352
376
  if (!(parentWindow.view instanceof electron_1.BrowserWindow)) {
353
377
  throw new Error("Failed to get parent BrowserView, window is not a BrowserView");
@@ -363,7 +387,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
363
387
  }
364
388
  else {
365
389
  this.logger.info("No free browser windows, adding new window to pool", {
366
- windowId: windowId
390
+ windowId: windowId,
367
391
  });
368
392
  }
369
393
  }
@@ -412,7 +436,7 @@ var BrowserWindowRenderer = /** @class */ (function () {
412
436
  }
413
437
  else {
414
438
  this.logger.info("No free browser views, adding new view to pool", {
415
- windowId: windowId
439
+ windowId: windowId,
416
440
  });
417
441
  }
418
442
  }
@@ -457,8 +481,8 @@ var BrowserWindowRenderer = /** @class */ (function () {
457
481
  BrowserWindowRenderer.prototype.logPoolStats = function () {
458
482
  var bwSize = this.browserWindowPool.size();
459
483
  var bvSize = this.browserViewPool.size();
460
- this.logger.info("BrowserWindow pool total=" + bwSize.total + " inuse=" + bwSize.inuse + " free=" + bwSize.free);
461
- this.logger.info("BrowserView pool total=" + bvSize.total + " inuse=" + bvSize.inuse + " free=" + bvSize.free);
484
+ this.logger.info("BrowserWindow pool total=".concat(bwSize.total, " inuse=").concat(bwSize.inuse, " free=").concat(bwSize.free));
485
+ this.logger.info("BrowserView pool total=".concat(bvSize.total, " inuse=").concat(bvSize.inuse, " free=").concat(bvSize.free));
462
486
  };
463
487
  return BrowserWindowRenderer;
464
488
  }());
@@ -490,7 +514,7 @@ var WindowPool = /** @class */ (function () {
490
514
  return {
491
515
  total: inuse + free,
492
516
  inuse: inuse,
493
- free: free
517
+ free: free,
494
518
  };
495
519
  };
496
520
  return WindowPool;
@@ -3,13 +3,14 @@ export default class IFrameRenderer implements PresentationWindowRenderer {
3
3
  private container;
4
4
  private windows;
5
5
  constructor(container: HTMLElement);
6
- createWindow({ windowId, bounds, backgroundColor, receiveMessageCallback }: CreateWindowOptions): Promise<void>;
6
+ createWindow({ windowId, bounds, backgroundColor, receiveMessageCallback, }: CreateWindowOptions): Promise<void>;
7
7
  loadWindow(windowId: string, url: string): Promise<void>;
8
8
  updateWindowBounds(windowId: string, bounds: WindowBounds): void;
9
9
  showWindow(windowId: string, isFocused: boolean): void;
10
10
  hideWindow(windowId: string): void;
11
11
  removeWindow(windowId: string): Promise<void>;
12
- sendMessage(windowId: string, message: string): void;
12
+ sendMessageString(windowId: string, message: string): void;
13
+ sendMessageObject(windowId: string, type: string, payload?: any): void;
13
14
  muteWindow(windowId: string): void;
14
15
  unMuteWindow(windowId: string): void;
15
16
  destroy(): void;