import type { AgentOpt, DeviceAction, Rect, WebElementInfo } from '@midscene/core';
import type { InputStrategy } from '@midscene/core/device';
import type { NodeType } from '@midscene/shared/constants';
export type { WebElementInfo };
export type WebPageAgentOpt = AgentOpt & WebPageOpt;
export type WebPageOpt = {
    waitForNavigationTimeout?: number;
    waitForNetworkIdleTimeout?: number;
    forceSameTabNavigation?: boolean;
    enableTouchEventsInActionSpace?: boolean;
    /**
     * Finite non-negative per-character delay (ms) used when typing text via the
     * underlying Puppeteer/Playwright `keyboard.type` API. Default undefined
     * leaves the option unset and uses the underlying driver's own default.
     */
    keyboardTypeDelay?: number;
    /**
     * How Midscene sends text to the browser. `bulk` uses one `insertText`
     * operation; `sequential` sends one Unicode code point at a time. `bulk`
     * requires `keyboardTypeDelay` to be omitted or set to zero.
     * @default 'legacy'
     */
    inputStrategy?: InputStrategy;
    /**
     * Force Chrome to render select elements using base-select appearance instead of OS-native rendering.
     * This makes select elements visible in screenshots captured by Playwright/Puppeteer.
     *
     * Reference: https://developer.chrome.com/blog/a-customizable-select
     *
     * When enabled, adds a style tag with `select { appearance: base-select !important; }` to the page.
     *
     * Defaults to `true`. Set to `false` to opt out (e.g. on older Chrome/driver
     * versions that do not support `appearance: base-select`).
     */
    forceChromeSelectRendering?: boolean;
    beforeInvokeAction?: () => Promise<void>;
    afterInvokeAction?: () => Promise<void>;
    customActions?: DeviceAction<any>[];
};
export declare class WebElementInfoImpl implements WebElementInfo {
    content: string;
    rect: Rect;
    center: [number, number];
    id: string;
    indexId: number;
    attributes: {
        nodeType: NodeType;
        [key: string]: string;
    };
    xpaths?: string[];
    isVisible: boolean;
    constructor({ content, rect, id, attributes, indexId, xpaths, isVisible, }: {
        content: string;
        rect: Rect;
        id: string;
        attributes: {
            nodeType: NodeType;
            [key: string]: string;
        };
        indexId: number;
        xpaths?: string[];
        isVisible: boolean;
    });
}
export declare const limitOpenNewTabScript = "\nif (!window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__) {\n  window.__MIDSCENE_NEW_TAB_INTERCEPTOR_INITIALIZED__ = true;\n\n  // Intercept the window.open method (only once)\n  window.open = function(url) {\n    console.log('Blocked window.open:', url);\n    window.location.href = url;\n    return null;\n  };\n\n  // Block all a tag clicks with target=\"_blank\" (only once)\n  document.addEventListener('click', function(e) {\n    const target = e.target.closest('a');\n    if (target && target.target === '_blank') {\n      e.preventDefault();\n      console.log('Blocked new tab:', target.href);\n      window.location.href = target.href;\n      target.removeAttribute('target');\n    }\n  }, true);\n}\n";
