import type { Output } from '../output.js'; import { type VerifyRunSettings } from './check-options.js'; import { type VerifyObservations } from './classify.js'; import type { VerifyPlatform } from './platform.js'; /** * Runs verify iterations one at a time. A change that lands mid-iteration queues exactly one * follow-up — not one per change, because the follow-up will see all of them anyway. * * Extracted pure (no timers, no I/O beyond the injected runner) so the rerun-on-change-during-run * behaviour is testable the way `ReloadCoordinator`'s is. */ export declare class VerifyIterationScheduler { private readonly run; /** Where a detached follow-up's failure goes — `request` only rethrows for its own caller. */ private readonly onError; private running; private queued; constructor(run: (reason: string) => Promise, /** Where a detached follow-up's failure goes — `request` only rethrows for its own caller. */ onError?: (error: unknown) => void); /** * Resolves when THIS request's iteration completes (or immediately, if it was queued behind a * running one). A queued follow-up runs detached — awaiting it here would make the first * caller's promise hostage to work it never asked for. */ request(reason: string): Promise; } export interface VerifyWatchOptions extends VerifyRunSettings { root: string; /** Path to the project's `tsc` binary (for `tsc --watch`). */ tsc: string; artifactDir: string; /** * Which platforms each iteration covers, lead first. Two platforms roughly double an * iteration: Chrome launch — the fixed cost the whole watch loop exists to amortise — is * still paid once and shared, but the page load and the adaptive settle happen per platform. */ platforms: VerifyPlatform[]; mobilePrimary: boolean; output: Output; describeRunState: (observations: VerifyObservations) => string; /** * Runs one iteration's browser checks as the only verify on the machine (verify/lock.ts). * Per iteration, never around the loop: two `--watch` loops in two projects then take turns. */ lock?: (fn: () => Promise) => Promise; } /** * Run the watch loop until SIGINT/SIGTERM. The caller owns vite; everything spawned here — * `tsc --watch`, the file watcher, the browser session — is cleaned up before returning. */ export declare function runVerifyWatch(options: VerifyWatchOptions): Promise;