/** * The following code is modified based on * https://github.com/nanobrowser/nanobrowser/blob/master/chrome-extension/src/background/browser/context.ts * * Apache-2.0 License * Copyright (c) 2024 alexchenzl * https://github.com/nanobrowser/nanobrowser/blob/master/LICENSE */ import { type BrowserContextConfig, type BrowserState } from './types'; import Page from './page'; export default class BrowserContext { private readonly _config; private _currentTabId; private _attachedPages; constructor(config: Partial); getConfig(): BrowserContextConfig; updateCurrentTabId(url: string): void; private _getOrCreatePage; cleanup(): Promise; attachPage(page: Page): Promise; detachPage(url: string): Promise; getCurrentPage(): Promise; /** * Get all tab IDs from the browser and the current window. * @returns A set of tab IDs. */ getAllTabIds(): Promise>; private waitForPageEvents; switchTab(url: string): Promise; navigateTo(url: string): Promise; openTab(url: string): Promise; closeTab(url: string): Promise; /** * Remove a tab from the attached pages map. This will not run detachPuppeteer. * @param tabId - The ID of the tab to remove. */ removeAttachedPage(url: string): void; getState(): Promise; removeHighlight(): Promise; } //# sourceMappingURL=context.d.ts.map