import { createCoreRuntime } from '../core/index.js'; import { type MainToWorkerMessage, type WorkerToMainMessage } from '../protocol.js'; import { HybridRenderer } from '../renderers/hybrid.js'; export interface TerminalWorkerScope { postMessage(message: WorkerToMainMessage, transfer?: Transferable[]): void; requestAnimationFrame?(callback: FrameRequestCallback): number; readonly fonts?: Pick; } export interface TerminalWorkerHostDependencies { readonly createRuntime: typeof createCoreRuntime; readonly createRenderer: typeof HybridRenderer.create; readonly loadFontFace: (family: string, source: string | ArrayBuffer, descriptors?: FontFaceDescriptors) => Promise; } /** Stateful worker protocol host, separated from the worker bootstrap for deterministic testing. */ export declare class TerminalWorkerHost { private readonly scope; private readonly dependencies; private readonly sessions; private readonly initializingSessionIds; private runtime; private runtimePromise; private runtimeKey; private initializingSessions; constructor(scope: TerminalWorkerScope, dependencies?: TerminalWorkerHostDependencies); /** Handles a message and reports protocol failures through the worker error channel. */ dispatch(message: MainToWorkerMessage): void; /** Handles one worker protocol message, rejecting malformed session transitions. */ handle(message: MainToWorkerMessage): Promise; private initialize; private getRuntime; private disposeUnusedRuntime; private forwardEvents; private post; private reportError; } //# sourceMappingURL=terminal-worker-host.d.ts.map