import { type Diagnostic, type Envelope, type ErrorCode, isMachineOutput } from '../lib/messaging.js'; type LifecycleCommand = 'dev' | 'start' | 'preview'; export { isMachineOutput }; export declare function isLifecycleStreamEnabled(): boolean; interface LifecycleStreamOptions { command: LifecycleCommand; browser: string; distPath: string; readyPath?: string; eventsPath?: string; noBrowser?: boolean; hintFor?: (code: ErrorCode) => string | undefined; onUsageRefusal?: (code: ErrorCode, message: string, ready: Record) => void; write?: (line: string) => void; } export declare class LifecycleStream { private readonly options; private readonly writeLine; private successfulCompiles; private compileAttempts; private readyEmitted; private reportedReadyError; private browserExitEmitted; private interruptEmitted; private terminalEmitted; private terminalWritten; private startingEmitted; private boundPort; private exitWatcher; private launchFailureWatcher; constructor(options: LifecycleStreamOptions); get enabled(): boolean; get ended(): boolean; private emit; private hostHint; private addHostHint; private withHostRemedy; sessionValue(extra?: Record): Record; starting(args: { requestedPort?: number | null; port?: number | null; }): Envelope | null; compiled(args: { assets?: number; durationMs?: number; entrypoints?: number; }): Envelope | null; compileFailed(args: { output?: string; durationMs?: number; message?: string; diagnostics?: Diagnostic[]; diagnosticsTruncated?: boolean; }): Envelope | null; ready(args?: { port?: number | null; restarted?: boolean; }): Envelope | null; private contractError; exited(exitCode: number): Envelope | null; shutdownTimedOut(timeoutMs: number, exitCode: number): Envelope | null; emitOnExit(): () => void; private browserExitCode; browserExited(args?: { exitCode?: number | null; message?: string; }): Envelope | null; interrupted(signal: string): Envelope | null; failed(message: string, code?: ErrorCode): Envelope | null; warned(args: { code: ErrorCode; message: string; }): Envelope | null; restartFailed(args: { code: ErrorCode; message: string; }): Envelope | null; watchBrowserExit(intervalMs?: number, onExit?: (ready: Record) => void): () => void; watchBrowserLaunchFailure(intervalMs: number | undefined, onFailure: (ready: Record) => void): () => void; } export declare function createLifecycleStream(options: LifecycleStreamOptions): LifecycleStream; export declare function attachLifecycleStream(compiler: unknown, stream: LifecycleStream, options?: { restart?: boolean; }): void;