import { type ViteDevServer } from 'vite'; import { Emitter } from '../testing/emitter.js'; import type { RunnerEvents } from '../types.js'; import { BrowserManager } from './browser_manager.js'; import { ServerManager } from './server_manager.js'; import { TestPoolManager } from './test_pool_manager.js'; import type { Orchestrator } from './orchestrator.js'; /** * Options for shutdown operations. */ export interface ShutdownOptions { /** * Set to true to prevent terminating the Node process. */ preventExit?: boolean; } /** * Manages the environment lifecycle (boot, server startup, browser management, * plugin hooks, coverage reporting, and graceful process shutdown). */ export declare class LifecycleManager { #private; vite?: ViteDevServer; serverManager?: ServerManager; browserManager?: BrowserManager; poolManager?: TestPoolManager; browserEmitter: Emitter; serverUrl?: string; constructor(orchestrator: Orchestrator); /** * Registers teardown callbacks from plugin plan and boot phases. * * @param teardowns - Teardown functions to register. */ registerTeardowns(teardowns: (() => void | Promise)[]): void; /** * Boots the test environment: exception monitoring, plugins, pool manager, * Vite dev server, and Playwright browser instances. */ boot(): Promise; /** * Shuts down the entire test environment in an orderly sequence. * * @param exitCode - The exit code to terminate with. * @param options - Additional options, e.g. to prevent terminating the Node process. */ shutdown(exitCode: number, options?: ShutdownOptions): Promise; }