import type { ExecutionOptions, ExecutionResult } from '../types'; /** * Message handler for incoming transport messages */ export declare type MessageHandler = (message: T) => Promise | any; /** * Transport connection status */ export declare enum TransportStatus { disconnected = "disconnected", connecting = "connecting", connected = "connected", error = "error" } /** * Transport events */ export interface TransportEvents { statusChange: (status: TransportStatus) => void; error: (error: Error) => void; message: (message: any) => void; } /** * Transport configuration options */ export interface TransportConfig { timeout?: number; spawnTimeout?: number; readyTimeout?: number; retryAttempts?: number; retryDelay?: number; } /** * Abstract Transport interface for communication between JSExecutor and execution environment */ export interface Transport { /** * Current transport status */ readonly status: TransportStatus; /** * Initialize the transport connection * @param config - Transport configuration */ initialize: (config?: TransportConfig) => Promise; /** * Send a message through the transport * @param message - Message to send * @returns Promise resolving to response */ send: (message: TRequest) => Promise; /** * Register a message handler for incoming messages * @param handler - Message handler function */ onMessage: (handler: MessageHandler) => void; /** * Execute code using this transport * @param code - JavaScript code to execute * @param args - Arguments to pass to the code * @param skdsEndpointUrl - SKDS endpoint URL * @param options - Execution options */ execute?: (code: string, args: Record, skdsEndpointUrl: string, options: Required) => Promise; /** * Close the transport connection */ close: () => Promise; /** * Check if the transport is ready for communication */ isReady: () => boolean; } //# sourceMappingURL=Transport.d.ts.map