UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

45 lines (44 loc) • 3.11 kB
"use strict"; // Licensed to the Software Freedom Conservancy (SFC) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The SFC licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. Object.defineProperty(exports, "__esModule", { value: true }); exports.Speculation = void 0; // DO NOT EDIT! This file is generated by javascript/selenium-webdriver/generate_bidi.mjs. // Regenerate with: `bazel build //javascript/selenium-webdriver:create-bidi-src` // Built from the WebDriver BiDi CDDL spec (v1.0). // Source: https://github.com/w3c/webref/tree/main/ed/cddl const record_js_1 = require("../serialization/record.js"); const enum_js_1 = require("../serialization/enum.js"); const domain_js_1 = require("../domain.js"); const SpeculationPreloadingStatusEnum = (0, enum_js_1.defineEnum)('speculation.PreloadingStatus', ["pending", "ready", "success", "failure"]); const SpeculationPrefetchStatusUpdated = (0, record_js_1.defineRecord)('speculation.PrefetchStatusUpdated', [{ "name": "method", "wire": "method", "required": true, "type": { "const": "speculation.prefetchStatusUpdated" } }, { "name": "params", "wire": "params", "required": true, "type": { "ref": "speculation.PrefetchStatusUpdatedParameters" } }]); const SpeculationPrefetchStatusUpdatedParameters = (0, record_js_1.defineRecord)('speculation.PrefetchStatusUpdatedParameters', [{ "name": "context", "wire": "context", "required": true, "type": { "primitive": "string" } }, { "name": "url", "wire": "url", "required": true, "type": { "primitive": "string" } }, { "name": "status", "wire": "status", "required": true, "type": { "ref": "speculation.PreloadingStatus" } }]); // --- Implementation --- /** * This is an unsupported API. No compatibility guarantees are provided. * It tracks the W3C WebDriver BiDi specification directly. As the specification * evolves, this API will change or be removed without prior notice. */ class Speculation extends domain_js_1.Domain { static async create(driver) { return new Speculation(await domain_js_1.Domain.connect(driver), domain_js_1.DOMAIN_TOKEN); } } exports.Speculation = Speculation; /** @see https://w3c.github.io/webdriver-bidi/#event-speculation-prefetchStatusUpdated */ Speculation.PREFETCH_STATUS_UPDATED = (0, domain_js_1.event)('speculation.prefetchStatusUpdated', SpeculationPrefetchStatusUpdatedParameters); Speculation.PreloadingStatus = Object.freeze({ PENDING: "pending", READY: "ready", SUCCESS: "success", FAILURE: "failure" });