/** * TypeScript definitions for TestDriver Vitest Plugin * @module testdriverai/vitest/plugin */ import TestDriverSDK, { TestDriverOptions } from '../sdk'; /** * A single dashcam URL entry for one retry attempt */ export interface DashcamUrlEntry { url: string | null; platform: string; attempt: number; } /** * Plugin state object */ export interface PluginState { dashcamUrls: Map; suiteTestRuns: Map; testDriverOptions: TestDriverOptions; } /** * Current plugin state */ export const pluginState: PluginState; /** * Register a Dashcam URL for a test attempt */ export function registerDashcamUrl(testId: string, url: string, platform: string, attempt?: number): void; /** * Get the latest Dashcam URL entry for a test (backward compatible) */ export function getDashcamUrl(testId: string): DashcamUrlEntry | undefined; /** * Get all Dashcam URL entries for a test (all retry attempts) */ export function getAllDashcamUrls(testId: string): DashcamUrlEntry[]; /** * Clear all Dashcam URLs */ export function clearDashcamUrls(): void; /** * Get suite test run data */ export function getSuiteTestRun(suiteId: string): any; /** * Set suite test run data */ export function setSuiteTestRun(suiteId: string, runData: any): void; /** * Clear suite test run data */ export function clearSuiteTestRun(suiteId: string): void; /** * Get the current plugin state */ export function getPluginState(): PluginState; /** * Authenticate with API key */ export function authenticateWithApiKey(apiKey: string, apiRoot?: string): Promise; /** * Create a test run directly via API */ export function createTestRunDirect(token: string, apiRoot: string, testRunData: any): Promise; /** * Record a test case directly via API */ export function recordTestCaseDirect(token: string, apiRoot: string, testCaseData: any): Promise; /** * Create a TestDriver instance */ export function createTestDriver(options?: TestDriverOptions): Promise; /** * Register a test with TestDriver */ export function registerTest(testdriver: TestDriverSDK, context: any): void; /** * Cleanup a TestDriver instance */ export function cleanupTestDriver(testdriver: TestDriverSDK): Promise; /** * Plugin options */ export interface TestDriverPluginOptions extends TestDriverOptions { /** * API key (defaults to TD_API_KEY env var) */ apiKey?: string; } /** * TestDriver Vitest Plugin * @param options - Plugin configuration options */ export default function testDriverPlugin(options?: TestDriverPluginOptions): any;