/** * @typedef {Object} ConverterMetadata * A function that extracts a raw attribute from a datum (optionally) converts * it to floats or float vectors that can be stored in GPU buffers. * @prop {function(object):any} f The converter * @prop {number[]} [arrayReference] An optimization for fp64 mainly * @prop {number} [numComponents] * @prop {typeof Uint16Array | typeof Int16Array | typeof Uint32Array | typeof Int32Array | typeof Float32Array} [targetArrayType] Defaults to Float32Array */ export default class ArrayBuilder { /** * * @param {number} size Size if known, uses TypedArray */ constructor(size: number); size: number; /** @type {Object.} */ arrays: { [x: string]: { data: Uint16Array | Int16Array | Uint32Array | Int32Array | Float32Array; numComponents: number; divisor?: number; }; }; /** @type {(function():void)[]} */ pushers: (() => void)[]; /** @type {(function(any):void)[]} */ dataUpdaters: ((arg0: any) => void)[]; vertexCount: number; configure(): void; /** * * @param {string} attribute * @param {ConverterMetadata} metadata */ addConverter(attribute: string, metadata: ConverterMetadata): void; /** * * @param {string} attributeName * @param {number} numComponents * @param {typeof Uint16Array | typeof Int16Array | typeof Uint32Array | typeof Int32Array | typeof Float32Array} [targetArrayType] * @param {number[]} [arrayReference] * @return {function(number|number[])} */ createUpdater(attributeName: string, numComponents: number, targetArrayType?: typeof Uint16Array | typeof Int16Array | typeof Uint32Array | typeof Int32Array | typeof Float32Array, arrayReference?: number[]): (arg0: number | number[]) => any; pushAll(): void; /** * @param {object} datum */ updateFromDatum(datum: object): void; /** * * @param {object} datum */ pushFromDatum(datum: object): void; #private; } /** * A function that extracts a raw attribute from a datum (optionally) converts * it to floats or float vectors that can be stored in GPU buffers. */ export type ConverterMetadata = { /** * The converter */ f: (arg0: object) => any; /** * An optimization for fp64 mainly */ arrayReference?: number[]; numComponents?: number; /** * Defaults to Float32Array */ targetArrayType?: typeof Uint16Array | typeof Int16Array | typeof Uint32Array | typeof Int32Array | typeof Float32Array; }; //# sourceMappingURL=arrayBuilder.d.ts.map