import { Renderer } from '../../../types';

/**
 * Abstract base class for WebGL-based renderers.
 *
 * Provides a shared WebGL canvas, rendering context, and utility methods for
 * consistent pixel reading and throttled animation timing.
 */
export declare abstract class WebGLRendererBase implements Renderer {
    /** The internal offscreen canvas used for rendering */
    protected canvas: HTMLCanvasElement;
    /** The WebGL rendering context used to draw and sample frames */
    protected gl: WebGLRenderingContext;
    /** The last known canvas width used for reading pixels */
    protected lastWidth: number;
    /** The last known canvas height used for reading pixels */
    protected lastHeight: number;
    /** Timestamp of the last frame update used for throttling */
    protected lastUpdate: number;
    constructor();
    /**
     * Reset the internal renderer state.
     * Must be implemented by subclasses to reset animation state.
     */
    abstract reset(): void;
    /**
     * Render a frame at the given resolution into the internal WebGL canvas.
     * This method should perform the draw but not return the pixels.
     *
     * @param width - The width of the canvas to render to
     * @param height - The height of the canvas to render to
     */
    abstract renderFrame(width: number, height: number): void;
    /**
     * Throttle rendering logic based on a minimum time interval.
     *
     * @param intervalMs - The minimum time in milliseconds between steps
     * @returns `true` if enough time has passed to perform a new step
     */
    protected shouldStep(intervalMs: number): boolean;
    /**
     * Read and return the current pixel buffer from the WebGL canvas.
     * The result is vertically flipped to match 2D canvas expectations.
     *
     * @param width - Optional override for width (defaults to `lastWidth`)
     * @param height - Optional override for height (defaults to `lastHeight`)
     * @returns A `Uint8ClampedArray` of RGBA pixel data
     */
    readPixels(width?: number, height?: number): Uint8ClampedArray;
}
//# sourceMappingURL=webgl-base-renderer.d.ts.map