Skip to content

Commit

Permalink
chore(package.json,Cargo.toml): updating deps.
Browse files Browse the repository at this point in the history
doc(lib.rs): Add information about new param for `subscribeActiveWindow`
  • Loading branch information
miniben-90 committed Dec 21, 2024
1 parent ffed6b8 commit b18fac5
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ napi = { version = "2.16.13", default-features = false, features = [
"napi4",
"async",
] }
napi-derive = "2.16.12"
napi-derive = "2.16.13"
once_cell = "1.20.2"
base64 = "0.22.1"
x-win = { path = "./x-win-rs" }

[build-dependencies]
napi-build = "2.1.3"
napi-build = "2.1.4"

[profile.release]
lto = true
Expand Down
5 changes: 5 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ export declare function openWindows(): Array<WindowInfo>
export declare function openWindowsAsync(): Promise<Array<WindowInfo>>
/**
* Subscribe an observer thread to monitor changes in the active window.
* @param {function} callback - Callback function that returns the active window when it changes
* @param {number} [interval=100] - Interval between checks for changes in the active window (default: 100ms)
*
* # Example
*
Expand All @@ -185,6 +187,9 @@ export declare function openWindowsAsync(): Promise<Array<WindowInfo>>
* const c = subscribeActiveWindow((info) => {
* t.log(c, info);
* });
* const d = subscribeActiveWindow((info) => {
* t.log(c, info);
* },500);// sleep interval: 500ms
*
* unsubscribeAllActiveWindow();
* ```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"devDependencies": {
"@napi-rs/cli": "^2.18.4",
"ava": "6.2.0",
"husky": "^9.1.6"
"husky": "^9.1.7"
},
"ava": {
"timeout": "3m",
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ pub fn open_windows_async() -> AsyncTask<OpenWindowsTask> {

/**
* Subscribe an observer thread to monitor changes in the active window.
* @param {function} callback - Callback function that returns the active window when it changes
* @param {number} [interval=100] - Interval between checks for changes in the active window (default: 100ms)
*
* # Example
*
Expand All @@ -286,6 +288,9 @@ pub fn open_windows_async() -> AsyncTask<OpenWindowsTask> {
* const c = subscribeActiveWindow((info) => {
* t.log(c, info);
* });
* const d = subscribeActiveWindow((info) => {
* t.log(c, info);
* },500);// sleep interval: 500ms
*
* unsubscribeAllActiveWindow();
* ```
Expand Down
4 changes: 2 additions & 2 deletions x-win-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ windows = { version = "0.58.0", features = [
"Win32_Graphics_Gdi",
"Win32_Graphics_Imaging",
] }
png = "0.17.14"
png = "0.17.16"

[target.'cfg(target_os = "linux")'.dependencies]
xcb = { version = "1.5.0" }
Expand All @@ -51,7 +51,7 @@ serde_json = { version = "1.0.133" }
image = "0.25.5"

[target.'cfg(target_os = "macos")'.dependencies]
libc = "0.2.166"
libc = "0.2.169"
core-foundation = "0.10.0"
core-foundation-sys = "0.8.7"
core-graphics = "0.24.0"
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ __metadata:
dependencies:
"@napi-rs/cli": "npm:^2.18.4"
ava: "npm:6.2.0"
husky: "npm:^9.1.6"
husky: "npm:^9.1.7"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -783,12 +783,12 @@ __metadata:
languageName: node
linkType: hard

"husky@npm:^9.1.6":
version: 9.1.6
resolution: "husky@npm:9.1.6"
"husky@npm:^9.1.7":
version: 9.1.7
resolution: "husky@npm:9.1.7"
bin:
husky: bin.js
checksum: 10c0/705673db4a247c1febd9c5df5f6a3519106cf0335845027bb50a15fba9b1f542cb2610932ede96fd08008f6d9f49db0f15560509861808b0031cdc0e7c798bac
checksum: 10c0/35bb110a71086c48906aa7cd3ed4913fb913823715359d65e32e0b964cb1e255593b0ae8014a5005c66a68e6fa66c38dcfa8056dbbdfb8b0187c0ffe7ee3a58f
languageName: node
linkType: hard

Expand Down

0 comments on commit b18fac5

Please sign in to comment.