import { SeriesStyle } from './seriesAdapter'; import { NativeSeriesRenderData } from '../../renderer/native/types'; /** * Bounds interface matching the original */ export interface Bounds { xMin: number; xMax: number; yMin: number; yMax: number; } /** * Series render data matching NativeSeriesRenderData */ export interface GpuSeriesRenderData { id: string; type: "line" | "scatter" | "line+scatter" | "step" | "step+scatter" | "band" | "bar" | "heatmap"; visible: boolean; style: SeriesStyle; /** Y-bounds for multi-axis support */ yBounds?: { min: number; max: number; }; /** Heatmap specific */ zBounds?: { min: number; max: number; }; colormap?: string; } /** * Render options matching NativeRenderOptions */ export interface GpuRenderOptions { bounds: Bounds; backgroundColor?: [number, number, number, number]; plotArea?: { x: number; y: number; width: number; height: number; }; } export interface GpuNativeRenderOptions extends GpuRenderOptions { invertX?: boolean; plotAreaBackground?: [number, number, number, number]; dpr?: number; } /** * Backend preference */ export type BackendPreference = "webgpu" | "webgl" | "auto"; /** * GPU Renderer options */ export interface GpuRendererOptions { backend?: BackendPreference; powerPreference?: "low-power" | "high-performance"; } /** * GPU Renderer - Unified renderer using the GPU abstraction layer */ export declare class GpuRenderer { private canvas; private options; private backend; private adapter; private dpr; private isInitialized; private backendType; private bufferDataMap; private stepBufferDataMap; private colormapDataMap; constructor(canvas: HTMLCanvasElement, options?: GpuRendererOptions); /** * Initialize the renderer */ init(): Promise; /** * Check if renderer is available */ get available(): boolean; /** * Get the active backend type */ get activeBackend(): "webgpu" | "webgl" | null; /** * Set device pixel ratio */ setDPR(dpr: number): void; /** * Check if vertex data exists for a buffer id */ hasBuffer(id: string): boolean; hasColormap(id: string): boolean; /** * Render from NativeWebGLRenderer-compatible series descriptors (chart integration path). */ renderNativeSeries(series: NativeSeriesRenderData[], options: GpuNativeRenderOptions): void; private appendBoxplotDraws; private appendWaterfallDraws; private pushDraw; private seriesColor; private colorFromHex; private mapNativeDrawKind; /** * Create or update a buffer */ createBuffer(id: string, data: Float32Array): void; /** * Update a buffer partially */ updateBuffer(id: string, data: Float32Array, offsetInBytes: number): boolean; /** * Get a buffer's data */ getBuffer(id: string): Float32Array | undefined; /** * Delete a buffer */ deleteBuffer(id: string): void; /** * Create or update a step buffer */ createStepBuffer(id: string, data: Float32Array): void; /** * Create colormap texture */ createColormapTexture(id: string, data: Uint8Array): void; /** * Render a frame */ render(series: GpuSeriesRenderData[], options: GpuRenderOptions): void; /** * Build draw list from series data */ private buildDrawList; /** * Handle canvas resize */ resize(): void; /** * Get renderer limits */ getLimits(): Record; /** * Destroy the renderer */ destroy(): void; } /** * Create a GPU renderer (async) */ export declare function createGpuRenderer(canvas: HTMLCanvasElement, options?: GpuRendererOptions): Promise;