@aiot-toolkit/emulator 2.0.6-beta.1 → 2.0.6-beta.11

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 (36) hide show
  1. package/lib/emulatorutil/constants.d.ts +12 -6
  2. package/lib/emulatorutil/constants.js +44 -12
  3. package/lib/emulatorutil/running.js +1 -1
  4. package/lib/index.d.ts +4 -1
  5. package/lib/index.js +47 -7
  6. package/lib/instance/common.d.ts +3 -2
  7. package/lib/instance/common.js +16 -3
  8. package/lib/instance/index.js +1 -1
  9. package/lib/instance/minisound.d.ts +1 -1
  10. package/lib/instance/minisound.js +15 -7
  11. package/lib/instance/miwear.d.ts +1 -1
  12. package/lib/instance/miwear.js +12 -4
  13. package/lib/instance/pre.d.ts +1 -1
  14. package/lib/instance/pre.js +3 -1
  15. package/lib/instance/vela5.d.ts +1 -1
  16. package/lib/instance/vela5.js +12 -10
  17. package/lib/static/avdConfigIni.json +1 -1
  18. package/lib/static/proto/emulator_controller.proto +181 -26
  19. package/lib/static/proto/ui_controller_service.proto +147 -0
  20. package/lib/typing/Vvd.d.ts +4 -2
  21. package/lib/typing/Vvd.js +1 -0
  22. package/lib/vvd/grpc/index.d.ts +16 -8
  23. package/lib/vvd/grpc/index.js +125 -29
  24. package/lib/vvd/grpc/types/GrpcClient.d.ts +43 -2
  25. package/lib/vvd/grpc/types/UiControllerClient.d.ts +23 -0
  26. package/lib/vvd/grpc/types/index.d.ts +3 -0
  27. package/lib/vvd/grpc/types/index.js +38 -0
  28. package/lib/vvd/grpc/types/proto-types.d.ts +178 -0
  29. package/lib/vvd/grpc/types/proto-types.js +50 -0
  30. package/lib/vvd/index.d.ts +14 -8
  31. package/lib/vvd/index.js +157 -83
  32. package/package.json +4 -8
  33. package/lib/vvd/grpc/types/KeyEvent.d.ts +0 -19
  34. package/lib/vvd/grpc/types/KeyEvent.js +0 -20
  35. package/lib/vvd/grpc/types/MouseEvent.d.ts +0 -30
  36. /package/lib/vvd/grpc/types/{MouseEvent.js → UiControllerClient.js} +0 -0
