/** Compile a WebGL shader, returns null on failure */
export declare function compileShader(gl: WebGLRenderingContext, type: number, src: string): WebGLShader | null;
/** Link a vertex + fragment shader into a program */
export declare function createProgram(gl: WebGLRenderingContext, vertSrc: string, fragSrc: string): WebGLProgram | null;
/**
 * Parse a hex color (`#rgb`, `#rgba`, `#rrggbb`, `#rrggbbaa`) to [r, g, b]
 * floats 0-1. Unparseable input returns a neutral fallback instead of NaN.
 */
export declare function hexToGL(hex: string): [number, number, number];
/** DPR with supersampling for crisp circles */
export declare function getCanvasDPR(): number;
/**
 * Create or get a WebGL context with correct alpha settings.
 * Uses premultiplied alpha for correct compositing over the page.
 */
export declare function getWebGLContext(canvas: HTMLCanvasElement): WebGLRenderingContext | null;
/**
 * Set up standard GL state for chart rendering:
 * - Clear with transparent
 * - Enable premultiplied alpha blending
 */
export declare function setupGLState(gl: WebGLRenderingContext): void;
/**
 * Size a canvas for sharp rendering, accounting for DPR.
 * Returns the DPR used.
 */
export declare function sizeCanvas(canvas: HTMLCanvasElement, width: number, height: number): number;
/**
 * Mount a canvas as an absolute-positioned sibling to an SVG element.
 * Automatically aligns with the SVG marker's position — no manual margin
 * offset needed. This is a Tier 1 guarantee: the canvas lands exactly
 * where the SVG content area is, regardless of chart margins or transforms.
 *
 * Call from a useEffect. Returns a cleanup function.
 */
export declare function mountCanvasOverSVG(svgMarker: SVGGraphicsElement, canvas: HTMLCanvasElement, width: number, height: number): (() => void) | undefined;
/**
 * GLSL fragment for premultiplied-alpha circle with smoothstep AA.
 * Use in fragment shaders that render point sprites.
 *
 * Expects:
 * - varying float v_alpha (the final alpha before edge AA)
 * - uniform vec3 u_color
 *
 * Returns: gl_FragColor with premultiplied alpha
 */
export declare const CIRCLE_FRAG_BODY = "\n    vec2 coord = gl_PointCoord - vec2(0.5);\n    float dist = length(coord);\n    if (dist > 0.5) discard;\n    float edge = 1.0 - smoothstep(0.48, 0.5, dist);\n    float a = v_alpha * edge;\n    gl_FragColor = vec4(u_color * a, a);\n";
/**
 * Smoothstep compensation factor for gl_PointSize.
 * The visible circle radius is 0.48 of the point sprite (smoothstep starts there),
 * so we scale up by 1/0.96 to match SVG circle radius exactly.
 */
export declare const POINT_SIZE_COMPENSATION: number;
//# sourceMappingURL=webgl.d.ts.map