import { ParticleDataType } from "./ParticleDataType.js";

/**
 *
 * @param {ParticleDataType} type
 * @returns {*}
 */
export function typedArrayConstructorFromDataType(type) {
    switch (type) {
        case ParticleDataType.Float32:
            return Float32Array;
        case ParticleDataType.Float64:
            return Float64Array;
        case ParticleDataType.Uint8:
            return Uint8Array;
        default:
            throw new Error(`Unsupported type: ${type}`);
    }
}
