Skip to content

StdLib TypedArray

Roger Johansson edited this page Jan 14, 2026 · 1 revision

TypedArray, ArrayBuffer, DataView

Binary data handling types for efficient numeric arrays and buffer manipulation.

Implementation Status: 100% Complete

Overview

Category Items Implemented
TypedArray Types 11 11
TypedArray Methods 40 40
ArrayBuffer Methods 11 11
DataView Methods 28 28
Total 90 90

TypedArray Types

Type Element Size Range
Int8Array 1 byte -128 to 127
Uint8Array 1 byte 0 to 255
Uint8ClampedArray 1 byte 0 to 255 (clamped)
Int16Array 2 bytes -32768 to 32767
Uint16Array 2 bytes 0 to 65535
Int32Array 4 bytes -2^31 to 2^31-1
Uint32Array 4 bytes 0 to 2^32-1
Float32Array 4 bytes IEEE 754 float
Float64Array 8 bytes IEEE 754 double
BigInt64Array 8 bytes -2^63 to 2^63-1
BigUint64Array 8 bytes 0 to 2^64-1

TypedArray Static Methods

Method Status Description
TypedArray.from(source, mapFn, thisArg) Implemented Creates from iterable
TypedArray.of(...items) Implemented Creates from arguments
TypedArray[Symbol.species] Implemented Returns constructor

TypedArray Prototype Methods

Accessor Methods

Method Status Description
at(index) Implemented Relative indexing
buffer (getter) Implemented Backing ArrayBuffer
byteLength (getter) Implemented Byte length
byteOffset (getter) Implemented Byte offset
length (getter) Implemented Element count

Search Methods

Method Status Description
includes(value, fromIndex) Implemented Checks for element
indexOf(value, fromIndex) Implemented Finds element
lastIndexOf(value, fromIndex) Implemented Finds last element

Iteration Methods

Method Status Description
entries() Implemented [index, value] iterator
keys() Implemented Index iterator
values() Implemented Value iterator
forEach(callback, thisArg) Implemented Iterates elements
[Symbol.iterator] Implemented Alias for values()

Transform Methods

Method Status Description
map(callback, thisArg) Implemented Maps elements
filter(callback, thisArg) Implemented Filters elements
reduce(callback, initialValue) Implemented Reduces left-to-right
reduceRight(callback, initialValue) Implemented Reduces right-to-left
find(predicate, thisArg) Implemented Finds first match
findIndex(predicate, thisArg) Implemented Finds first index
findLast(predicate, thisArg) Implemented Finds last match
findLastIndex(predicate, thisArg) Implemented Finds last index
some(callback, thisArg) Implemented Tests any match
every(callback, thisArg) Implemented Tests all match

Mutator Methods

Method Status Description
set(source, offset) Implemented Sets from array
fill(value, start, end) Implemented Fills with value
copyWithin(target, start, end) Implemented Copies within
reverse() Implemented Reverses in place
sort(compareFn) Implemented Sorts in place

Copy Methods (ES2023)

Method Status Description
toReversed() Implemented Returns reversed copy
toSorted(compareFn) Implemented Returns sorted copy
toSpliced(start, deleteCount, ...items) Implemented Returns spliced copy
with(index, value) Implemented Returns copy with replacement

Other Methods

Method Status Description
slice(start, end) Implemented Returns portion copy
subarray(begin, end) Implemented Returns view (shared buffer)
join(separator) Implemented Joins to string
toString() Implemented Shared with Array
toLocaleString() Implemented Locale string

ArrayBuffer

A fixed-length raw binary data buffer.

Constructor

new ArrayBuffer(byteLength)
new ArrayBuffer(byteLength, { maxByteLength })  // Resizable (ES2024)

Static Methods

Method Status Description
ArrayBuffer.isView(arg) Implemented Checks for TypedArray/DataView
ArrayBuffer[Symbol.species] Implemented Returns constructor

Prototype Methods

Method Status Description
byteLength (getter) Implemented Buffer size
detached (getter) Implemented Detachment status
maxByteLength (getter) Implemented Max size for resizable
resizable (getter) Implemented Is resizable
resize(newLength) Implemented Resizes buffer (ES2024)
slice(start, end) Implemented Returns copy of portion
transfer(newLength) Implemented Transfers to new buffer (ES2024)
transferToFixedLength(newLength) Implemented Transfers to fixed buffer (ES2024)

DataView

A view for reading/writing arbitrary data at any byte offset.

Constructor

new DataView(buffer, byteOffset, byteLength)

Properties

Property Status Description
buffer Implemented Backing ArrayBuffer
byteLength Implemented View size
byteOffset Implemented View offset

Getter Methods

Method Status Description
getInt8(offset) Implemented Read signed 8-bit
getUint8(offset) Implemented Read unsigned 8-bit
getInt16(offset, littleEndian) Implemented Read signed 16-bit
getUint16(offset, littleEndian) Implemented Read unsigned 16-bit
getInt32(offset, littleEndian) Implemented Read signed 32-bit
getUint32(offset, littleEndian) Implemented Read unsigned 32-bit
getFloat32(offset, littleEndian) Implemented Read 32-bit float
getFloat64(offset, littleEndian) Implemented Read 64-bit float
getFloat16(offset, littleEndian) Implemented Read 16-bit float (ES2024)
getBigInt64(offset, littleEndian) Implemented Read 64-bit BigInt
getBigUint64(offset, littleEndian) Implemented Read unsigned 64-bit BigInt

Setter Methods

Method Status Description
setInt8(offset, value) Implemented Write signed 8-bit
setUint8(offset, value) Implemented Write unsigned 8-bit
setInt16(offset, value, littleEndian) Implemented Write signed 16-bit
setUint16(offset, value, littleEndian) Implemented Write unsigned 16-bit
setInt32(offset, value, littleEndian) Implemented Write signed 32-bit
setUint32(offset, value, littleEndian) Implemented Write unsigned 32-bit
setFloat32(offset, value, littleEndian) Implemented Write 32-bit float
setFloat64(offset, value, littleEndian) Implemented Write 64-bit float
setFloat16(offset, value, littleEndian) Implemented Write 16-bit float (ES2024)
setBigInt64(offset, value, littleEndian) Implemented Write 64-bit BigInt
setBigUint64(offset, value, littleEndian) Implemented Write unsigned 64-bit BigInt

Implementation Notes

Resizable Buffers (ES2024)

ArrayBuffers can be created with maxByteLength option and resized later.

Float16 (ES2024)

DataView supports 16-bit floats via getFloat16/setFloat16.

Detachment

Buffers can be detached via transfer(), making them unusable.

BigInt Arrays

BigInt64Array and BigUint64Array work with BigInt values, not Numbers.

Files

File Purpose
StdLib/TypedArray/TypedArrayConstructor.cs Constructor
StdLib/TypedArray/TypedArrayPrototype.cs Prototype methods
StdLib/ArrayBuffer/ArrayBufferConstructor.cs ArrayBuffer constructor
StdLib/ArrayBuffer/ArrayBufferPrototype.cs ArrayBuffer methods
StdLib/DataView/DataViewConstructor.cs DataView constructor
StdLib/DataView/DataViewPrototype.cs DataView methods
JsTypes/Js*Array.cs TypedArray implementations

See Also

Clone this wiki locally