import type { Synth } from "../synth"; export interface BufferProps { name?: string; buffer?: WebGLBuffer; data?: BufferSource | GLsizeiptr | number[] | ArrayBufferView; type?: number | BufferType; size?: number; target?: number | keyof typeof TARGETS; usage?: number | keyof typeof USAGES; stride?: number; offset?: number; divisor?: number; } export type BufferContructor = number[] | ArrayBuffer | Partial; export declare class Buffer { synth: Synth; name: string; _buffer: WebGLBuffer; _data: ArrayBufferView | GLsizeiptr; _stride: number; _offset: number; _type: keyof typeof WebGLBufferTypeArrayConstructor; _size: number; _target: number; _usage: number; _divisor?: number; constructor(synth: Synth, props: BufferProps); data(data: BufferSource | GLsizeiptr | Array | ArrayBufferView, size?: number, type?: BufferType | BufferTypeString): this; stride(stride: number, offset?: number): this; size(size: number): this; usage(usage: number | keyof typeof USAGES): this; createData(): this; indices(data: BufferSource | GLsizeiptr | Array | ArrayBufferView, type?: BufferType | BufferTypeString): this; target(target: number | "attr" | "indices"): this; divisor(divisor: number): this; type(type?: BufferType | keyof typeof BUFFER_TYPES): this; clear(): void; print(): Promise; read(store?: boolean): Promise; clone(): Buffer; } export declare const GL_ARRAY_BUFFER = 34962; export declare const GL_ELEMENT_ARRAY_BUFFER = 34963; export declare const GL_BYTE = 5120; export declare const GL_UNSIGNED_BYTE = 5121; export declare const GL_SHORT = 5122; export declare const GL_UNSIGNED_SHORT = 5123; export declare const GL_INT = 5124; export declare const GL_UNSIGNED_INT = 5125; export declare const GL_FLOAT = 5126; export declare const GL_STATIC_DRAW = 35044; export declare const GL_DYNAMIC_DRAW = 35048; export declare const GL_STREAM_DRAW = 35040; export declare const GL_STREAM_READ = 35041; export declare const GL_STREAM_COPY = 35042; export declare const GL_STATIC_READ = 35045; export declare const GL_STATIC_COPY = 35046; export declare const GL_DYNAMIC_READ = 35049; export declare const GL_DYNAMIC_COPY = 35050; export declare const GL_INTERLEAVED_ATTRIBS = 35980; export declare const GL_SEPARATE_ATTRIBS = 35981; declare const USAGES: { readonly static: 35044; readonly dynamic: 35048; readonly stream: 35040; readonly "static read": 35045; readonly "dynamic read": 35049; readonly "stream read": 35041; readonly "static copy": 35046; readonly "dynamic copy": 35050; readonly "stream copy": 35042; }; declare const TARGETS: { readonly attr: 34962; readonly indices: 34963; }; export type BufferTypeString = "byte" | "ubyte" | "short" | "ushort" | "int" | "uint" | "float"; export declare const BUFFER_TYPES: Record; export declare function bufferTypeName(type: BufferType | keyof typeof BUFFER_TYPES): BufferTypeString; export declare function bufferType(type: keyof typeof BUFFER_TYPES | number): BufferType; export declare const WebGLBufferTypeArrayConstructor: { readonly 5120: Int8ArrayConstructor; readonly 5121: Uint8ArrayConstructor; readonly 5122: Int16ArrayConstructor; readonly 5123: Uint16ArrayConstructor; readonly 5124: Int32ArrayConstructor; readonly 5125: Uint32ArrayConstructor; readonly 5126: Float32ArrayConstructor; }; export type BufferType = keyof typeof WebGLBufferTypeArrayConstructor; export type BufferArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array; export declare function glTypeToTypedArray(type: BufferType): (typeof WebGLBufferTypeArrayConstructor)[BufferType]; export declare function webglBufferToTypedArray(gl: WebGL2RenderingContext, buffer: WebGLBuffer, type: BufferType, target?: number): Uint8Array | Int8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array; export {};