UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

42 lines • 1.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Screenshot = exports.BaseScreenshot = void 0; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../core/resource.js"); const path_1 = require("../../internal/utils/path.js"); var BaseScreenshot = /* @__PURE__ */ (() => { class BaseScreenshot extends resource_1.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((0, path_1.path) `/accounts/${account_id}/browser-rendering/screenshot`, { query: { cacheTTL }, body, ...options, }); } } BaseScreenshot._key = Object.freeze([ 'browserRendering', 'screenshot', ]); return BaseScreenshot; })(); exports.BaseScreenshot = BaseScreenshot; class Screenshot extends BaseScreenshot { } exports.Screenshot = Screenshot; //# sourceMappingURL=screenshot.js.map