ee-core 2.11.1 → 4.0.0-beta.1

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.
Files changed (96) hide show
  1. package/app/application.js +31 -0
  2. package/app/boot.js +81 -0
  3. package/app/dir.js +27 -0
  4. package/app/events.js +56 -0
  5. package/app/index.js +7 -0
  6. package/config/config_loader.js +66 -0
  7. package/config/default_config.js +110 -0
  8. package/config/index.js +21 -83
  9. package/const/channel.js +26 -16
  10. package/const/index.js +0 -4
  11. package/controller/controller_loader.js +78 -0
  12. package/controller/index.js +18 -19
  13. package/core/index.js +6 -5
  14. package/core/{lib/loader → loader}/file_loader.js +39 -156
  15. package/core/utils/index.js +83 -0
  16. package/core/{lib/utils → utils}/timing.js +3 -2
  17. package/cross/cross.js +152 -0
  18. package/cross/index.js +6 -181
  19. package/cross/spawnProcess.js +34 -51
  20. package/electron/app/index.js +38 -54
  21. package/electron/index.js +13 -17
  22. package/electron/window/index.js +260 -65
  23. package/exception/index.js +34 -32
  24. package/html/index.js +7 -10
  25. package/index.js +4 -52
  26. package/jobs/child/app.js +9 -9
  27. package/jobs/child/forkProcess.js +29 -45
  28. package/jobs/child/index.js +13 -10
  29. package/jobs/child-pool/index.js +13 -11
  30. package/jobs/index.js +2 -4
  31. package/loader/index.js +91 -144
  32. package/log/index.js +74 -57
  33. package/log/logger.js +76 -84
  34. package/message/childMessage.js +12 -13
  35. package/message/index.js +7 -16
  36. package/package.json +2 -2
  37. package/ps/index.js +137 -223
  38. package/socket/httpServer.js +46 -43
  39. package/socket/index.js +52 -69
  40. package/socket/ipcServer.js +80 -94
  41. package/socket/socketServer.js +31 -24
  42. package/storage/index.js +5 -37
  43. package/storage/sqliteStorage.js +18 -18
  44. package/utils/extend.js +10 -5
  45. package/utils/helper.js +38 -42
  46. package/utils/index.js +40 -23
  47. package/utils/ip.js +5 -45
  48. package/utils/is.js +107 -141
  49. package/utils/json.js +15 -7
  50. package/utils/pargv.js +5 -1
  51. package/utils/{get-port → port}/index.js +4 -26
  52. package/utils/wrap.js +8 -3
  53. package/addon/index.js +0 -35
  54. package/addon/window/index.js +0 -99
  55. package/bin/tools.js +0 -8
  56. package/config/cache.js +0 -42
  57. package/config/config.default.js +0 -331
  58. package/controller/baseContextClass.js +0 -25
  59. package/core/lib/ee.js +0 -216
  60. package/core/lib/loader/context_loader.js +0 -106
  61. package/core/lib/loader/ee_loader.js +0 -435
  62. package/core/lib/loader/mixin/addon.js +0 -32
  63. package/core/lib/loader/mixin/config.js +0 -130
  64. package/core/lib/loader/mixin/controller.js +0 -125
  65. package/core/lib/loader/mixin/service.js +0 -28
  66. package/core/lib/utils/base_context_class.js +0 -34
  67. package/core/lib/utils/function.js +0 -30
  68. package/core/lib/utils/index.js +0 -133
  69. package/core/lib/utils/sequencify.js +0 -59
  70. package/ee/appLoader.js +0 -48
  71. package/ee/application.js +0 -100
  72. package/ee/baseApp.js +0 -104
  73. package/ee/eeApp.js +0 -409
  74. package/ee/index.js +0 -58
  75. package/electron/window/winState.js +0 -186
  76. package/httpclient/index.js +0 -161
  77. package/jobs/baseJobClass.js +0 -16
  78. package/jobs/renderer/index.js +0 -141
  79. package/jobs/renderer/loadView.js +0 -41
  80. package/jobs/unification.js +0 -64
  81. package/main/index.js +0 -57
  82. package/old-utils/index.js +0 -91
  83. package/services/baseContextClass.js +0 -24
  84. package/services/index.js +0 -41
  85. package/socket/io.js +0 -28
  86. package/storage/jsondb/adapters/Base.js +0 -23
  87. package/storage/jsondb/adapters/FileSync.js +0 -64
  88. package/storage/jsondb/main.js +0 -55
  89. package/storage/jsondbStorage.js +0 -196
  90. package/utils/co.js +0 -237
  91. package/utils/copyto.js +0 -161
  92. package/utils/depd/index.js +0 -538
  93. package/utils/depd/lib/browser/index.js +0 -77
  94. package/utils/get-port/index.d.ts +0 -64
  95. package/utils/time/index.js +0 -20
  96. package/utils/time/ms.js +0 -162
