Skip to content

Commit

Permalink
feat: 升级依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
nashaofu committed Aug 25, 2024
1 parent a8d8157 commit e88facd
Show file tree
Hide file tree
Showing 5 changed files with 559 additions and 273 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ crate-type = ["cdylib"]

[dependencies]
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
napi = { version = "2.13", default-features = false, features = ["napi4"] }
napi-derive = "2.13"
xcap = "0.0.11"
napi = { version = "2.16", default-features = false, features = ["napi4"] }
napi-derive = "2.16"
xcap = "0.0.13"

[build-dependencies]
napi-build = "2.1.3"
Expand Down
6 changes: 3 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/* auto-generated by NAPI-RS */

export class Image {
export declare class Image {
readonly width: number
readonly height: number
cropSync(x: number, y: number, width: number, height: number): Image
Expand All @@ -17,7 +17,7 @@ export class Image {
toRawSync(copyOutputData?: boolean | undefined | null): Buffer
toRaw(copyOutputData?: boolean | undefined | null): Promise<Buffer>
}
export class Monitor {
export declare class Monitor {
/** Unique identifier associated with the screen. */
readonly id: number
/** Unique identifier associated with the screen. */
Expand All @@ -43,7 +43,7 @@ export class Monitor {
captureImageSync(): Image
captureImage(): Promise<Image>
}
export class Window {
export declare class Window {
/** The window id */
readonly id: number
/** The window app name */
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-screenshots",
"version": "0.2.1",
"version": "0.2.2",
"main": "index.js",
"types": "index.d.ts",
"files": [
Expand Down Expand Up @@ -36,7 +36,7 @@
"timeout": "3m"
},
"devDependencies": {
"@napi-rs/cli": "^2.16.3",
"@napi-rs/cli": "^2.18.4",
"ava": "^5.3.1"
}
}
2 changes: 2 additions & 0 deletions src/async_capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ pub enum AsyncCapture {
Window(XCapWindow),
}

unsafe impl Send for AsyncCapture {}

#[napi]
impl Task for AsyncCapture {
type Output = RgbaImage;
Expand Down
Loading

0 comments on commit e88facd

Please sign in to comment.