UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

43 lines • 1.77 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AccessibilityTree = exports.BaseAccessibilityTree = 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 BaseAccessibilityTree = /* @__PURE__ */ (() => { class BaseAccessibilityTree extends resource_1.APIResource { /** * Returns the page's accessibility tree. Use `interestingOnly` to only return * semantically meaningful nodes; use `root` to scope the tree to a * CSS-selector-anchored subtree. Control page loading with `gotoOptions` and * `waitFor*` options. * * @example * ```ts * const accessibilityTree = * await client.browserRendering.accessibilityTree.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/accessibilityTree`, { query: { cacheTTL }, body, ...options, })._thenUnwrap((obj) => obj.result); } } BaseAccessibilityTree._key = Object.freeze([ 'browserRendering', 'accessibilityTree', ]); return BaseAccessibilityTree; })(); exports.BaseAccessibilityTree = BaseAccessibilityTree; class AccessibilityTree extends BaseAccessibilityTree { } exports.AccessibilityTree = AccessibilityTree; //# sourceMappingURL=accessibility-tree.js.map