Skip to content

Commit

Permalink
Add clip options
Browse files Browse the repository at this point in the history
  • Loading branch information
krasun committed Jan 27, 2024
1 parent c1f9968 commit ac08037
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "screenshotone-api-sdk",
"homepage": "https://screenshotone.com",
"version": "1.1.8",
"version": "1.1.9",
"description": "Use ScreenshotOne.com API to generate screenshots of any website.",
"repository": {
"type": "git",
Expand Down
36 changes: 36 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,42 @@ export class TakeOptions {
return this;
}

/**
* The clip_x option specifies only the top coordinate (x) of the area to clip.
*/
clipX(clipX: number): TakeOptions {
this.put("clip_x", clipX.toString());

return this;
}

/**
* The clip_y option specifies only the top coordinate (y) of the area to clip.
*/
clipY(clipY: number): TakeOptions {
this.put("clip_y", clipY.toString());

return this;
}

/**
* The clip_width option specifies only the width of the area to clip.
*/
clipWidth(clipWidth: number): TakeOptions {
this.put("clip_width", clipWidth.toString());

return this;
}

/**
* The clip_height option specifies only the width of the area to clip.
*/
clipHeight(clipHeight: number): TakeOptions {
this.put("clip_height", clipHeight.toString());

return this;
}

/**
* Sets the device scale factor. Acceptable value is one of: 1, 2 or 3.
*/
Expand Down

0 comments on commit ac08037

Please sign in to comment.