@miniben90/x-win 2.0.3 → 2.1.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.
- package/index.d.ts +9 -1
- package/package.json +10 -10
package/index.d.ts
CHANGED
|
@@ -168,6 +168,8 @@ export declare function openWindows(): Array<WindowInfo>
|
|
|
168
168
|
export declare function openWindowsAsync(): Promise<Array<WindowInfo>>
|
|
169
169
|
/**
|
|
170
170
|
* Subscribe an observer thread to monitor changes in the active window.
|
|
171
|
+
* @param {function} callback - Callback function that returns the active window when it changes
|
|
172
|
+
* @param {number} [interval=100] - Interval between checks for changes in the active window (default: 100ms)
|
|
171
173
|
*
|
|
172
174
|
* # Example
|
|
173
175
|
*
|
|
@@ -185,6 +187,9 @@ export declare function openWindowsAsync(): Promise<Array<WindowInfo>>
|
|
|
185
187
|
* const c = subscribeActiveWindow((info) => {
|
|
186
188
|
* t.log(c, info);
|
|
187
189
|
* });
|
|
190
|
+
* const d = subscribeActiveWindow((info) => {
|
|
191
|
+
* t.log(c, info);
|
|
192
|
+
* },500);// sleep interval: 500ms
|
|
188
193
|
*
|
|
189
194
|
* unsubscribeAllActiveWindow();
|
|
190
195
|
* ```
|
|
@@ -203,12 +208,15 @@ export declare function openWindowsAsync(): Promise<Array<WindowInfo>>
|
|
|
203
208
|
* const c = subscribeActiveWindow((info) => {
|
|
204
209
|
* t.log(c, info);
|
|
205
210
|
* });
|
|
211
|
+
* const d = subscribeActiveWindow((info) => {
|
|
212
|
+
* t.log(c, info);
|
|
213
|
+
* },500);// sleep interval: 500ms
|
|
206
214
|
*
|
|
207
215
|
* unsubscribeAllActiveWindow();
|
|
208
216
|
* ```
|
|
209
217
|
*
|
|
210
218
|
*/
|
|
211
|
-
export declare function subscribeActiveWindow(callback: (info: WindowInfo) => void): number
|
|
219
|
+
export declare function subscribeActiveWindow(callback: (info: WindowInfo) => void, interval?: number): number
|
|
212
220
|
/**
|
|
213
221
|
* Terminate and unsubscribe a specific observer using their ID.
|
|
214
222
|
*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miniben90/x-win",
|
|
3
3
|
"description": "This package allows you to retrieve precise information about active and open windows on Windows, MacOS, and Linux. You can obtain the position, size, title, and other memory of windows.",
|
|
4
|
-
"version": "2.0
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@napi-rs/cli": "^2.18.4",
|
|
49
49
|
"ava": "6.2.0",
|
|
50
|
-
"husky": "^9.1.
|
|
50
|
+
"husky": "^9.1.7"
|
|
51
51
|
},
|
|
52
52
|
"ava": {
|
|
53
53
|
"timeout": "3m",
|
|
@@ -77,13 +77,13 @@
|
|
|
77
77
|
},
|
|
78
78
|
"packageManager": "yarn@4.5.0",
|
|
79
79
|
"optionalDependencies": {
|
|
80
|
-
"@miniben90/x-win-win32-x64-msvc": "2.0
|
|
81
|
-
"@miniben90/x-win-darwin-x64": "2.0
|
|
82
|
-
"@miniben90/x-win-linux-x64-gnu": "2.0
|
|
83
|
-
"@miniben90/x-win-darwin-arm64": "2.0
|
|
84
|
-
"@miniben90/x-win-win32-arm64-msvc": "2.0
|
|
85
|
-
"@miniben90/x-win-win32-ia32-msvc": "2.0
|
|
86
|
-
"@miniben90/x-win-darwin-universal": "2.0
|
|
87
|
-
"@miniben90/x-win-linux-x64-musl": "2.0
|
|
80
|
+
"@miniben90/x-win-win32-x64-msvc": "2.1.0",
|
|
81
|
+
"@miniben90/x-win-darwin-x64": "2.1.0",
|
|
82
|
+
"@miniben90/x-win-linux-x64-gnu": "2.1.0",
|
|
83
|
+
"@miniben90/x-win-darwin-arm64": "2.1.0",
|
|
84
|
+
"@miniben90/x-win-win32-arm64-msvc": "2.1.0",
|
|
85
|
+
"@miniben90/x-win-win32-ia32-msvc": "2.1.0",
|
|
86
|
+
"@miniben90/x-win-darwin-universal": "2.1.0",
|
|
87
|
+
"@miniben90/x-win-linux-x64-musl": "2.1.0"
|
|
88
88
|
}
|
|
89
89
|
}
|