cloudflare
Version:
The official TypeScript library for the Cloudflare API
37 lines • 1.35 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { path } from "../../internal/utils/path.mjs";
export var BaseScreenshot = /* @__PURE__ */ (() => {
class BaseScreenshot extends APIResource {
/**
* Takes a screenshot of a webpage from provided URL or HTML. Control page loading
* with `gotoOptions` and `waitFor*` options. Customize screenshots with
* `viewport`, `fullPage`, `clip` and others.
*
* @example
* ```ts
* const screenshot =
* await client.browserRendering.screenshot.create({
* account_id: 'account_id',
* url: 'https://www.example.com/',
* });
* ```
*/
create(params, options) {
const { account_id, cacheTTL, ...body } = params;
return this._client.post(path `/accounts/${account_id}/browser-rendering/screenshot`, {
query: { cacheTTL },
body,
...options,
});
}
}
BaseScreenshot._key = Object.freeze([
'browserRendering',
'screenshot',
]);
return BaseScreenshot;
})();
export class Screenshot extends BaseScreenshot {
}
//# sourceMappingURL=screenshot.mjs.map