@aspiresys/visor 1.1.4 → 1.1.6
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.
- package/dist/app.js +4 -4
- package/dist/display.d.ts +1 -0
- package/dist/display.js +16 -0
- package/dist/index.d.ts +800 -789
- package/dist/index.js +817 -808
- package/dist/matcher.js +16 -9
- package/dist/mouse.js +2 -4
- package/dist/ocr.js +12 -13
- package/dist/screen.js +1 -1
- package/dist/text.js +17 -11
- package/package.json +2 -1
package/dist/app.js
CHANGED
|
@@ -50,7 +50,7 @@ async function openApp(target) {
|
|
|
50
50
|
try {
|
|
51
51
|
(0, logger_1.log)(`[APP] Opening directly: ${target}`);
|
|
52
52
|
(0, child_process_1.exec)(`start "" "${target}"`);
|
|
53
|
-
await new Promise(r => setTimeout(r, 5000));
|
|
53
|
+
await new Promise((r) => setTimeout(r, 5000));
|
|
54
54
|
(0, logger_1.log)(`[APP] Opened directly: ${target}`);
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
@@ -66,7 +66,7 @@ async function openApp(target) {
|
|
|
66
66
|
const firstPath = resolved.split("\n")[0].trim();
|
|
67
67
|
(0, logger_1.log)(`[APP] Resolved path: ${firstPath}`);
|
|
68
68
|
(0, child_process_1.exec)(`start "" "${firstPath}"`);
|
|
69
|
-
await new Promise(r => setTimeout(r, 5000));
|
|
69
|
+
await new Promise((r) => setTimeout(r, 5000));
|
|
70
70
|
(0, logger_1.log)(`[APP] Launch successful`);
|
|
71
71
|
}
|
|
72
72
|
catch {
|
|
@@ -88,8 +88,8 @@ async function openApp(target) {
|
|
|
88
88
|
async function closeApp(processName) {
|
|
89
89
|
return new Promise((resolve, reject) => {
|
|
90
90
|
const command = `taskkill /IM "${processName}" /F`;
|
|
91
|
-
|
|
92
|
-
(0, child_process_1.exec)(command, error => {
|
|
91
|
+
(0, logger_1.log)(`[APP] Closing: ${processName}`);
|
|
92
|
+
(0, child_process_1.exec)(command, (error) => {
|
|
93
93
|
if (error) {
|
|
94
94
|
reject(error);
|
|
95
95
|
return;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getWindowsScaleFactor(): number;
|
package/dist/display.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWindowsScaleFactor = getWindowsScaleFactor;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
function getWindowsScaleFactor() {
|
|
6
|
+
try {
|
|
7
|
+
const output = (0, child_process_1.execSync)('reg query "HKCU\\Control Panel\\Desktop\\WindowMetrics" /v AppliedDPI', { encoding: "utf8" });
|
|
8
|
+
const match = output.match(/AppliedDPI\s+REG_DWORD\s+0x([0-9a-f]+)/i);
|
|
9
|
+
if (match) {
|
|
10
|
+
const dpi = parseInt(match[1], 16);
|
|
11
|
+
return dpi / 96;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
catch (e) { }
|
|
15
|
+
return 1;
|
|
16
|
+
}
|