import type { PwAiModule } from "../pw-ai-module.js"; import type { BrowserRouteContext, ProfileContext } from "../server-context.js"; import type { BrowserRequest, BrowserResponse } from "./types.js"; export declare const SELECTOR_UNSUPPORTED_MESSAGE: string; export declare function readBody(req: BrowserRequest): Record; export declare function resolveTargetIdFromBody(body: Record): string | undefined; export declare function resolveTargetIdFromQuery(query: Record): string | undefined; export declare function handleRouteError(ctx: BrowserRouteContext, res: BrowserResponse, err: unknown): void; export declare function resolveProfileContext(req: BrowserRequest, res: BrowserResponse, ctx: BrowserRouteContext): ProfileContext | null; export declare function getPwAiModule(): Promise; export declare function requirePwAi(res: BrowserResponse, feature: string): Promise; type RouteTabContext = { profileCtx: ProfileContext; tab: Awaited>; cdpUrl: string; }; type RouteTabPwContext = RouteTabContext & { pw: PwAiModule; }; type RouteWithTabParams = { req: BrowserRequest; res: BrowserResponse; ctx: BrowserRouteContext; targetId?: string; run: (ctx: RouteTabContext) => Promise; }; export declare function withRouteTabContext(params: RouteWithTabParams): Promise; type RouteWithPwParams = { req: BrowserRequest; res: BrowserResponse; ctx: BrowserRouteContext; targetId?: string; feature: string; run: (ctx: RouteTabPwContext) => Promise; }; export declare function withPlaywrightRouteContext(params: RouteWithPwParams): Promise; export {};