typed-array-constructor
Version:
Get a typed array constructor based on the hypothetical max value it could contain. Signed or unsigned.
12 lines (11 loc) • 755 B
TypeScript
export default typedArrayConstructor;
/**
* Get a typed array constructor based on the hypothetical max value it could contain. Signed or unsigned.
*
* @alias module:typedArrayConstructor
* @param {number} maxValue The max value expected.
* @param {boolean} signed Get a signed or unsigned array.
* @returns {(Uint8Array|Uint16Array|Uint32Array|BigInt64Array|Int8Array|Int16Array|Int32Array|BigInt64Array)}
* @see [MDN TypedArray objects]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#typedarray_objects}
*/
declare function typedArrayConstructor(maxValue: number, signed: boolean): (Uint8Array | Uint16Array | Uint32Array | BigInt64Array | Int8Array | Int16Array | Int32Array | BigInt64Array);