import type { WebGLContextManager } from "./context-manager"; type GL = WebGL2RenderingContext | WebGLRenderingContext; export interface Instancing { setDivisor(location: number, divisor: number): void; drawArraysInstanced(mode: number, first: number, count: number, instances: number): void; } /** * Return an Instancing helper for the given GL context. On WebGL2, native * `vertexAttribDivisor`/`drawArraysInstanced` are used; on WebGL1 the * ANGLE_instanced_arrays extension is looked up and cached by caller. * Negative attribute locations (optimized-out attributes) are tolerated by * `setDivisor` and ignored. */ export declare function getInstancing(glManager: WebGLContextManager): Instancing; /** * Allocate the static `[0, 1, 2, 3]` line-strip corner buffer used by * every instanced line/wick glyph: each corner index is multiplied by * `LINE_WIDTH_PX` in the shader to expand a 2-vertex segment into a * `TRIANGLE_STRIP` quad. Identical contents across all callers; one * helper avoids the four-way `createBuffer` / `bufferData` boilerplate. */ export declare function createLineCornerBuffer(gl: GL): WebGLBuffer; /** * Allocate the static `[(0,0), (1,0), (0,1), (1,1)]` quad-strip corner * buffer used by instanced rect glyphs (candlestick body). Used as a * `vec2 a_corner` attribute that the shader scales by per-instance * width/height to expand into a `TRIANGLE_STRIP` rect. */ export declare function createQuadCornerBuffer(gl: GL): WebGLBuffer; /** * Bind a per-instance float attribute from a named buffer in the buffer * pool. Returns `true` when the bind happened, `false` when the buffer * has not yet been allocated (caller should skip the draw rather than * paint zero data). No-op return `true` when `attr` is negative * (optimized-out attribute — drawing the rest is still valid). * * Render-path uses `peek`, never `getOrCreate`: the latter recreates * with zero-initialized contents when `_totalCapacity` has grown past * the current buffer, which would wipe the previous draw's vertex * data and leave `drawArraysInstanced` to render zeros. See * {@link BufferPool#peek} for the full rationale. */ export declare function bindInstancedFloatAttr(glManager: WebGLContextManager, instancing: Instancing, attr: number, name: string, components: number): boolean; export {};