import type { PlaygroundWorkerEndpoint } from './playground-worker-endpoint'; export declare const RELOAD_REQUIRED = "playground-reload-required"; export declare const RUNTIME_CLOSED = "playground-runtime-closed"; /** One runtime per site; connected documents never own its lifetime. */ export declare class SharedRuntime { private bootPromise?; private initialized; private initializer?; private initializationComplete; private resolveInitialization; private rejectInitialization; private active; private retiring?; private retired; private closed; private runtimeId; private ports; private servicePorts; private readiness; constructor(endpoint: PlaygroundWorkerEndpoint, version: string, onClose: () => void); private endpoint; private version; private close; connect(port: MessagePort, ready: () => void, failed: (error: Error) => void): void; registerServicePort(port: MessagePort): void; /** Serves HTTP once through a direct port and keeps retirement waiting for the body. */ handleServiceWorkerRequest(message: { method: string; args: any[]; requestId: number; }, port: MessagePort): Promise; api(port?: MessagePort): PlaygroundWorkerEndpoint; retire(): Promise; private beginBoot; private run; }