import { type StatsMainAdapter, type StatsMainOptions, type StatsPanelMode, type StatsSnapshot, type StatsTextureFrame, type StatsWorkerAdapter, type StatsWorkerOptions } from 'three-blocks/stats'; export type AppStatsPanelMode = Exclude; /** Serializable page-to-worker state for an on-demand stats profiler. */ export interface AppStatsControl { readonly active: boolean; readonly visible: boolean; readonly mode: AppStatsPanelMode; } /** Validate an app stats control at a worker transport boundary. */ export declare function isAppStatsControl(value: unknown): value is AppStatsControl; /** Stable stats portion of the browser smoke bridge. */ export interface AppStatsState { readonly snapshots: number; readonly textures: number; /** Requested visibility. A hidden document temporarily suppresses the DOM panel. */ readonly panelVisible: boolean; setPanelVisible(visible: boolean): Promise; setPanelMode(mode: AppStatsPanelMode): Promise; } export interface AppStatsControllerOptions { /** Resolve the currently presented canvas. The result may change after a worker restart. */ readonly textureSource: () => object | null | undefined; readonly container?: HTMLElement; /** Optional worker handshake. Its presence enables worker-owned compatibility semantics. */ readonly control?: (value: AppStatsControl) => PromiseLike; /** Attach an existing adapter instead of creating one on first visible demand. */ readonly stats?: StatsMainAdapter; /** Test or host-specific adapter factory. */ readonly createAdapter?: (options: StatsMainOptions) => StatsMainAdapter; readonly onError?: (error: unknown) => void; } /** * Main-thread owner for lazy stats panels, smoke counters, and an optional worker handshake. * * The controller samples the presented canvas locally, so worker-owned WebGPU applications * do not need GPU readback or bitmap transfer for the scene preview. */ export declare class AppStatsController { #private; readonly state: AppStatsState; constructor(options: AppStatsControllerOptions); /** Attach and initialize a caller-owned adapter. Replaced adapters are disposed. */ attach(stats: StatsMainAdapter): void; /** Receive one worker metrics sample and advance the smoke counter. */ receive(snapshot: StatsSnapshot): void; /** Receive one transferred texture and advance the smoke counter. */ receiveTexture(frame: StatsTextureFrame): void; setPanelVisible(visible: boolean): Promise; setPanelMode(mode: AppStatsPanelMode): Promise; /** Reapply the active page state after its render worker is replaced. */ replay(): Promise; dispose(): void; } export interface AppStatsFrameHooks { beginFrame(): void; endFrame(): void; } export interface AppStatsWorkerControllerOptions { readonly renderer: object; readonly publish: (snapshot: StatsSnapshot) => void; readonly stats?: StatsWorkerAdapter; readonly createAdapter?: (options: StatsWorkerOptions) => StatsWorkerAdapter; /** Attach frame hooks after lazy initialization. Return cleanup for disposal. */ readonly onActive?: (hooks: AppStatsFrameHooks) => void | (() => void); } /** Worker-side on-demand profiler paired with AppStatsController's control callback. */ export declare class AppStatsWorkerController implements AppStatsFrameHooks { #private; constructor(options: AppStatsWorkerControllerOptions); applyControl(control: AppStatsControl): Promise; beginFrame(): void; endFrame(): void; dispose(): void; }