import WebSocket from "ws"; import type { FailureKind } from "./errors.js"; export interface LogEntry { timestamp: Date; level: "log" | "warn" | "error" | "info" | "debug" | "fatal"; message: string; args?: unknown[]; seq: number; epoch: number; stackTrace?: CDPStackFrame[]; } export interface CDPStackFrame { functionName?: string; scriptId?: string; url?: string; lineNumber: number; columnNumber: number; } export interface DeviceInfo { id: string; title: string; description: string; appId: string; type: string; webSocketDebuggerUrl: string; deviceName: string; } export interface ConnectedApp { ws: WebSocket; deviceInfo: DeviceInfo; port: number; platform: "ios" | "android"; simulatorUdid?: string; adbSerial?: string; lastScreenshot?: { originalWidth: number; originalHeight: number; scaleFactor: number; }; cdpNetworkSupported?: boolean; sdkPresent?: boolean; sdkProbeTimer?: NodeJS.Timeout; sdkMissCount?: number; appDetection?: AppDetectionResult; appDetectionPromise?: Promise; } export interface AppDetectionResult { reactNativeVersion: string; architecture: "new" | "old"; jsEngine: "hermes" | "jsc"; appPlatform: "ios" | "android"; osVersion: string; expoSdkVersion?: string; detectionSource?: "probe" | "device-info"; } export interface RemoteObject { type: "object" | "function" | "undefined" | "string" | "number" | "boolean" | "symbol" | "bigint"; subtype?: "array" | "null" | "node" | "regexp" | "date" | "map" | "set" | "weakmap" | "weakset" | "iterator" | "generator" | "error" | "proxy" | "promise" | "typedarray" | "arraybuffer" | "dataview"; className?: string; value?: unknown; unserializableValue?: string; description?: string; objectId?: string; } export interface ExceptionDetails { exceptionId: number; text: string; lineNumber: number; columnNumber: number; exception?: RemoteObject; } export interface PendingExecution { resolve: (result: ExecutionResult) => void; timeoutId: NodeJS.Timeout; ws?: unknown; } export interface ExecutionResult { success: boolean; result?: string; error?: string; errorContext?: string; failureKind?: FailureKind; _meta?: { reconnected?: boolean; transportError?: string; timeoutClampedFrom?: number; }; } export type LogLevel = "all" | "log" | "warn" | "error" | "info" | "debug" | "fatal"; export interface NetworkRequest { requestId: string; timestamp: Date; method: string; url: string; headers: Record; postData?: string; status?: number; statusText?: string; responseHeaders?: Record; mimeType?: string; contentLength?: number; timing?: { requestTime?: number; responseTime?: number; duration?: number; }; error?: string; completed: boolean; epoch: number; responseBody?: string; mocked?: boolean; mockId?: string; mockWarning?: string; } export interface ConnectionState { status: "connected" | "disconnected" | "reconnecting"; lastConnectedTime: Date | null; lastDisconnectTime: Date | null; reconnectionAttempts: number; connectionGaps: ConnectionGap[]; } export interface ConnectionGap { disconnectedAt: Date; reconnectedAt: Date | null; durationMs: number | null; reason: string; } export interface ConnectionMetadata { port: number; deviceInfo: DeviceInfo; webSocketUrl: string; } export interface ReconnectionConfig { enabled: boolean; maxAttempts: number; initialDelayMs: number; maxDelayMs: number; backoffMultiplier: number; } export interface ConnectOptions { isReconnection?: boolean; reconnectionConfig?: ReconnectionConfig; } export interface ContextHealth { contextId: number | null; lastContextCreated: Date | null; lastContextDestroyed: Date | null; isStale: boolean; lastHealthCheck: Date | null; lastHealthCheckSuccess: boolean; } export interface ExecuteOptions { maxRetries?: number; retryDelayMs?: number; autoReconnect?: boolean; timeoutMs?: number; originatingToolName?: string; skipBootstrap?: boolean; } export interface ConnectionCheckResult { connected: boolean; wasReconnected: boolean; message: string | null; } export interface EnsureConnectionDeviceInfo { deviceName: string; deviceTitle: string; platform: "ios" | "android"; port: number; uptime: string; contextId: number | null; healthCheckPassed: boolean; } export interface EnsureConnectionResult { connected: boolean; wasReconnected: boolean; healthCheckPassed: boolean; connectionInfos: EnsureConnectionDeviceInfo[]; error?: string; failureKind?: FailureKind; } //# sourceMappingURL=types.d.ts.map