import { useLoadingState } from '@scalar/components'; import type { WorkspaceStore } from '@scalar/workspace-store/client'; import type { OpenApiDocument } from '@scalar/workspace-store/schemas/v3.1/strict/openapi-document'; import { type ComputedRef, type Ref } from 'vue'; import { type CustomFetch, type ResponseInstance } from '../../../../../../v2/blocks/operation-block/helpers/send-request.js'; import type { SelectedItem } from './use-runner-selection.js'; export type TestResult = { title: string; passed: boolean; duration: number; error?: string; status: 'pending' | 'passed' | 'failed'; }; export type RunResult = { item: SelectedItem; result: ResponseInstance | null; error: Error | null; testResults: TestResult[]; }; export type RunSummary = { total: number; passed: number; failed: number; skipped: number; duration: number | null; allPassed: boolean; }; type UseRunnerExecutionOptions = { /** Workspace store */ workspaceStore: WorkspaceStore; /** Document */ document: OpenApiDocument | null; /** Document name */ documentName: string; /** Whether the layout is web */ isWeb: boolean; /** Ordered list of selected items to run */ selectedOrder: ComputedRef; /** Optional custom fetch implementation, overrides the global fetch for request execution */ customFetch?: CustomFetch; }; type UseRunnerExecutionReturn = { /** Whether a run is currently in progress */ isRunning: Ref; /** Whether a run has completed */ hasRunCompleted: Ref; /** Current index being run (1-based) */ currentRunIndex: Ref; /** Loading state for the run button */ runLoader: ReturnType; /** Results from the run */ runResults: Ref; /** Summary of the run results */ runSummary: ComputedRef; /** Start running the selected items */ run: () => Promise; /** Clear results and run again */ rerun: () => void; /** Clear all results */ clearResults: () => void; /** Get the result at a specific index */ getResultAtIndex: (index: number) => RunResult | null; /** Check if a result passed */ isResultPassed: (result: RunResult | null) => boolean; /** Check if a result was skipped */ isResultSkipped: (index: number) => boolean; /** Get failed tests from a result */ getFailedTests: (result: RunResult | null) => TestResult[]; }; /** * Composable for managing runner execution state and logic. */ export declare function useRunnerExecution({ workspaceStore, document, documentName, isWeb, selectedOrder, customFetch, }: UseRunnerExecutionOptions): UseRunnerExecutionReturn; export {}; //# sourceMappingURL=use-runner-execution.d.ts.map