import type { StatsMainAdapter } from 'three-blocks/stats'; import { type WorkerServerHandlers } from '../worker/index.js'; import { type AppHotContext, type AppPageEvents, type AppPageRequests, type AppPageState, type AppProtocol, type PointerState, type RuntimeDiagnostics, type RuntimeStatus, type ScrollState, type ThreeBlocksReadiness, type ThreeBlocksSmokeState, type ViewportState, type VisibilityState, type WorkerLink, type WorkerShaderCaptureActivation } from './types.js'; import { type AppStatsPanelMode } from './stats.js'; export declare function errorMessage(error: unknown): string; /** Read the dev-overlay capture session prepared before the application module starts. */ export declare function currentWorkerShaderCaptureActivation(): WorkerShaderCaptureActivation | undefined; /** Owns the generated app's compact lifecycle/error element. */ export declare class StatusOverlay { readonly element: HTMLElement; constructor(element: string | HTMLElement); reset(detail?: string): void; setStatus(status: RuntimeStatus): void; ready(diagnostics: RuntimeDiagnostics, text: boolean): void; reportError(error: unknown): void; } export interface WorkerHostOptions { readonly canvas: string | HTMLCanvasElement; readonly create: () => Worker; readonly status?: StatusOverlay; readonly hot?: AppHotContext | null; readonly text?: boolean; readonly stats?: StatsMainAdapter; readonly handlers?: WorkerServerHandlers; readonly validateStructuredClone?: boolean; readonly onError?: (error: unknown) => void; /** Keeps the protocol visible in declarations without adding a runtime option. */ readonly protocol?: TProtocol; } type VisibleStatsPanelMode = AppStatsPanelMode; /** Owns worker creation, restart, boot transfer, status, text replay, and smoke state. */ export declare class WorkerHost { #private; readonly protocol: TProtocol; readonly link: WorkerLink; readonly readiness: ThreeBlocksReadiness; readonly smoke: ThreeBlocksSmokeState; readonly ready: Promise; constructor(options: WorkerHostOptions); get canvas(): HTMLCanvasElement; attachStats(stats: StatsMainAdapter): void; setStatsPanelVisible(visible: boolean): Promise; setStatsPanelMode(mode: VisibleStatsPanelMode): Promise; /** The rendering canvas this host drives. */ get canvasElement(): HTMLCanvasElement; /** * CSS size of the rendering canvas, which is what the drawing buffer and any DOM-synchronized * text must be sized from. It differs from the window whenever a classic scrollbar, page * padding, or a non-fullscreen layout gives the canvas a box of its own; sizing from the * window instead scales everything the canvas draws against the surrounding DOM. */ canvasRect(): { readonly width: number; readonly height: number; }; restart(reason?: string): Promise; dispose(): void; } /** Structural source accepted by the browser-smoke global installer. */ export interface SmokeBridgeSource { readonly readiness: ThreeBlocksReadiness; readonly smoke: ThreeBlocksSmokeState; } /** Install the stable browser-smoke globals without exposing their ledger in app code. */ export declare function installSmokeBridge(host: WorkerHost): () => void; /** Install the stable browser-smoke globals for a custom structural app shell. */ export declare function installSmokeBridgeSource(source: SmokeBridgeSource): () => void; /** Small verb-based facade for page input; unchanged scroll frames are not transported. */ export declare class InputForwarder { #private; constructor(worker: WorkerLink); viewport(value: ViewportState): void; pointer(value: PointerState): void; scroll(value: ScrollState): void; visibility(value: VisibilityState): void; } export declare function createInputForwarder(worker: WorkerLink): InputForwarder; export {};