import WebSocket from "ws"; import { ExecutionResult, ExecuteOptions } from "./types.js"; import type { DeviceInfo } from "./types.js"; export declare function buildEvaluationSource(cleanedExpression: string): string; export interface ExpressionValidation { valid: boolean; expression: string; error?: string; rewritten?: "iife-wrap"; } export declare function containsProblematicUnicode(str: string): boolean; export declare function stripLeadingComments(expression: string): string; export declare function validateAndPreprocessExpression(expression: string): ExpressionValidation; export declare function markAsyncEvalUnsupported(deviceKey: string): void; export declare function isAsyncEvalUnsupported(deviceKey: string): boolean; export declare function resetAsyncEvalSupport(): void; export declare function maskLiteralsAndComments(src: string): string; export declare function looksLikeAsyncFunction(src: string): boolean; export declare function wrapMultiStatementInIife(src: string): string | null; export declare function splitTopLevelStatements(src: string): string[]; export declare const TIMEOUT_HARD_CAP_MS = 120000; export declare function markConnectionEstablished(): void; export declare function clampTimeoutMs(input: number): { value: number; clampedFrom?: number; }; export type TransportPattern = "no_apps" | "ws_closed" | "target_closed" | "stale_target"; export declare function isEvalTimeoutOnLiveSocket(message: string, source: "cdp" | "server-timer" | "logical"): boolean; export type ProbeTargetApp = { ws: WebSocket; port: number; deviceInfo: { id?: string; }; }; export declare function isTargetStillAdvertised(app: { port: number; deviceInfo: { id?: string; }; }, fetchTargets?: (port: number) => Promise): Promise; export declare function classifyWithLivenessProbe(message: string, source: "cdp" | "server-timer" | "logical", app: ProbeTargetApp | null, probe?: (ws: WebSocket, timeoutMs: number) => Promise, targetStillAdvertised?: (app: ProbeTargetApp) => Promise): Promise; export type TransportClassification = { kind: "transport"; pattern: TransportPattern; } | { kind: "logical"; }; export declare function classifyTransportError(message: string, source: "cdp" | "server-timer" | "logical"): TransportClassification; export declare function delay(ms: number): Promise; export declare function buildPollDelays(budgetMs: number): number[]; export declare function fiberRootsMissing(value: unknown): boolean; export declare function executeInApp(expression: string, awaitPromise?: boolean, options?: ExecuteOptions, device?: string): Promise; //# sourceMappingURL=jsExecute.d.ts.map