/** * Supporting diagnostics for WebGPU shader precompilation in an existing page-owned app. * * Capture and runtime injection live in `@three-blocks/devtools` and * `three-blocks/shaders`. This entrypoint attaches the development overlay, smoke bridge, * and lazy stats panel to their page-owned WebGPURenderer. `threeBlocks()` aliases it to * an inert module outside the development server. * @module three-blocks/devtools */ import type { StatsPanelMode } from '../stats/index.js'; import type { ThreeBlocksDevtoolsMetric, ThreeBlocksSmokeState } from '../app/types.js'; import { mountThreeBlocksDevOverlay, type ThreeBlocksDevOverlay, type ThreeBlocksOverlayOptions } from '../overlay/client.js'; import { type ThreeBlocksShaderBuildConfig } from '../vite/types.js'; import type { WebGPURenderer } from 'three/webgpu'; /** Options for mounting the development overlay in a page-owned application. */ export type DevtoolsOverlayOptions = ThreeBlocksOverlayOptions; /** Idempotent handle returned by a mounted development overlay. */ export type DevtoolsOverlayHandle = ThreeBlocksDevOverlay; export { observeThreeBlocksTslBuilds, type ObserveThreeBlocksTslBuildsOptions, type ThreeBlocksTslBuildObserver, type ThreeBlocksTslBuildSnapshot, } from './buildObserver.js'; /** * Mount or update the development overlay used by the example gallery and custom apps. * Returns `null` outside a browser or in production. The returned handle owns its DOM and * must be disposed when its page-level integration is removed. */ export declare const mountDevtoolsOverlay: typeof mountThreeBlocksDevOverlay; export interface RegisterDevtoolsOptions { /** A page-owned Three.js WebGPURenderer. WebGLRenderer is not supported. */ readonly renderer: WebGPURenderer; /** Build-injected receipt policy. Bundler integrations populate this automatically. */ readonly shaders?: ThreeBlocksShaderBuildConfig; /** Panel mount target. Defaults to document.body. */ readonly container?: HTMLElement; /** Auto-mount the static development overlay when no Vite overlay is present. Defaults to true. */ readonly overlay?: boolean; /** Print the one-time measured shader state announcement. Defaults to true. */ readonly announce?: boolean; } export interface DevtoolsRegistration { readonly smoke: ThreeBlocksSmokeState; setStatsPanelVisible(visible: boolean): Promise; setStatsPanelMode(mode: Exclude): Promise; setMetric(key: string, metric: ThreeBlocksDevtoolsMetric): void; removeMetric(key: string): void; /** Configure the lazily-created stats-gl instance without forcing it to load. */ configureStats(configure: (panel: object) => void | (() => void)): () => void; dispose(): void; } /** Attach the dev overlay stats control to an existing page-owned renderer. */ export declare function registerDevtools(options: RegisterDevtoolsOptions): DevtoolsRegistration | null;