/** * TypeScript definitions for TestDriver Core Module * @module testdriverai/core */ export class Dashcam { /** * Create a new Dashcam instance * @param client - TestDriver client instance * @param options - Dashcam options */ constructor(client: any, options?: DashcamOptions); /** * Authenticate with Dashcam CLI * @param apiKey - Dashcam API key (optional, uses DASHCAM_API_KEY env var if not provided) * @returns Promise that resolves when authenticated */ auth(apiKey?: string): Promise; /** * Add a log entry to Dashcam * @param config - Log configuration */ addLog(config: LogConfig): Promise; /** * Add a file log to Dashcam * @param path - Path to file to log * @param name - Name/description for the log entry */ addFileLog(path: string, name: string): Promise; /** * Add an application log to Dashcam * @param application - Application name to track * @param name - Name/description for the log entry */ addApplicationLog(application: string, name: string): Promise; /** * Start recording * @returns Promise that resolves when recording starts */ start(): Promise; /** * Stop recording and get replay URL * @returns Promise that resolves to the replay URL (or null if not recording) */ stop(): Promise; /** * Check if currently recording * @returns true if recording, false otherwise */ isRecording(): boolean; } export interface DashcamOptions { /** * Dashcam API key (defaults to DASHCAM_API_KEY env var) */ apiKey?: string; } export interface LogConfig { /** * Type of log entry */ type: 'file' | 'application'; /** * Path to file (for file logs) */ path?: string; /** * Application name (for application logs) */ application?: string; /** * Name/description for the log entry */ name: string; } /** * TestDriver SDK class * Re-exported from main module for convenience */ export class TestDriver { constructor(apiKey: string, options?: TestDriverOptions); auth(): Promise; connect(options?: ConnectOptions): Promise; disconnect(): Promise; find(query: string): Promise; findAll(query: string): Promise; click(target: string): Promise; type(target: string, text: string): Promise; exec(shell: string, command: string, timeout?: number, ignoreError?: boolean): Promise; focusApplication(appName: string): Promise; // Add other TestDriver methods as needed } export interface TestDriverOptions { /** * API endpoint URL */ apiRoot?: string; /** * Target OS: 'linux', 'mac', or 'windows' */ os?: 'linux' | 'mac' | 'windows'; /** * Create new sandbox */ newSandbox?: boolean; /** * Screen resolution */ resolution?: string; /** * Enable analytics */ analytics?: boolean; /** * Cache configuration * Set to false to disable caching entirely. * Set to an object to configure thresholds. * @example { cache: { enabled: true, thresholds: { find: { screen: 0.05, element: 0.8 }, assert: 0.05 } } } */ cache?: boolean | { enabled?: boolean; thresholds?: { /** Thresholds for find operations */ find?: { /** Pixel diff threshold for screen comparison (0-1, default 0.05 = 5% diff allowed) */ screen?: number; /** OpenCV template match threshold for element matching (0-1, default 0.8 = 80% correlation) */ element?: number; }; /** Pixel diff threshold for assert operations (0-1, default 0.05 = 5% diff allowed) */ assert?: number; }; }; /** * @deprecated Use cache.thresholds instead * Cache thresholds for find operations */ cacheThresholds?: { find?: number; findAll?: number; }; } export interface ConnectOptions { /** * Create new sandbox instance */ new?: boolean; }