"use strict"; /** * Copyright 2023 Google Inc. All rights reserved. * * Licensed 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.Target = exports.TargetType = void 0; /** * @public */ var TargetType; (function (TargetType) { TargetType["PAGE"] = "page"; TargetType["BACKGROUND_PAGE"] = "background_page"; TargetType["SERVICE_WORKER"] = "service_worker"; TargetType["SHARED_WORKER"] = "shared_worker"; TargetType["BROWSER"] = "browser"; TargetType["WEBVIEW"] = "webview"; TargetType["OTHER"] = "other"; /** * @internal */ TargetType["TAB"] = "tab"; })(TargetType || (exports.TargetType = TargetType = {})); /** * Target represents a * {@link https://chromedevtools.github.io/devtools-protocol/tot/Target/ | CDP target}. * In CDP a target is something that can be debugged such a frame, a page or a * worker. * @public */ class Target { /** * @internal */ constructor() { } /** * If the target is not of type `"service_worker"` or `"shared_worker"`, returns `null`. */ async worker() { return null; } /** * If the target is not of type `"page"`, `"webview"` or `"background_page"`, * returns `null`. */ async page() { return null; } url() { throw new Error('not implemented'); } /** * Creates a Chrome Devtools Protocol session attached to the target. */ createCDPSession() { throw new Error('not implemented'); } /** * Identifies what kind of target this is. * * @remarks * * See {@link https://developer.chrome.com/extensions/background_pages | docs} for more info about background pages. */ type() { throw new Error('not implemented'); } /** * Get the browser the target belongs to. */ browser() { throw new Error('not implemented'); } /** * Get the browser context the target belongs to. */ browserContext() { throw new Error('not implemented'); } /** * Get the target that opened this target. Top-level targets return `null`. */ opener() { throw new Error('not implemented'); } } exports.Target = Target; //# sourceMappingURL=Target.js.map