screenshotone-api-sdk
Advanced tools
Comparing version 1.1.15 to 1.1.16
@@ -83,3 +83,3 @@ import APIError from "./errors"; | ||
*/ | ||
selector(selector: string): this; | ||
selector(selector: string): TakeOptions; | ||
/** | ||
@@ -89,13 +89,14 @@ * Available response types: | ||
* empty — return only status or error. It is suitable when you want to upload the screenshot to storage and don't care about the results. It also speeds up the response since there are no networking costs involved. | ||
* json — A method returns the response in the JSON format, but it is only suitable if you use options that are effective for JSON. By default, the JSON response will be empty. But for example, when you use caching, the JSON will be populated with additional data. | ||
* The default value is by_format. | ||
*/ | ||
responseType(responseType: string): this; | ||
responseType(responseType: string): TakeOptions; | ||
/** | ||
* It determines the behavior of what to do when selector is not found. | ||
*/ | ||
errorOnSelectorNotFound(errorOn: boolean): this; | ||
errorOnSelectorNotFound(errorOn: boolean): TakeOptions; | ||
/** | ||
* Capture beyond the viewport. | ||
*/ | ||
captureBeyondViewport(beyond: boolean): this; | ||
captureBeyondViewport(beyond: boolean): TakeOptions; | ||
/** | ||
@@ -106,3 +107,3 @@ * When reduced_motion set to `true`, | ||
*/ | ||
reducedMotion(darkMode: boolean): TakeOptions; | ||
reducedMotion(reducedMotion: boolean): TakeOptions; | ||
/** | ||
@@ -128,3 +129,3 @@ * If you want to request the page and it is supported to be rendered for printers, specify `print`. | ||
/** | ||
* The scripts_wain_until option allows you to wait until a given | ||
* The scripts_wait_until option allows you to wait until a given | ||
* set of events after the scripts were executed. | ||
@@ -141,7 +142,7 @@ * It accepts the same values as wait_until and can have multiple values: | ||
*/ | ||
styles(styles: string): this; | ||
styles(styles: string): TakeOptions; | ||
/** | ||
* Scripts specifies custom scripts for the page. | ||
*/ | ||
scripts(scripts: string): this; | ||
scripts(scripts: string): TakeOptions; | ||
/** | ||
@@ -156,3 +157,3 @@ * Renders the full page. | ||
/** | ||
* Sets response format, one of: "png", "jpeg", "webp" or "jpg". | ||
* Sets response format, one of: "png", "jpeg", "webp", "jpg", "gif", "jp2", "tiff", "avif", "heif", "pdf", "html". | ||
*/ | ||
@@ -185,3 +186,3 @@ format(format: string): TakeOptions; | ||
*/ | ||
ipCountryCode(format: string): TakeOptions; | ||
ipCountryCode(countryCode: string): TakeOptions; | ||
/** | ||
@@ -379,2 +380,94 @@ * Renders image with the specified quality. Available for the next formats: "jpeg" ("jpg"), "webp". | ||
storageClass(storageClass: string): TakeOptions; | ||
/** | ||
* Sets the image width for thumbnail creation. | ||
*/ | ||
imageWidth(width: number): TakeOptions; | ||
/** | ||
* Sets the image height for thumbnail creation. | ||
*/ | ||
imageHeight(height: number): TakeOptions; | ||
/** | ||
* Sets whether to request GPU rendering. | ||
*/ | ||
requestGpuRendering(request: boolean): TakeOptions; | ||
/** | ||
* Sets whether to print background for PDF. | ||
*/ | ||
pdfPrintBackground(print: boolean): TakeOptions; | ||
/** | ||
* Sets whether to fit PDF to one page. | ||
*/ | ||
pdfFitOnePage(fit: boolean): TakeOptions; | ||
/** | ||
* Sets the OpenAI API key for vision integration. | ||
*/ | ||
openAiApiKey(key: string): TakeOptions; | ||
/** | ||
* Sets the vision prompt for OpenAI integration. | ||
*/ | ||
visionPrompt(prompt: string): TakeOptions; | ||
/** | ||
* Sets the maximum tokens for OpenAI vision response. | ||
*/ | ||
visionMaxTokens(tokens: number): TakeOptions; | ||
/** | ||
* Sets whether to bypass Content Security Policy. | ||
*/ | ||
bypassCsp(bypass: boolean): TakeOptions; | ||
/** | ||
* Sets whether to wait for a specific selector. | ||
*/ | ||
waitForSelector(selector: string): TakeOptions; | ||
/** | ||
* Sets whether to return the storage location. | ||
*/ | ||
storageReturnLocation(return_location: boolean): TakeOptions; | ||
/** | ||
* Sets whether to include image size metadata. | ||
*/ | ||
metadataImageSize(include: boolean): TakeOptions; | ||
/** | ||
* Sets whether to include fonts metadata. | ||
*/ | ||
metadataFonts(include: boolean): TakeOptions; | ||
/** | ||
* Sets whether to include Open Graph metadata. | ||
*/ | ||
metadataOpenGraph(include: boolean): TakeOptions; | ||
/** | ||
* Sets whether to include page title metadata. | ||
*/ | ||
metadataPageTitle(include: boolean): TakeOptions; | ||
/** | ||
* Sets whether to include content metadata. | ||
*/ | ||
metadataContent(include: boolean): TakeOptions; | ||
/** | ||
* Sets whether to include HTTP response status code metadata. | ||
*/ | ||
metadataHttpResponseStatusCode(include: boolean): TakeOptions; | ||
/** | ||
* Sets whether to include HTTP response headers metadata. | ||
*/ | ||
metadataHttpResponseHeaders(include: boolean): TakeOptions; | ||
/** | ||
* Sets whether to execute the request asynchronously. | ||
*/ | ||
async(isAsync: boolean): TakeOptions; | ||
/** | ||
* Sets the webhook URL for asynchronous requests. | ||
*/ | ||
webhookUrl(url: string): TakeOptions; | ||
/** | ||
* Sets whether to sign the webhook request. | ||
*/ | ||
webhookSign(sign: boolean): TakeOptions; | ||
/** | ||
* Sets the text to check for in the content to force request failure. | ||
*/ | ||
failIfContentContains(text: string): TakeOptions; | ||
/** | ||
* Sets whether to fail if GPU rendering fails. | ||
*/ | ||
failIfGpuRenderingFails(fail: boolean): TakeOptions; | ||
toQuery(): URLSearchParams; | ||
@@ -643,3 +736,79 @@ } | ||
ignoreHostErrors(ignore: boolean): AnimateOptions; | ||
/** | ||
* Sets whether to request GPU rendering. | ||
*/ | ||
requestGpuRendering(request: boolean): AnimateOptions; | ||
/** | ||
* Sets whether to bypass Content Security Policy. | ||
*/ | ||
bypassCsp(bypass: boolean): AnimateOptions; | ||
/** | ||
* Sets whether to wait for a specific selector. | ||
*/ | ||
waitForSelector(selector: string): AnimateOptions; | ||
/** | ||
* Sets whether to return the storage location. | ||
*/ | ||
storageReturnLocation(return_location: boolean): AnimateOptions; | ||
/** | ||
* Sets whether to execute the request asynchronously. | ||
*/ | ||
async(isAsync: boolean): AnimateOptions; | ||
/** | ||
* Sets the webhook URL for asynchronous requests. | ||
*/ | ||
webhookUrl(url: string): AnimateOptions; | ||
/** | ||
* Sets whether to sign the webhook request. | ||
*/ | ||
webhookSign(sign: boolean): AnimateOptions; | ||
/** | ||
* Sets the text to check for in the content to force request failure. | ||
*/ | ||
failIfContentContains(text: string): AnimateOptions; | ||
/** | ||
* Sets whether to fail if GPU rendering fails. | ||
*/ | ||
failIfGpuRenderingFails(fail: boolean): AnimateOptions; | ||
/** | ||
* Sets the width of the animation. | ||
*/ | ||
width(width: number): AnimateOptions; | ||
/** | ||
* Sets the height of the animation. | ||
*/ | ||
height(height: number): AnimateOptions; | ||
/** | ||
* Sets the aspect ratio of the animation. | ||
*/ | ||
aspectRatio(ratio: string): AnimateOptions; | ||
/** | ||
* Sets the scroll easing effect. | ||
*/ | ||
scrollEasing(easing: string): AnimateOptions; | ||
/** | ||
* Sets whether to navigate while scrolling and record the new opened page. | ||
*/ | ||
scrollTryNavigate(tryNavigate: boolean): AnimateOptions; | ||
/** | ||
* Sets when to navigate after scrolling (in milliseconds). | ||
*/ | ||
scrollNavigateAfter(duration: number): AnimateOptions; | ||
/** | ||
* Sets the URL to navigate to while scrolling. | ||
*/ | ||
scrollNavigateToURL(url: string): AnimateOptions; | ||
/** | ||
* Sets the link hints for navigation while scrolling. | ||
*/ | ||
scrollNavigateLinkHints(...hints: string[]): AnimateOptions; | ||
/** | ||
* Sets the scroll back algorithm. | ||
*/ | ||
scrollBackAlgorithm(algorithm: string): AnimateOptions; | ||
/** | ||
* Sets when to stop scrolling after the specified duration in milliseconds. | ||
*/ | ||
scrollStopAfterDuration(duration: number): AnimateOptions; | ||
toQuery(): URLSearchParams; | ||
} |
307
dist/main.js
@@ -205,2 +205,3 @@ "use strict"; | ||
* empty — return only status or error. It is suitable when you want to upload the screenshot to storage and don't care about the results. It also speeds up the response since there are no networking costs involved. | ||
* json — A method returns the response in the JSON format, but it is only suitable if you use options that are effective for JSON. By default, the JSON response will be empty. But for example, when you use caching, the JSON will be populated with additional data. | ||
* The default value is by_format. | ||
@@ -231,4 +232,4 @@ */ | ||
*/ | ||
reducedMotion(darkMode) { | ||
this.put("reduced_motion", darkMode ? "true" : "false"); | ||
reducedMotion(reducedMotion) { | ||
this.put("reduced_motion", reducedMotion ? "true" : "false"); | ||
return this; | ||
@@ -265,3 +266,3 @@ } | ||
/** | ||
* The scripts_wain_until option allows you to wait until a given | ||
* The scripts_wait_until option allows you to wait until a given | ||
* set of events after the scripts were executed. | ||
@@ -307,3 +308,3 @@ * It accepts the same values as wait_until and can have multiple values: | ||
/** | ||
* Sets response format, one of: "png", "jpeg", "webp" or "jpg". | ||
* Sets response format, one of: "png", "jpeg", "webp", "jpg", "gif", "jp2", "tiff", "avif", "heif", "pdf", "html". | ||
*/ | ||
@@ -345,4 +346,4 @@ format(format) { | ||
*/ | ||
ipCountryCode(format) { | ||
this.put("ip_country_code", format); | ||
ipCountryCode(countryCode) { | ||
this.put("ip_country_code", countryCode); | ||
return this; | ||
@@ -674,2 +675,163 @@ } | ||
} | ||
/** | ||
* Sets the image width for thumbnail creation. | ||
*/ | ||
imageWidth(width) { | ||
this.put("image_width", width.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets the image height for thumbnail creation. | ||
*/ | ||
imageHeight(height) { | ||
this.put("image_height", height.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to request GPU rendering. | ||
*/ | ||
requestGpuRendering(request) { | ||
this.put("request_gpu_rendering", request ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to print background for PDF. | ||
*/ | ||
pdfPrintBackground(print) { | ||
this.put("pdf_print_background", print ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to fit PDF to one page. | ||
*/ | ||
pdfFitOnePage(fit) { | ||
this.put("pdf_fit_one_page", fit ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the OpenAI API key for vision integration. | ||
*/ | ||
openAiApiKey(key) { | ||
this.put("openai_api_key", key); | ||
return this; | ||
} | ||
/** | ||
* Sets the vision prompt for OpenAI integration. | ||
*/ | ||
visionPrompt(prompt) { | ||
this.put("vision_prompt", prompt); | ||
return this; | ||
} | ||
/** | ||
* Sets the maximum tokens for OpenAI vision response. | ||
*/ | ||
visionMaxTokens(tokens) { | ||
this.put("vision_max_tokens", tokens.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to bypass Content Security Policy. | ||
*/ | ||
bypassCsp(bypass) { | ||
this.put("bypass_csp", bypass ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to wait for a specific selector. | ||
*/ | ||
waitForSelector(selector) { | ||
this.put("wait_for_selector", selector); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to return the storage location. | ||
*/ | ||
storageReturnLocation(return_location) { | ||
this.put("storage_return_location", return_location ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include image size metadata. | ||
*/ | ||
metadataImageSize(include) { | ||
this.put("metadata_image_size", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include fonts metadata. | ||
*/ | ||
metadataFonts(include) { | ||
this.put("metadata_fonts", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include Open Graph metadata. | ||
*/ | ||
metadataOpenGraph(include) { | ||
this.put("metadata_open_graph", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include page title metadata. | ||
*/ | ||
metadataPageTitle(include) { | ||
this.put("metadata_page_title", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include content metadata. | ||
*/ | ||
metadataContent(include) { | ||
this.put("metadata_content", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include HTTP response status code metadata. | ||
*/ | ||
metadataHttpResponseStatusCode(include) { | ||
this.put("metadata_http_response_status_code", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include HTTP response headers metadata. | ||
*/ | ||
metadataHttpResponseHeaders(include) { | ||
this.put("metadata_http_response_headers", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to execute the request asynchronously. | ||
*/ | ||
async(isAsync) { | ||
this.put("async", isAsync ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the webhook URL for asynchronous requests. | ||
*/ | ||
webhookUrl(url) { | ||
this.put("webhook_url", url); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to sign the webhook request. | ||
*/ | ||
webhookSign(sign) { | ||
this.put("webhook_sign", sign ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the text to check for in the content to force request failure. | ||
*/ | ||
failIfContentContains(text) { | ||
this.put("fail_if_content_contains", text); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to fail if GPU rendering fails. | ||
*/ | ||
failIfGpuRenderingFails(fail) { | ||
this.put("fail_if_gpu_rendering_fails", fail ? "true" : "false"); | ||
return this; | ||
} | ||
toQuery() { | ||
@@ -1135,2 +1297,135 @@ return new URLSearchParams(this.query.toString()); | ||
} | ||
/** | ||
* Sets whether to request GPU rendering. | ||
*/ | ||
requestGpuRendering(request) { | ||
this.put("request_gpu_rendering", request ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to bypass Content Security Policy. | ||
*/ | ||
bypassCsp(bypass) { | ||
this.put("bypass_csp", bypass ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to wait for a specific selector. | ||
*/ | ||
waitForSelector(selector) { | ||
this.put("wait_for_selector", selector); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to return the storage location. | ||
*/ | ||
storageReturnLocation(return_location) { | ||
this.put("storage_return_location", return_location ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to execute the request asynchronously. | ||
*/ | ||
async(isAsync) { | ||
this.put("async", isAsync ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the webhook URL for asynchronous requests. | ||
*/ | ||
webhookUrl(url) { | ||
this.put("webhook_url", url); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to sign the webhook request. | ||
*/ | ||
webhookSign(sign) { | ||
this.put("webhook_sign", sign ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the text to check for in the content to force request failure. | ||
*/ | ||
failIfContentContains(text) { | ||
this.put("fail_if_content_contains", text); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to fail if GPU rendering fails. | ||
*/ | ||
failIfGpuRenderingFails(fail) { | ||
this.put("fail_if_gpu_rendering_fails", fail ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the width of the animation. | ||
*/ | ||
width(width) { | ||
this.put("width", width.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets the height of the animation. | ||
*/ | ||
height(height) { | ||
this.put("height", height.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets the aspect ratio of the animation. | ||
*/ | ||
aspectRatio(ratio) { | ||
this.put("aspect_ratio", ratio); | ||
return this; | ||
} | ||
/** | ||
* Sets the scroll easing effect. | ||
*/ | ||
scrollEasing(easing) { | ||
this.put("scroll_easing", easing); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to navigate while scrolling and record the new opened page. | ||
*/ | ||
scrollTryNavigate(tryNavigate) { | ||
this.put("scroll_try_navigate", tryNavigate ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets when to navigate after scrolling (in milliseconds). | ||
*/ | ||
scrollNavigateAfter(duration) { | ||
this.put("scroll_navigate_after", duration.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets the URL to navigate to while scrolling. | ||
*/ | ||
scrollNavigateToURL(url) { | ||
this.put("scroll_navigate_to_url", url); | ||
return this; | ||
} | ||
/** | ||
* Sets the link hints for navigation while scrolling. | ||
*/ | ||
scrollNavigateLinkHints(...hints) { | ||
this.put("scroll_navigate_link_hints", ...hints); | ||
return this; | ||
} | ||
/** | ||
* Sets the scroll back algorithm. | ||
*/ | ||
scrollBackAlgorithm(algorithm) { | ||
this.put("scroll_back_algorithm", algorithm); | ||
return this; | ||
} | ||
/** | ||
* Sets when to stop scrolling after the specified duration in milliseconds. | ||
*/ | ||
scrollStopAfterDuration(duration) { | ||
this.put("scroll_stop_after_duration", duration.toString()); | ||
return this; | ||
} | ||
toQuery() { | ||
@@ -1137,0 +1432,0 @@ return new URLSearchParams(this.query.toString()); |
{ | ||
"name": "screenshotone-api-sdk", | ||
"homepage": "https://screenshotone.com", | ||
"version": "1.1.15", | ||
"version": "1.1.16", | ||
"description": "Use ScreenshotOne.com API to generate screenshots of any website.", | ||
@@ -6,0 +6,0 @@ "repository": { |
404
src/main.ts
@@ -253,3 +253,3 @@ import Big from "big.js"; | ||
*/ | ||
selector(selector: string) { | ||
selector(selector: string): TakeOptions { | ||
this.put("selector", selector); | ||
@@ -264,5 +264,6 @@ | ||
* empty — return only status or error. It is suitable when you want to upload the screenshot to storage and don't care about the results. It also speeds up the response since there are no networking costs involved. | ||
* json — A method returns the response in the JSON format, but it is only suitable if you use options that are effective for JSON. By default, the JSON response will be empty. But for example, when you use caching, the JSON will be populated with additional data. | ||
* The default value is by_format. | ||
*/ | ||
responseType(responseType: string) { | ||
responseType(responseType: string): TakeOptions { | ||
this.put("response_type", responseType); | ||
@@ -276,3 +277,3 @@ | ||
*/ | ||
errorOnSelectorNotFound(errorOn: boolean) { | ||
errorOnSelectorNotFound(errorOn: boolean): TakeOptions { | ||
this.put("error_on_selector_not_found", errorOn ? "true" : "false"); | ||
@@ -286,3 +287,3 @@ | ||
*/ | ||
captureBeyondViewport(beyond: boolean) { | ||
captureBeyondViewport(beyond: boolean): TakeOptions { | ||
this.put("capture_beyond_viewport", beyond ? "true" : "false"); | ||
@@ -298,4 +299,4 @@ | ||
*/ | ||
reducedMotion(darkMode: boolean): TakeOptions { | ||
this.put("reduced_motion", darkMode ? "true" : "false"); | ||
reducedMotion(reducedMotion: boolean): TakeOptions { | ||
this.put("reduced_motion", reducedMotion ? "true" : "false"); | ||
@@ -340,3 +341,3 @@ return this; | ||
/** | ||
* The scripts_wain_until option allows you to wait until a given | ||
* The scripts_wait_until option allows you to wait until a given | ||
* set of events after the scripts were executed. | ||
@@ -358,3 +359,3 @@ * It accepts the same values as wait_until and can have multiple values: | ||
*/ | ||
styles(styles: string) { | ||
styles(styles: string): TakeOptions { | ||
this.put("styles", styles); | ||
@@ -368,3 +369,3 @@ | ||
*/ | ||
scripts(scripts: string) { | ||
scripts(scripts: string): TakeOptions { | ||
this.put("scripts", scripts); | ||
@@ -394,3 +395,3 @@ | ||
/** | ||
* Sets response format, one of: "png", "jpeg", "webp" or "jpg". | ||
* Sets response format, one of: "png", "jpeg", "webp", "jpg", "gif", "jp2", "tiff", "avif", "heif", "pdf", "html". | ||
*/ | ||
@@ -438,4 +439,4 @@ format(format: string): TakeOptions { | ||
*/ | ||
ipCountryCode(format: string): TakeOptions { | ||
this.put("ip_country_code", format); | ||
ipCountryCode(countryCode: string): TakeOptions { | ||
this.put("ip_country_code", countryCode); | ||
@@ -863,2 +864,209 @@ return this; | ||
/** | ||
* Sets the image width for thumbnail creation. | ||
*/ | ||
imageWidth(width: number): TakeOptions { | ||
this.put("image_width", width.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets the image height for thumbnail creation. | ||
*/ | ||
imageHeight(height: number): TakeOptions { | ||
this.put("image_height", height.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to request GPU rendering. | ||
*/ | ||
requestGpuRendering(request: boolean): TakeOptions { | ||
this.put("request_gpu_rendering", request ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to print background for PDF. | ||
*/ | ||
pdfPrintBackground(print: boolean): TakeOptions { | ||
this.put("pdf_print_background", print ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to fit PDF to one page. | ||
*/ | ||
pdfFitOnePage(fit: boolean): TakeOptions { | ||
this.put("pdf_fit_one_page", fit ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the OpenAI API key for vision integration. | ||
*/ | ||
openAiApiKey(key: string): TakeOptions { | ||
this.put("openai_api_key", key); | ||
return this; | ||
} | ||
/** | ||
* Sets the vision prompt for OpenAI integration. | ||
*/ | ||
visionPrompt(prompt: string): TakeOptions { | ||
this.put("vision_prompt", prompt); | ||
return this; | ||
} | ||
/** | ||
* Sets the maximum tokens for OpenAI vision response. | ||
*/ | ||
visionMaxTokens(tokens: number): TakeOptions { | ||
this.put("vision_max_tokens", tokens.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to bypass Content Security Policy. | ||
*/ | ||
bypassCsp(bypass: boolean): TakeOptions { | ||
this.put("bypass_csp", bypass ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to wait for a specific selector. | ||
*/ | ||
waitForSelector(selector: string): TakeOptions { | ||
this.put("wait_for_selector", selector); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to return the storage location. | ||
*/ | ||
storageReturnLocation(return_location: boolean): TakeOptions { | ||
this.put("storage_return_location", return_location ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include image size metadata. | ||
*/ | ||
metadataImageSize(include: boolean): TakeOptions { | ||
this.put("metadata_image_size", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include fonts metadata. | ||
*/ | ||
metadataFonts(include: boolean): TakeOptions { | ||
this.put("metadata_fonts", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include Open Graph metadata. | ||
*/ | ||
metadataOpenGraph(include: boolean): TakeOptions { | ||
this.put("metadata_open_graph", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include page title metadata. | ||
*/ | ||
metadataPageTitle(include: boolean): TakeOptions { | ||
this.put("metadata_page_title", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include content metadata. | ||
*/ | ||
metadataContent(include: boolean): TakeOptions { | ||
this.put("metadata_content", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include HTTP response status code metadata. | ||
*/ | ||
metadataHttpResponseStatusCode(include: boolean): TakeOptions { | ||
this.put("metadata_http_response_status_code", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to include HTTP response headers metadata. | ||
*/ | ||
metadataHttpResponseHeaders(include: boolean): TakeOptions { | ||
this.put("metadata_http_response_headers", include ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to execute the request asynchronously. | ||
*/ | ||
async(isAsync: boolean): TakeOptions { | ||
this.put("async", isAsync ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the webhook URL for asynchronous requests. | ||
*/ | ||
webhookUrl(url: string): TakeOptions { | ||
this.put("webhook_url", url); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to sign the webhook request. | ||
*/ | ||
webhookSign(sign: boolean): TakeOptions { | ||
this.put("webhook_sign", sign ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the text to check for in the content to force request failure. | ||
*/ | ||
failIfContentContains(text: string): TakeOptions { | ||
this.put("fail_if_content_contains", text); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to fail if GPU rendering fails. | ||
*/ | ||
failIfGpuRenderingFails(fail: boolean): TakeOptions { | ||
this.put("fail_if_gpu_rendering_fails", fail ? "true" : "false"); | ||
return this; | ||
} | ||
toQuery(): URLSearchParams { | ||
@@ -1455,2 +1663,174 @@ return new URLSearchParams(this.query.toString()); | ||
/** | ||
* Sets whether to request GPU rendering. | ||
*/ | ||
requestGpuRendering(request: boolean): AnimateOptions { | ||
this.put("request_gpu_rendering", request ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to bypass Content Security Policy. | ||
*/ | ||
bypassCsp(bypass: boolean): AnimateOptions { | ||
this.put("bypass_csp", bypass ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to wait for a specific selector. | ||
*/ | ||
waitForSelector(selector: string): AnimateOptions { | ||
this.put("wait_for_selector", selector); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to return the storage location. | ||
*/ | ||
storageReturnLocation(return_location: boolean): AnimateOptions { | ||
this.put("storage_return_location", return_location ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to execute the request asynchronously. | ||
*/ | ||
async(isAsync: boolean): AnimateOptions { | ||
this.put("async", isAsync ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the webhook URL for asynchronous requests. | ||
*/ | ||
webhookUrl(url: string): AnimateOptions { | ||
this.put("webhook_url", url); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to sign the webhook request. | ||
*/ | ||
webhookSign(sign: boolean): AnimateOptions { | ||
this.put("webhook_sign", sign ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the text to check for in the content to force request failure. | ||
*/ | ||
failIfContentContains(text: string): AnimateOptions { | ||
this.put("fail_if_content_contains", text); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to fail if GPU rendering fails. | ||
*/ | ||
failIfGpuRenderingFails(fail: boolean): AnimateOptions { | ||
this.put("fail_if_gpu_rendering_fails", fail ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets the width of the animation. | ||
*/ | ||
width(width: number): AnimateOptions { | ||
this.put("width", width.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets the height of the animation. | ||
*/ | ||
height(height: number): AnimateOptions { | ||
this.put("height", height.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets the aspect ratio of the animation. | ||
*/ | ||
aspectRatio(ratio: string): AnimateOptions { | ||
this.put("aspect_ratio", ratio); | ||
return this; | ||
} | ||
/** | ||
* Sets the scroll easing effect. | ||
*/ | ||
scrollEasing(easing: string): AnimateOptions { | ||
this.put("scroll_easing", easing); | ||
return this; | ||
} | ||
/** | ||
* Sets whether to navigate while scrolling and record the new opened page. | ||
*/ | ||
scrollTryNavigate(tryNavigate: boolean): AnimateOptions { | ||
this.put("scroll_try_navigate", tryNavigate ? "true" : "false"); | ||
return this; | ||
} | ||
/** | ||
* Sets when to navigate after scrolling (in milliseconds). | ||
*/ | ||
scrollNavigateAfter(duration: number): AnimateOptions { | ||
this.put("scroll_navigate_after", duration.toString()); | ||
return this; | ||
} | ||
/** | ||
* Sets the URL to navigate to while scrolling. | ||
*/ | ||
scrollNavigateToURL(url: string): AnimateOptions { | ||
this.put("scroll_navigate_to_url", url); | ||
return this; | ||
} | ||
/** | ||
* Sets the link hints for navigation while scrolling. | ||
*/ | ||
scrollNavigateLinkHints(...hints: string[]): AnimateOptions { | ||
this.put("scroll_navigate_link_hints", ...hints); | ||
return this; | ||
} | ||
/** | ||
* Sets the scroll back algorithm. | ||
*/ | ||
scrollBackAlgorithm(algorithm: string): AnimateOptions { | ||
this.put("scroll_back_algorithm", algorithm); | ||
return this; | ||
} | ||
/** | ||
* Sets when to stop scrolling after the specified duration in milliseconds. | ||
*/ | ||
scrollStopAfterDuration(duration: number): AnimateOptions { | ||
this.put("scroll_stop_after_duration", duration.toString()); | ||
return this; | ||
} | ||
toQuery(): URLSearchParams { | ||
@@ -1457,0 +1837,0 @@ return new URLSearchParams(this.query.toString()); |
137921
3863