package/lib/vvd/index.js CHANGED
@@ -62,12 +62,13 @@ exports.isHeadlessEnvironment = isHeadlessEnvironment;
62
62
  class VvdManager {
63
63
  // 需要复制的文件
64
64
  binFiles = ['system.img', 'data.img', 'coredump.core', 'vela_data.bin', 'vela_resource.bin', 'vela_system.bin'];
65
- constructor(vvdResourcePaths) {
65
+ constructor() {
66
+ let vvdResourcePaths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
66
67
  const {
67
- vvdHome: avdHome,
68
+ vvdHome,
68
69
  sdkHome
69
70
  } = vvdResourcePaths;
70
- this.vvdHome = avdHome || _constants.defaultVvdHome;
71
+ this.vvdHome = vvdHome || _constants.defaultVvdHome;
71
72
  this.sdkHome = sdkHome || _constants.defaultSDKHome;
72
73
  if (!_fs.default.existsSync(this.vvdHome)) {
73
74
  _fs.default.mkdirSync(this.vvdHome, {
@@ -99,7 +100,8 @@ class VvdManager {
99
100
  density,
100
101
  imageDir: imagePath = _constants.defaultImageHome,
101
102
  customLcdRadius,
102
- imageType
103
+ imageType,
104
+ marketName
103
105
  } = vvdParams;
104
106
  const vvdDir = _path.default.resolve(this.vvdHome, `${vvdName}.vvd`);
105
107
  const vvdIni = _path.default.resolve(this.vvdHome, `${vvdName}.ini`);
@@ -111,11 +113,11 @@ class VvdManager {
111
113
  configIniJson['abi.type'] = abiType;
112
114
  configIniJson['avd.ini.displayname'] = vvdName;
113
115
  configIniJson['hw.cpu.arch'] = arch;
114
- configIniJson['hw.lcd.shape'] = shape;
115
- configIniJson['hw.device.flavor'] = flavor;
116
- configIniJson['hw.lcd.density'] = density;
117
- configIniJson['ide.lcd.radius'] = customLcdRadius;
118
- configIniJson['ide.image.type'] = imageType;
116
+ if (shape) configIniJson['hw.lcd.shape'] = shape;
117
+ if (flavor) configIniJson['hw.device.flavor'] = flavor;
118
+ if (density) configIniJson['hw.lcd.density'] = density;
119
+ if (customLcdRadius) configIniJson['ide.lcd.radius'] = customLcdRadius;
120
+ if (imageType) configIniJson['ide.image.type'] = imageType;
119
121
  if (skin) {
120
122
  delete configIniJson['hw.lcd.height'];
121
123
  delete configIniJson['hw.lcd.width'];
@@ -129,7 +131,9 @@ class VvdManager {
129
131
  delete configIniJson['skin.name'];
130
132
  delete configIniJson['skin.path'];
131
133
  }
132
-
134
+ if (marketName) {
135
+ configIniJson['product.marketname'] = marketName;
136
+ }
133
137
  // 默认使用 'image.sysdir.2' 自定义使用 'image.sysdir.1'
134
138
  configIniJson['image.sysdir.2'] = imagePath;
135
139
  try {
@@ -180,8 +184,7 @@ class VvdManager {
180
184
  width: '',
181
185
  skin: '',
182
186
  imageDir: '',
183
- customLcdRadius: '',
184
- imageType: _Vvd.VelaImageType.REL
187
+ customLcdRadius: ''
185
188
  };
186
189
  let currVvdDir = this.getVvdDir(vvdName);
187
190
  const configIni = _path.default.resolve(currVvdDir, 'config.ini');
@@ -196,7 +199,7 @@ class VvdManager {
196
199
  vvdInfo.imageDir = config['image.sysdir.2'];
197
200
  vvdInfo.customImagePath = config['image.sysdir.1'];
198
201
  vvdInfo.customLcdRadius = config['ide.lcd.radius'];
199
- vvdInfo.imageType = config['ide.image.type'];
202
+ if (config['ide.image.type']) vvdInfo.imageType = config['ide.image.type'];
200
203
  if (vvdInfo.skin) {
201
204
  try {
202
205
  vvdInfo.skinInfo = this.getSkinInfo(vvdInfo.skin, config['skin.path']);
@@ -238,7 +241,12 @@ class VvdManager {
238
241
  const matcher = fileName.match(regex);
239
242
  if (matcher) {
240
243
  const avdName = matcher[1];
241
- const avdInfo = this.getVvdInfo(avdName);
244
+ let avdInfo;
245
+ try {
246
+ avdInfo = this.getVvdInfo(avdName);
247
+ } catch (error) {
248
+ continue;
249
+ }
242
250
  avdList.push(avdInfo);
243
251
  }
244
252
  }
@@ -362,13 +370,17 @@ class VvdManager {
362
370
  let needUpdate = false;
363
371
 
364
372
  // 检查 ramsize 调整为 1024
365
- if (config['hw.ramSize'] < 1024) {
373
+ if (config['hw.ramSize'] && typeof config['hw.ramSize'] === 'number' && config['hw.ramSize'] < 1024) {
366
374
  needUpdate = true;
367
375
  config['hw.ramSize'] = 1024;
368
376
  }
377
+ // 统一路径分隔符为 /
378
+ const normalizePath = p => p.replace(/\\/g, '/');
379
+
369
380
  // 检查皮肤路径
370
- if (config['skin.path']?.includes('.export_dev/skins')) {
371
- if (config['skin.path'].includes('.export_dev/skins/user')) {
381
+ const skinPath = config['skin.path'];
382
+ if (skinPath && normalizePath(skinPath.toString())?.includes('.export_dev/skins')) {
383
+ if (normalizePath(skinPath.toString())?.includes('.export_dev/skins/user')) {
372
384
  // 自定义的皮肤,将自定义皮肤迁移到新的 sdk 目录中
373
385
  const oldUserSkinDir = _path.default.join(_os.default.homedir(), '.export_dev/skins/user');
374
386
  const newUserSkinDir = _path.default.join(this.sdkHome, 'skins', 'user');
@@ -388,13 +400,26 @@ class VvdManager {
388
400
  }
389
401
  }
390
402
  needUpdate = true;
391
- config['skin.path'] = config['skin.path'].replace('.export_dev/skins', '.vela/sdk/skins');
403
+ config['skin.path'] = normalizePath(skinPath.toString()).replace('.export_dev/skins', '.vela/sdk/skins');
404
+ }
405
+
406
+ // 迁移 原来 user 目录中的 xiaomi_band_10
407
+ if (skinPath && normalizePath(skinPath.toString())?.endsWith('/user/xiaomi_band_10')) {
408
+ _ColorConsole.default.log('migrate user/xiaomi_band_10 to builtin/xiaomi_band_10');
409
+ config['skin.path'] = normalizePath(skinPath.toString()).replace('/user/xiaomi_band_10', '/builtin/xiaomi_band_10');
410
+ needUpdate = true;
411
+ }
412
+
413
+ // 检查 hw.cpu.ncore
414
+ if (config['hw.cpu.ncore'] && typeof config['hw.cpu.ncore'] === 'number' && config['hw.cpu.ncore'] > 2) {
415
+ needUpdate = true;
416
+ config['hw.cpu.ncore'] = 2;
392
417
  }
393
418
 
394
419
  // 检查镜像路径
395
- if (config['image.sysdir.2']?.includes('.export_dev/system-images')) {
420
+ if (config['image.sysdir.2'] && normalizePath(config['image.sysdir.2'].toString())?.includes('.export_dev/system-images')) {
396
421
  needUpdate = true;
397
- config['image.sysdir.2'] = config['image.sysdir.2'].replace('.export_dev/system-images', '.vela/sdk/system-images');
422
+ config['image.sysdir.2'] = normalizePath(config['image.sysdir.2'].toString()).replace('.export_dev/system-images', '.vela/sdk/system-images');
398
423
  }
399
424
  if (needUpdate) {
400
425
  await _promises.default.writeFile(configIni, (0, _ini.stringify)(config));
@@ -430,7 +455,7 @@ class VvdManager {
430
455
  // -fsdev local,security_model=none,id=fsdev0,path=${HOST_9PFS_DIR} \
431
456
  // -device virtio-9p-device,id=fs0,fsdev=fsdev0,mount_tag=host `
432
457
 
433
- const qemuOption = `-device virtio-snd,bus=virtio-mmio-bus.2 -allow-host-audio -semihosting`;
458
+ const qemuOption = `-device virtio-snd,bus=virtio-mmio-bus.2 -allow-host-audio -semihosting -smp 2`;
434
459
 
435
460
  // qt windows 配置
436
461
  // 在 docker,wls,等无界面平台上用 -no-window ,否则用 -qt-hide-window
@@ -452,7 +477,8 @@ class VvdManager {
452
477
  const cmd = `${emulatorBin} -vela -avd ${options.vvdName} ${serialStr} -show-kernel ${portMappingStr} ${windowOption} ${grpcStr} ${verboseOption} -qemu ${qemuOption}`;
453
478
  const vvdInfo = this.getVvdInfo(vvdName);
454
479
  await this.oldEmulatorMigrate(vvdName);
455
- if (!vvdInfo.imageDir) {
480
+ const imageDir = vvdInfo.customImagePath || vvdInfo.imageDir;
481
+ if (!imageDir) {
456
482
  const errMsg = `${vvdName} is not supported`;
457
483
  _ColorConsole.default.throw(errMsg);
458
484
  throw new Error(errMsg);
@@ -506,13 +532,33 @@ class VvdManager {
506
532
  const onErrout = options.stderrCallback || console.log;
507
533
  const e = runningVvds.find(e => e['avd.name'] === vvdName);
508
534
  const vvdInfo = this.getVvdInfo(vvdName);
535
+ const getImageType = async serial => {
536
+ if (vvdInfo.imageType) return vvdInfo.imageType;
537
+ // 如果不是通过 IDE 创建的模拟器,没有 imageType 字段,需要智能嗅探镜像类型
538
+ try {
539
+ const res = await (0, _adb.execAdbCmdAsync)(`adb -s emulator-${serial} shell uname -a`, {
540
+ timeout: 3000,
541
+ encoding: 'utf-8'
542
+ });
543
+ if (res.includes('miwear')) {
544
+ return _Vvd.VelaImageType.VELA_MIWEAR_WATCH_5;
545
+ }
546
+ if (res.includes('smartspeaker')) {
547
+ return _Vvd.VelaImageType.VELA_MIWEAR_MINISOUND_5;
548
+ }
549
+ } catch (error) {
550
+ return _Vvd.VelaImageType.VELA_WATCH_5;
551
+ }
552
+ return _Vvd.VelaImageType.VELA_WATCH_5;
553
+ };
509
554
 
510
555
  // 该模拟器已经启动,则创建一个日志流返回
511
556
  if (e) {
512
557
  // 找出来它原来使用的 debugPort
513
558
  const regex = /hostfwd=tcp:(.*?):(\d+)-10\.0\.2\.15:101/;
514
559
  const debugPort = e.cmdline?.match(regex)?.[2];
515
- const emulatorInstance = (0, _instance.findInstance)(vvdInfo.imageType, {
560
+ const imageType = await getImageType(e['port.serial']);
561
+ const emulatorInstance = (0, _instance.findInstance)(imageType, {
516
562
  serialPort: e['port.serial'],
517
563
  vvdName: vvdName,
518
564
  onStdout,
@@ -520,11 +566,16 @@ class VvdManager {
520
566
  debugPort,
521
567
  customLogger: options.customLogger
522
568
  });
569
+ const velaAgent = (0, _grpc.createGrpcClient)(e);
570
+ await velaAgent.waitForReady();
571
+ emulatorInstance.xmsStatus.resolve();
523
572
  return {
524
573
  coldBoot: false,
525
574
  emulatorInstance,
526
575
  getAgent: () => (0, _grpc.createGrpcClient)(e),
527
- grpcConfig: e
576
+ grpcConfig: e,
577
+ velaAgent,
578
+ imageType
528
579
  };
529
580
  }
530
581
 
@@ -533,65 +584,85 @@ class VvdManager {
533
584
  const spawnArgs = cmd.split(' ');
534
585
  const spawnBin = spawnArgs.shift();
535
586
  logger(`Start CMD: ${cmd}`);
536
- const InstanceCalss = (0, _instance.getInstanceClass)(vvdInfo.imageType);
537
- const func = InstanceCalss.isEmulatorStarted.bind(InstanceCalss);
538
- return new Promise((resolve, reject) => {
539
- const emulatorProcess = (0, _child_process.spawn)(spawnBin, spawnArgs, {
540
- stdio: 'pipe',
541
- shell: true,
542
- cwd: this.sdkHome
543
- });
544
- if (options.origin === _Instance.IStartOrigin.Terminal) {
545
- process.stdin.pipe(emulatorProcess.stdin);
546
- }
547
-
548
- // 利用 readline 接口可解决子进程日志换行的问题
549
- const readlines = (0, _logcat.attachReadline)(emulatorProcess, onStdout, onErrout);
550
- const emulatorStartedHandler = msg => {
551
- if (func(msg)) {
552
- const e = (0, _emulatorutil.getRunningAvdConfigByName)(vvdName);
553
- if (e) {
554
- const emulatorInstance = (0, _instance.findInstance)(vvdInfo.imageType, {
555
- serialPort: e['port.serial'],
556
- vvdName: vvdName,
557
- logcatProcess: emulatorProcess,
558
- ...readlines,
559
- onStdout,
560
- onErrout,
561
- debugPort: options.debugPort,
562
- customLogger: options.customLogger
563
- });
564
- logger(`${options.vvdName} started successfully`);
565
- readlines.stdoutReadline.off('line', emulatorStartedHandler);
566
- resolve({
567
- coldBoot: true,
568
- emulatorInstance,
569
- getAgent: () => (0, _grpc.createGrpcClient)(e),
570
- grpcConfig: e
571
- });
587
+ const {
588
+ resolve,
589
+ reject,
590
+ promise
591
+ } = Promise.withResolvers();
592
+ const emulatorProcess = (0, _child_process.spawn)(spawnBin, spawnArgs, {
593
+ stdio: 'pipe',
594
+ shell: true,
595
+ cwd: this.sdkHome
596
+ });
597
+ if (options.origin === _Instance.IStartOrigin.Terminal) {
598
+ process.stdin.pipe(emulatorProcess.stdin);
599
+ }
600
+ // 利用 readline 接口可解决子进程日志换行的问题
601
+ const readlines = (0, _logcat.attachReadline)(emulatorProcess, onStdout, onErrout);
602
+ const emulatorStartedHandler = async msg => {
603
+ if (msg.includes('INFO | Boot completed')) {
604
+ const e = (0, _emulatorutil.getRunningAvdConfigByName)(vvdName);
605
+ if (e) {
606
+ const imageType = await getImageType(e['port.serial']);
607
+ const emulatorInstance = (0, _instance.findInstance)(imageType, {
608
+ serialPort: e['port.serial'],
609
+ vvdName: vvdName,
610
+ logcatProcess: emulatorProcess,
611
+ ...readlines,
612
+ onStdout,
613
+ onErrout,
614
+ debugPort: options.debugPort,
615
+ customLogger: options.customLogger
616
+ });
617
+ readlines.stdoutReadline.off('line', emulatorStartedHandler);
618
+ const velaAgent = (0, _grpc.createGrpcClient)(e);
619
+ await velaAgent.waitForReady();
620
+ if (imageType.includes('miwear')) {
621
+ // 这个时候系统启动成功了,但是 rpk 安装程序还没准备好
622
+
623
+ const miwearXmsReadyHander = msg => {
624
+ const startedFunc = emulatorInstance.isXmsInited.bind(emulatorInstance);
625
+ if (startedFunc(msg)) {
626
+ readlines.stdoutReadline.off('line', miwearXmsReadyHander);
627
+ emulatorInstance.xmsStatus.resolve();
628
+ }
629
+ };
630
+ readlines.stdoutReadline.on('line', miwearXmsReadyHander);
572
631
  } else {
573
- reject('get emulator running config failed');
632
+ emulatorInstance.xmsStatus.resolve();
574
633
  }
634
+ logger(`${options.vvdName} started successfully`);
635
+ resolve({
636
+ coldBoot: true,
637
+ emulatorInstance,
638
+ getAgent: () => (0, _grpc.createGrpcClient)(e),
639
+ grpcConfig: e,
640
+ velaAgent,
641
+ imageType
642
+ });
643
+ } else {
644
+ reject('get emulator running config failed');
575
645
  }
576
- };
577
- readlines.stdoutReadline.on('line', emulatorStartedHandler);
646
+ }
647
+ };
648
+ readlines.stdoutReadline.on('line', emulatorStartedHandler);
578
649
 
579
- // 监听模拟器的退出事件
580
- emulatorProcess.on('exit', code => {
581
- logger(`${options.vvdName} emulator exited with code ${code}`);
582
- if (options.exitCallback) {
583
- options.exitCallback(code);
584
- }
585
- readlines.dispose();
586
- reject();
587
- });
650
+ // 监听模拟器的退出事件
651
+ emulatorProcess.on('exit', code => {
652
+ logger(`${options.vvdName} emulator exited with code ${code}`);
653
+ if (options.exitCallback) {
654
+ options.exitCallback(code);
655
+ }
656
+ readlines.dispose();
657
+ reject();
658
+ });
588
659
 
589
- // 监听模拟器的错误事件
590
- emulatorProcess.on('error', err => {
591
- readlines.dispose();
592
- reject(err);
593
- });
660
+ // 监听模拟器的错误事件
661
+ emulatorProcess.on('error', err => {
662
+ readlines.dispose();
663
+ reject(err);
594
664
  });
665
+ return promise;
595
666
  }
596
667
  stopVvd(name) {
597
668
  let timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10 * 1000;
@@ -767,14 +838,17 @@ class VvdManager {
767
838
  */
768
839
  async downloadSDK(opt) {
769
840
  const updateList = opt.force ? Object.values(_Vvd.SDKParts) : await this.hasSDKPartUpdate();
770
- let urls = updateList.map(t => ({
771
- name: t,
772
- url: (0, _constants.getSDKPartDownloadUrl)(t)
773
- }));
841
+ let urls = [];
842
+ for (const t of updateList) {
843
+ urls.push({
844
+ name: t,
845
+ url: await (0, _constants.getSDKPartDownloadUrl)(t)
846
+ });
847
+ }
774
848
  if (opt.imageTypeArr) {
775
849
  for (const imgType of opt.imageTypeArr) {
776
850
  const needsUpdate = await this.isLocalImageNeedUpdate(imgType);
777
- const downloadUrl = (0, _constants.getImageDownloadUrl)()[imgType];
851
+ const downloadUrl = (await (0, _constants.getImageDownloadUrl)())[imgType];
778
852
  // 需要更新并且urls中不存在则添加
779
853
  if (needsUpdate && urls.findIndex(u => u.url === downloadUrl) < 0) {
780
854
  urls.push({
@@ -836,7 +910,7 @@ class VvdManager {
836
910
 
837
911
  /** 下载vela系统镜像 */
838
912
  async downloadImage(imageId, opt) {
839
- const downloadUrls = (0, _constants.getImageDownloadUrl)();
913
+ const downloadUrls = await (0, _constants.getImageDownloadUrl)();
840
914
  const u = downloadUrls[imageId];
841
915
  const downloader = await (await ipull).downloadFile({
842
916
  url: u,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiot-toolkit/emulator",
3
- "version": "2.0.6-beta.1",
3
+ "version": "2.0.6-beta.11",
4
4
  "description": "vela emulator tool.",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -23,10 +23,6 @@
23
23
  "type": "git",
24
24
  "url": ""
25
25
  },
26
- "author": {
27
- "name": "juancao816",
28
- "email": "caojuan2019@163.com"
29
- },
30
26
  "engines": {
31
27
  "node": ">=12.0"
32
28
  },
@@ -36,10 +32,10 @@
36
32
  "emulator"
37
33
  ],
38
34
  "dependencies": {
39
- "@aiot-toolkit/shared-utils": "2.0.6-beta.1",
35
+ "@aiot-toolkit/shared-utils": "2.0.6-beta.11",
40
36
  "@grpc/grpc-js": "^1.13.3",
41
37
  "@grpc/proto-loader": "^0.7.13",
42
- "@miwt/adb": "0.10.1",
38
+ "@miwt/adb": "0.10.5",
43
39
  "adm-zip": "^0.5.16",
44
40
  "dayjs": "^1.11.12",
45
41
  "find-process": "^1.4.7",
@@ -53,5 +49,5 @@
53
49
  "@types/adm-zip": "^0.5.5",
54
50
  "@types/ini": "^4.1.1"
55
51
  },
56
- "gitHead": "892743ccc51408960e6cee86675538501b3e47f1"
52
+ "gitHead": "acecf0ae5d6991619051dbbeda770a602f215dd6"
57
53
  }
@@ -1,19 +0,0 @@
1
- export declare enum KeyEventType {
2
- KEYDOWN = 0,
3
- KEYUP = 1,
4
- KEYPRESS = 2
5
- }
6
- export declare enum KeyCodeType {
7
- USB = 0,
8
- EVDEV = 1,
9
- XKB = 2,
10
- WIN = 3,
11
- MAC = 4
12
- }
13
- export interface GrpcKeyboardEvent {
14
- codeType?: KeyCodeType;
15
- eventType?: KeyEventType;
16
- keyCode?: number | string;
17
- key?: string;
18
- text?: string;
19
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.KeyEventType = exports.KeyCodeType = void 0;
7
- let KeyEventType = exports.KeyEventType = /*#__PURE__*/function (KeyEventType) {
8
- KeyEventType[KeyEventType["KEYDOWN"] = 0] = "KEYDOWN";
9
- KeyEventType[KeyEventType["KEYUP"] = 1] = "KEYUP";
10
- KeyEventType[KeyEventType["KEYPRESS"] = 2] = "KEYPRESS";
11
- return KeyEventType;
12
- }({});
13
- let KeyCodeType = exports.KeyCodeType = /*#__PURE__*/function (KeyCodeType) {
14
- KeyCodeType[KeyCodeType["USB"] = 0] = "USB";
15
- KeyCodeType[KeyCodeType["EVDEV"] = 1] = "EVDEV";
16
- KeyCodeType[KeyCodeType["XKB"] = 2] = "XKB";
17
- KeyCodeType[KeyCodeType["WIN"] = 3] = "WIN";
18
- KeyCodeType[KeyCodeType["MAC"] = 4] = "MAC";
19
- return KeyCodeType;
20
- }({});
@@ -1,30 +0,0 @@
1
- export interface MouseEvent {
2
- /**
3
- * The horizontal coordinate. This is the physical location on the
4
- * screen For example 0 indicates the leftmost coordinate.
5
- */
6
- x?: number;
7
- /**
8
- * The vertical coordinate. This is the physical location on the screen
9
- * For example 0 indicates the top left coordinate.
10
- */
11
- y?: number;
12
- /**
13
- * Indicates which buttons are pressed.
14
- * 0: No button was pressed
15
- * 1: Primary button (left)
16
- * 2: Secondary button (right)
17
- */
18
- buttons?: number;
19
- /**
20
- * The display device where the mouse event occurred.
21
- * Omitting or using the value 0 indicates the main display.
22
- */
23
- display?: number;
24
- }
25
- export interface MouseEventOutput {
26
- x: number;
27
- y: number;
28
- buttons: number;
29
- display: number;
30
- }