/** * Copyright (c) Microsoft Corporation. * * 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. */ import * as playwright from 'playwright'; import { Tab } from './tab.js'; import type { ModalState, Tool } from './tools/tool.js'; import type { FullConfig } from './config.js'; import type { BrowserContextFactory } from './browserContextFactory.js'; import type { PluginManager } from './plugins/manager.js'; export declare class Context { readonly tools: Tool[]; readonly config: FullConfig; readonly pluginManager?: PluginManager; private _browserContextPromise; private _browserContextFactory; private _tabs; private _currentTab; private _modalStates; private _pendingAction; private _downloads; clientVersion: { name: string; version: string; } | undefined; constructor(tools: Tool[], config: FullConfig, browserContextFactory: BrowserContextFactory, pluginManager?: PluginManager); clientSupportsImages(): boolean; modalStates(): ModalState[]; setModalState(modalState: ModalState, inTab: Tab): void; clearModalState(modalState: ModalState): void; modalStatesMarkdown(): string[]; tabs(): Tab[]; currentTabOrDie(): Tab; newTab(): Promise; selectTab(index: number): Promise; ensureTab(): Promise; listTabsMarkdown(): Promise; closeTab(index: number | undefined): Promise; run(tool: Tool, params: Record | undefined): Promise<{ content?: (import("@modelcontextprotocol/sdk/types.js").ImageContent | import("@modelcontextprotocol/sdk/types.js").TextContent)[]; } | { content: ({ [x: string]: unknown; type: "image"; data: string; mimeType: string; } | { type: string; text: string; })[]; }>; waitForTimeout(time: number): Promise; private _raceAgainstModalDialogs; private _javaScriptBlocked; dialogShown(tab: Tab, dialog: playwright.Dialog): void; downloadStarted(tab: Tab, download: playwright.Download): Promise; private _onPageCreated; private _onPageClosed; close(): Promise; private _setupRequestInterception; private _ensureBrowserContext; private _setupBrowserContext; }