/** * Diagnostics Plugin for ECSpresso * * Runtime diagnostics: FPS, entity count, per-system timing, per-phase timing, * and an optional DOM overlay for visual debugging. */ import type { SystemPhase } from 'ecspresso'; export interface DiagnosticsData { fps: number; entityCount: number; systemTimings: ReadonlyMap; phaseTimings: Readonly>; averageFrameTime: number; } export interface DiagnosticsResourceTypes { diagnostics: DiagnosticsData; } export interface DiagnosticsPluginOptions { /** System group name (default: 'diagnostics') */ systemGroup?: G; /** Enable timing collection on initialize (default: true) */ enableTimingOnInit?: boolean; /** Number of frames to sample for FPS average (default: 60) */ fpsSampleCount?: number; } export interface DiagnosticsOverlayOptions { /** Corner position (default: 'top-left') */ position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; /** Milliseconds between DOM updates (default: 200) */ updateInterval?: number; /** Show per-system timings (default: true) */ showSystemTimings?: boolean; /** Maximum systems to show in overlay (default: 10) */ maxSystemsShown?: number; } export declare function createDiagnosticsPlugin(options?: DiagnosticsPluginOptions): import("ecspresso").Plugin, import("ecspresso").EmptyConfig, "diagnostics-collect", G, never, never>; /** * Create a DOM overlay that displays diagnostics data. * Returns a cleanup function that removes the element and clears the interval. * * @param ecs An ECSpresso instance with the diagnostics resource * @param options Overlay configuration * @returns Cleanup function */ export declare function createDiagnosticsOverlay(ecs: { getResource(key: K): R[K]; }, options?: DiagnosticsOverlayOptions): () => void;