package/ee/eeApp.js DELETED
@@ -1,409 +0,0 @@
1
- const path = require('path');
2
- const fs = require('fs');
3
- const assert = require('assert');
4
- const is = require('is-type-of');
5
- const Koa = require('koa');
6
- const koaServe = require('koa-static');
7
- const https = require('https');
8
- const BaseApp = require('./baseApp');
9
- const Log = require('../log');
10
- const CoreElectron = require('../electron');
11
- const CoreElectronApp = require('../electron/app');
12
- const CoreElectronWindow = require('../electron/window');
13
- const Conf = require('../config');
14
- const Ps = require('../ps');
15
- const Socket = require('../socket');
16
- const GetPort = require('../utils/get-port');
17
- const UtilsHelper = require('../utils/helper');
18
- const HttpClient = require('../httpclient');
19
- const Cross = require('../cross');
20
- const Html = require('../html');
21
-
22
- class EeApp extends BaseApp {
23
- constructor(options = {}) {
24
- super(options);
25
-
26
- // 兼容旧的api
27
- this.electron = CoreElectron;
28
- this.mainWindow;
29
- }
30
-
31
- /**
32
- * 生成端口
33
- */
34
- async createPorts() {
35
- if (Ps.isFrameworkMode() && Conf.isWebProtocol(this.config.mainServer)) {
36
- const mainPort = await GetPort({port: parseInt(this.config.mainServer.port)});
37
- process.env.EE_MAIN_PORT = mainPort;
38
- this.config.mainServer.port = mainPort;
39
- }
40
-
41
- if (this.config.socketServer.enable) {
42
- const socketPort = await GetPort({port: parseInt(this.config.socketServer.port)});
43
- process.env.EE_SOCKET_PORT = socketPort;
44
- this.config.socketServer.port = socketPort;
45
- }
46
-
47
- if (this.config.httpServer.enable) {
48
- const httpPort = await GetPort({port: parseInt(this.config.httpServer.port)});
49
- process.env.EE_HTTP_PORT = httpPort;
50
- this.config.httpServer.port = httpPort;
51
- }
52
-
53
- // [todo] 更新db配置 (system.json 不再主进程中使用了,后续可能在子进程中使用)
54
- Conf.setAll(this.config);
55
- }
56
-
57
- /**
58
- * 启动通信模块
59
- */
60
- async startSocket() {
61
- Socket.startAll(this);
62
- }
63
-
64
- /**
65
- * 启动跨语言服务
66
- */
67
- async crossService() {
68
- Cross.create();
69
- }
70
-
71
- /**
72
- * 创建electron应用
73
- */
74
- async createElectronApp() {
75
- if (!Ps.isFrameworkMode()) return;
76
- const newApp = CoreElectronApp.create();
77
- if (!newApp) {
78
- return
79
- }
80
-
81
- await this.crossService();
82
-
83
- await this.electronAppReady();
84
- }
85
-
86
- /**
87
- * 创建应用主窗口
88
- */
89
- async createWindow() {
90
-
91
- // 初始化一个主窗口
92
- this.mainWindow = CoreElectronWindow.getMainWindow();
93
-
94
- await this.windowReady();
95
-
96
- await this._loderAddons();
97
-
98
- await this._loderPreload();
99
-
100
- this.selectAppType();
101
- }
102
-
103
- /**
104
- * 应用类型 (远程、html、单页应用)
105
- */
106
- async selectAppType() {
107
- let type = '';
108
- let url = '';
109
-
110
- // 远程模式
111
- const remoteConfig = this.config.remoteUrl;
112
- if (remoteConfig.enable == true) {
113
- type = 'remote_web';
114
- url = remoteConfig.url;
115
- this.loadMainUrl(type, url);
116
- return;
117
- }
118
-
119
- const mainServer = this.config.mainServer;
120
-
121
- // 开发环境
122
- if (Ps.isDev()) {
123
- let modeInfo;
124
- let url;
125
- let load = 'url';
126
- const configFile = './electron/config/bin.js';
127
- let electronCfg = {};
128
-
129
- const isBin = UtilsHelper.checkConfig(configFile);
130
- if (isBin) {
131
- const binConfig = UtilsHelper.loadConfig(configFile);
132
- modeInfo = binConfig.dev.frontend;
133
- electronCfg = binConfig.dev.electron;
134
- } else {
135
- // 兼容旧的 developmentMode
136
- const developmentModeConfig = this.config.developmentMode;
137
- const selectMode = developmentModeConfig.default;
138
- modeInfo = developmentModeConfig.mode[selectMode];
139
- }
140
-
141
- url = modeInfo.protocol + modeInfo.hostname + ':' + modeInfo.port;
142
- if (Conf.isFileProtocol(modeInfo)) {
143
- url = path.join(this.config.homeDir, modeInfo.directory, modeInfo.indexPath);
144
- load = 'file';
145
- }
146
-
147
- // 检查 UI serve是否启动,先加载一个boot page
148
- if (load == 'url') {
149
- // loading page
150
- let lp = Html.getFilepath('boot.html');
151
- if (electronCfg.hasOwnProperty('loadingPage') && electronCfg.loadingPage != '') {
152
- lp = path.join(this.config.homeDir, electronCfg.loadingPage);
153
- }
154
- this._loadingPage(lp);
155
-
156
- const retryTimes = modeInfo.force === true ? 3 : 60;
157
- let count = 0;
158
- let frontendReady = false;
159
- const hc = new HttpClient();
160
- while(!frontendReady && count < retryTimes){
161
- await UtilsHelper.sleep(1 * 1000);
162
- try {
163
- await hc.request(url, {
164
- method: 'GET',
165
- timeout: 1000,
166
- });
167
- frontendReady = true;
168
- } catch(err) {
169
- // console.log('The frontend service is starting');
170
- }
171
-
172
- count++;
173
- }
174
-
175
- if (frontendReady == false && modeInfo.force !== true) {
176
- const bootFailurePage = Html.getFilepath('failure.html');
177
- this.mainWindow.loadFile(bootFailurePage);
178
- Log.coreLogger.error(`[ee-core] Please check the ${url} !`);
179
- return;
180
- }
181
- }
182
-
183
- this.loadMainUrl('spa', url, load);
184
- return;
185
- }
186
-
187
- // 生产环境
188
- // cross service takeover web
189
- if (mainServer.hasOwnProperty('takeover')) {
190
- await this._crossTakeover(mainServer)
191
- return
192
- }
193
-
194
- // 主进程
195
- if (mainServer.protocol == "") {
196
- return
197
- }
198
- if (Conf.isFileProtocol(mainServer)) {
199
- url = path.join(this.config.homeDir, mainServer.indexPath);
200
- this.loadMainUrl('spa', url, 'file');
201
- } else {
202
- this.loadLocalWeb('spa');
203
- }
204
- }
205
-
206
- /**
207
- * cross service takeover web
208
- */
209
- async _crossTakeover(mainCfg = {}) {
210
- const crossConfig = this.config.cross;
211
-
212
- // loading page
213
- if (mainCfg.hasOwnProperty('loadingPage')) {
214
- const lp = path.join(this.config.homeDir, mainCfg.loadingPage);
215
- this._loadingPage(lp);
216
- }
217
-
218
- // cross service url
219
- const service = mainCfg.takeover;
220
- if (!crossConfig.hasOwnProperty(service)) {
221
- throw new Error(`[ee-core] Please Check the value of mainServer.takeover in the config file !`);
222
- }
223
- // check service
224
- if (crossConfig[service].enable != true) {
225
- throw new Error(`[ee-core] Please Check the value of cross.${service} enable is true !`);
226
- }
227
-
228
- const entityName = crossConfig[service].name;
229
- const url = Cross.getUrl(entityName);
230
-
231
- let count = 0;
232
- let serviceReady = false;
233
- const hc = new HttpClient();
234
-
235
- // 循环检查
236
- const times = Ps.isDev() ? 20 : 100;
237
- const sleeptime = Ps.isDev() ? 1000 : 100;
238
- while(!serviceReady && count < times){
239
- await UtilsHelper.sleep(sleeptime);
240
- try {
241
- await hc.request(url, {
242
- method: 'GET',
243
- timeout: 100,
244
- });
245
- serviceReady = true;
246
- } catch(err) {
247
- //console.log('The cross service is starting');
248
- }
249
- count++;
250
- }
251
- //console.log('count:', count)
252
- if (serviceReady == false) {
253
- const bootFailurePage = Html.getFilepath('cross-failure.html');
254
- this.mainWindow.loadFile(bootFailurePage);
255
- throw new Error(`[ee-core] Please check cross service [${service}] ${url} !`)
256
- }
257
-
258
- Log.coreLogger.info(`[ee-core] cross service [${service}] is started successfully`);
259
- this.loadMainUrl('spa', url);
260
- }
261
-
262
- /**
263
- * 加载本地前端资源
264
- */
265
- loadLocalWeb(mode, staticDir) {
266
- if (!staticDir) {
267
- staticDir = path.join(this.config.homeDir, 'public', 'dist')
268
- }
269
-
270
- const koaApp = new Koa();
271
- koaApp.use(koaServe(staticDir));
272
-
273
- const mainServer = this.config.mainServer;
274
- let url = mainServer.protocol + mainServer.host + ':' + mainServer.port;
275
-
276
- const isHttps = mainServer.protocol == 'https://' ? true : false;
277
- if (isHttps) {
278
- const keyFile = path.join(this.config.homeDir, mainServer.ssl.key);
279
- const certFile = path.join(this.config.homeDir, mainServer.ssl.cert);
280
- assert(fs.existsSync(keyFile), 'ssl key file is required');
281
- assert(fs.existsSync(certFile), 'ssl cert file is required');
282
-
283
- const sslOpt = {
284
- key: fs.readFileSync(keyFile),
285
- cert: fs.readFileSync(certFile)
286
- };
287
- https.createServer(sslOpt, koaApp.callback()).listen(mainServer.port, (err) => {
288
- if (err) {
289
- Log.coreLogger.info('[ee-core] [lib/eeApp] createServer error: ', err);
290
- return
291
- }
292
- this.loadMainUrl(mode, url);
293
- });
294
- } else {
295
- // 使用 host port
296
- const koaOpt = {
297
- host: mainServer.open ? undefined : mainServer.host, // 根据配置是否开放0.0.0.0,默认关闭,避免绑定到0.0.0.0
298
- port: mainServer.port
299
- }
300
- koaApp.listen(koaOpt, () => {
301
- this.loadMainUrl(mode, url);
302
- });
303
- }
304
- }
305
-
306
- /**
307
- * 主服务
308
- * @params load <string> value: "url" 、 "file"
309
- */
310
- loadMainUrl(type, url, load = 'url') {
311
- const mainServer = this.config.mainServer;
312
- Log.coreLogger.info('[ee-core] Env: %s, Type: %s', this.config.env, type);
313
- Log.coreLogger.info('[ee-core] App running at: %s', url);
314
- if (load == 'file') {
315
- this.mainWindow.loadFile(url, mainServer.options)
316
- .then()
317
- .catch((err)=>{
318
- Log.coreLogger.error(`[ee-core] Please check the ${url} !`);
319
- });
320
- } else {
321
- this.mainWindow.loadURL(url, mainServer.options)
322
- .then()
323
- .catch((err)=>{
324
- Log.coreLogger.error(`[ee-core] Please check the ${url} !`);
325
- });
326
- }
327
- }
328
-
329
- /**
330
- * loading page
331
- */
332
- _loadingPage(name) {
333
- if (!UtilsHelper.fileIsExist(name)) {
334
- return
335
- }
336
- this.mainWindow.loadFile(name);
337
- }
338
-
339
- /**
340
- * electron app退出
341
- */
342
- async appQuit() {
343
- await this.beforeClose();
344
- CoreElectronApp.quit();
345
- }
346
-
347
- /**
348
- * 加载插件
349
- */
350
- async _loderAddons() {
351
- this.loader.loadAddons();
352
-
353
- // 注册主窗口Contents id
354
- const addonsCfg = this.config.addons;
355
- if (addonsCfg.window.enable && Ps.isFrameworkMode()) {
356
- const win = this.mainWindow;
357
- const addonWindow = this.addon.window;
358
- addonWindow.registerWCid('main', win.webContents.id);
359
- }
360
- }
361
-
362
- /**
363
- * 预加载模块
364
- */
365
- async _loderPreload() {
366
- let filepath = this.loader.resolveModule(path.join(this.config.baseDir, 'preload', 'index'));
367
- if (!filepath) return;
368
- const fileObj = this.loader.loadFile(filepath);
369
- if (is.function(fileObj) && !is.generatorFunction(fileObj) && !is.asyncFunction(fileObj)) {
370
- fileObj();
371
- } else if (is.asyncFunction(fileObj)) {
372
- await fileObj();
373
- }
374
- }
375
-
376
- /**
377
- * module模式初始化
378
- */
379
- async InitModuleMode() {
380
- if (!Ps.isModuleMode()) return;
381
-
382
- await this._loderAddons();
383
-
384
- await this._loderPreload();
385
- }
386
-
387
- /**
388
- * electron app已经准备好,主窗口还未创建
389
- */
390
- async electronAppReady() {
391
- // do some things
392
- }
393
-
394
- /**
395
- * 主应用窗口已经创建
396
- */
397
- async windowReady() {
398
- // do some things
399
- }
400
-
401
- /**
402
- * app关闭之前
403
- */
404
- async beforeClose() {
405
- // do some things
406
- }
407
- }
408
-
409
- module.exports = EeApp;
package/ee/index.js DELETED
@@ -1,58 +0,0 @@
1
- const Utils = require('../utils');
2
- const EEApplication = Symbol('Ee#Application');
3
- const BuiltInApp = Symbol('Ee#BuiltInApp');
4
-
5
- /**
6
- * EE
7
- */
8
- const EE = {
9
-
10
- /**
11
- * 兼容1.x版本api
12
- */
13
- get Application() {
14
- const appClass = require('./application');
15
- return appClass;
16
- },
17
-
18
- /**
19
- * 设置实例化app对象
20
- */
21
- set app(appObject) {
22
- if (!this[EEApplication]) {
23
- this[EEApplication] = appObject;
24
- }
25
- },
26
-
27
- /**
28
- * 获取实例化app对象
29
- */
30
- get app() {
31
- return this[EEApplication] || null;
32
- },
33
-
34
- /**
35
- * 设置全局this到CoreApp (eeApp)
36
- */
37
- set CoreApp(obj) {
38
- if (!this[BuiltInApp]) {
39
- this[BuiltInApp] = obj;
40
- }
41
- },
42
-
43
- /**
44
- * 获取 CoreApp (eeApp)
45
- */
46
- get CoreApp() {
47
- return this[BuiltInApp] || null;
48
- },
49
-
50
- /**
51
- * 是否加密
52
- */
53
- isEncrypt(basePath) {
54
- return Utils.isEncrypt(basePath);
55
- },
56
- }
57
-
58
- module.exports = EE;
@@ -1,186 +0,0 @@
1
- 'use strict';
2
-
3
- const path = require('path');
4
- const electron = require('electron');
5
- const jsonfile = require('jsonfile');
6
- const mkdirp = require('mkdirp');
7
-
8
- module.exports = function (options) {
9
- const app = electron.app || electron.remote.app;
10
- const screen = electron.screen || electron.remote.screen;
11
- let state;
12
- let winRef;
13
- let stateChangeTimer;
14
- const eventHandlingDelay = 100;
15
- const config = Object.assign({
16
- file: 'window-state.json',
17
- path: app.getPath('userData'),
18
- maximize: true,
19
- fullScreen: true
20
- }, options);
21
- const fullStoreFileName = path.join(config.path, config.file);
22
-
23
- function isNormal(win) {
24
- return !win.isMaximized() && !win.isMinimized() && !win.isFullScreen();
25
- }
26
-
27
- function hasBounds() {
28
- return state &&
29
- Number.isInteger(state.x) &&
30
- Number.isInteger(state.y) &&
31
- Number.isInteger(state.width) && state.width > 0 &&
32
- Number.isInteger(state.height) && state.height > 0;
33
- }
34
-
35
- function resetStateToDefault() {
36
- const displayBounds = screen.getPrimaryDisplay().bounds;
37
-
38
- // Reset state to default values on the primary display
39
- state = {
40
- width: config.defaultWidth || 800,
41
- height: config.defaultHeight || 600,
42
- x: 0,
43
- y: 0,
44
- displayBounds
45
- };
46
- }
47
-
48
- function windowWithinBounds(bounds) {
49
- return (
50
- state.x >= bounds.x &&
51
- state.y >= bounds.y &&
52
- state.x + state.width <= bounds.x + bounds.width &&
53
- state.y + state.height <= bounds.y + bounds.height
54
- );
55
- }
56
-
57
- function ensureWindowVisibleOnSomeDisplay() {
58
- const visible = screen.getAllDisplays().some(display => {
59
- return windowWithinBounds(display.bounds);
60
- });
61
-
62
- if (!visible) {
63
- // Window is partially or fully not visible now.
64
- // Reset it to safe defaults.
65
- return resetStateToDefault();
66
- }
67
- }
68
-
69
- function validateState() {
70
- const isValid = state && (hasBounds() || state.isMaximized || state.isFullScreen);
71
- if (!isValid) {
72
- state = null;
73
- return;
74
- }
75
-
76
- if (hasBounds() && state.displayBounds) {
77
- ensureWindowVisibleOnSomeDisplay();
78
- }
79
- }
80
-
81
- function updateState(win) {
82
- win = win || winRef;
83
- if (!win) {
84
- return;
85
- }
86
- // Don't throw an error when window was closed
87
- try {
88
- const winBounds = win.getBounds();
89
- if (isNormal(win)) {
90
- state.x = winBounds.x;
91
- state.y = winBounds.y;
92
- state.width = winBounds.width;
93
- state.height = winBounds.height;
94
- }
95
- state.isMaximized = win.isMaximized();
96
- state.isFullScreen = win.isFullScreen();
97
- state.displayBounds = screen.getDisplayMatching(winBounds).bounds;
98
- } catch (err) {}
99
- }
100
-
101
- function saveState(win) {
102
- // Update window state only if it was provided
103
- if (win) {
104
- updateState(win);
105
- }
106
-
107
- // Save state
108
- try {
109
- mkdirp.sync(path.dirname(fullStoreFileName));
110
- jsonfile.writeFileSync(fullStoreFileName, state);
111
- } catch (err) {
112
- // Don't care
113
- }
114
- }
115
-
116
- function stateChangeHandler() {
117
- // Handles both 'resize' and 'move'
118
- clearTimeout(stateChangeTimer);
119
- stateChangeTimer = setTimeout(updateState, eventHandlingDelay);
120
- }
121
-
122
- function closeHandler() {
123
- updateState();
124
- }
125
-
126
- function closedHandler() {
127
- // Unregister listeners and save state
128
- unmanage();
129
- saveState();
130
- }
131
-
132
- function manage(win) {
133
- if (config.maximize && state.isMaximized) {
134
- win.maximize();
135
- }
136
- if (config.fullScreen && state.isFullScreen) {
137
- win.setFullScreen(true);
138
- }
139
- win.on('resize', stateChangeHandler);
140
- win.on('move', stateChangeHandler);
141
- win.on('close', closeHandler);
142
- win.on('closed', closedHandler);
143
- winRef = win;
144
- }
145
-
146
- function unmanage() {
147
- if (winRef) {
148
- winRef.removeListener('resize', stateChangeHandler);
149
- winRef.removeListener('move', stateChangeHandler);
150
- clearTimeout(stateChangeTimer);
151
- winRef.removeListener('close', closeHandler);
152
- winRef.removeListener('closed', closedHandler);
153
- winRef = null;
154
- }
155
- }
156
-
157
- // Load previous state
158
- try {
159
- state = jsonfile.readFileSync(fullStoreFileName);
160
- } catch (err) {
161
- // Don't care
162
- }
163
-
164
- // Check state validity
165
- validateState();
166
-
167
- // Set state fallback values
168
- state = Object.assign({
169
- width: config.defaultWidth || 800,
170
- height: config.defaultHeight || 600
171
- }, state);
172
-
173
- return {
174
- get x() { return state.x; },
175
- get y() { return state.y; },
176
- get width() { return state.width; },
177
- get height() { return state.height; },
178
- get displayBounds() { return state.displayBounds; },
179
- get isMaximized() { return state.isMaximized; },
180
- get isFullScreen() { return state.isFullScreen; },
181
- saveState,
182
- unmanage,
183
- manage,
184
- resetStateToDefault
185
- };
186
- };