Skip to content

Vibe coding a plugin? Teach your agent Modlumi first. Works with Claude Code, Codex, Cursor and more.

Uint8Array

A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the requested number of bytes could not be allocated an exception is raised.

TArrayBuffer extends ArrayBufferLike = ArrayBufferLike

[index: number]: number

readonly [toStringTag]: "Uint8Array"


readonly buffer: TArrayBuffer

The ArrayBuffer instance referenced by the array.


readonly byteLength: number

The length in bytes of the array.


readonly byteOffset: number

The offset in bytes of the array.


readonly BYTES_PER_ELEMENT: number

The size in bytes of each element in the array.


readonly length: number

The length of the array.

[iterator](): ArrayIterator<number>

ArrayIterator<number>


at(index): number | undefined

Returns the item located at the specified index.

number

The zero-based index of the desired code unit. A negative index will count back from the last item.

number | undefined


copyWithin(target, start, end?): this

Returns the this object after copying a section of the array identified by start and end to the same array starting at position target

number

If target is negative, it is treated as length+target where length is the length of the array.

number

If start is negative, it is treated as length+start. If end is negative, it is treated as length+end.

number

If not specified, length of the this object is used as its default value.

this


entries(): ArrayIterator<[number, number]>

Returns an array of key, value pairs for every entry in the array

ArrayIterator<[number, number]>


every(predicate, thisArg?): boolean

Determines whether all the members of an array satisfy the specified test.

(value, index, array) => unknown

A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array.

any

An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

boolean


fill(value, start?, end?): this

Changes all array elements from start to end index to a static value and returns the modified array

number

value to fill array section with

number

index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array.

number

index to stop filling the array at. If end is negative, it is treated as length+end.

this


filter(predicate, thisArg?): Uint8Array<ArrayBuffer>

Returns the elements of an array that meet the condition specified in a callback function.

(value, index, array) => any

A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.

any

An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

Uint8Array<ArrayBuffer>


find(predicate, thisArg?): number | undefined

Returns the value of the first element in the array where predicate is true, and undefined otherwise.

(value, index, obj) => boolean

find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined.

any

If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

number | undefined


findIndex(predicate, thisArg?): number

Returns the index of the first element in the array where predicate is true, and -1 otherwise.

(value, index, obj) => boolean

find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1.

any

If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

number


findLast<S>(predicate, thisArg?): S | undefined

Returns the value of the last element in the array where predicate is true, and undefined otherwise.

S extends number

(value, index, array) => value is S

findLast calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLast immediately returns that element value. Otherwise, findLast returns undefined.

any

If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

S | undefined

findLast(predicate, thisArg?): number | undefined

(value, index, array) => unknown

any

number | undefined


findLastIndex(predicate, thisArg?): number

Returns the index of the last element in the array where predicate is true, and -1 otherwise.

(value, index, array) => unknown

findLastIndex calls predicate once for each element of the array, in descending order, until it finds one where predicate returns true. If such an element is found, findLastIndex immediately returns that element index. Otherwise, findLastIndex returns -1.

any

If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead.

number


forEach(callbackfn, thisArg?): void

Performs the specified action for each element in an array.

(value, index, array) => void

A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.

any

An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

void


includes(searchElement, fromIndex?): boolean

Determines whether an array includes a certain element, returning true or false as appropriate.

number

The element to search for.

number

The position in this array at which to begin searching for searchElement.

boolean


indexOf(searchElement, fromIndex?): number

Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

number

The value to locate in the array.

number

The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

number


join(separator?): string

Adds all the elements of an array separated by the specified separator string.

string

A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.

string


keys(): ArrayIterator<number>

Returns an list of keys in the array

ArrayIterator<number>


lastIndexOf(searchElement, fromIndex?): number

Returns the index of the last occurrence of a value in an array, or -1 if it is not present.

number

The value to locate in the array.

number

The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

number


map(callbackfn, thisArg?): Uint8Array<ArrayBuffer>

Calls a defined callback function on each element of an array, and returns an array that contains the results.

(value, index, array) => number

A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.

any

An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.

Uint8Array<ArrayBuffer>


reduce(callbackfn): number

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

(previousValue, currentValue, currentIndex, array) => number

A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

number

reduce(callbackfn, initialValue): number

(previousValue, currentValue, currentIndex, array) => number

number

number

reduce<U>(callbackfn, initialValue): U

Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

U

(previousValue, currentValue, currentIndex, array) => U

A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.

U

If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

U


reduceRight(callbackfn): number

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

(previousValue, currentValue, currentIndex, array) => number

A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

number

reduceRight(callbackfn, initialValue): number

(previousValue, currentValue, currentIndex, array) => number

number

number

reduceRight<U>(callbackfn, initialValue): U

Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

U

(previousValue, currentValue, currentIndex, array) => U

A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.

U

If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.

U


reverse(): this

Reverses the elements in an Array.

this


set(array, offset?): void

Sets a value or an array of values.

ArrayLike<number>

A typed or untyped array of values to set.

number

The index in the current array at which the values are to be written.

void


slice(start?, end?): Uint8Array<ArrayBuffer>

Returns a section of an array.

number

The beginning of the specified portion of the array.

number

The end of the specified portion of the array. This is exclusive of the element at the index ‘end’.

Uint8Array<ArrayBuffer>


some(predicate, thisArg?): boolean

Determines whether the specified callback function returns true for any element of an array.

(value, index, array) => unknown

A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array.

any

An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value.

boolean


sort(compareFn?): this

Sorts an array.

(a, b) => number

Function used to determine the order of the elements. It is expected to return a negative value if first argument is less than second argument, zero if they’re equal and a positive value otherwise. If omitted, the elements are sorted in ascending order.

[11,2,22,1].sort((a, b) => a - b)

this


subarray(begin?, end?): Uint8Array<TArrayBuffer>

Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements at begin, inclusive, up to end, exclusive.

number

The index of the beginning of the array.

number

The index of the end of the array.

Uint8Array<TArrayBuffer>


toBase64(options?): string

Encodes the bytes as base64 text.

"base64" | "base64url"

boolean

string


toLocaleString(): string

Converts a number to a string by using the current locale.

string

toLocaleString(locales, options?): string

string | string[]

NumberFormatOptions

string


toReversed(): Uint8Array<ArrayBuffer>

Copies the array and returns the copy with the elements in reverse order.

Uint8Array<ArrayBuffer>


toSorted(compareFn?): Uint8Array<ArrayBuffer>

Copies and sorts the array.

(a, b) => number

Function used to determine the order of the elements. It is expected to return a negative value if the first argument is less than the second argument, zero if they’re equal, and a positive value otherwise. If omitted, the elements are sorted in ascending order.

const myNums = Uint8Array.from([11, 2, 22, 1]);
myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22]

Uint8Array<ArrayBuffer>


toString(): string

Returns a string representation of an array.

string


valueOf(): this

Returns the primitive value of the specified object.

this


values(): ArrayIterator<number>

Returns an list of values in the array

ArrayIterator<number>


with(index, value): Uint8Array<ArrayBuffer>

Copies the array and inserts the given number at the provided index.

number

The index of the value to overwrite. If the index is negative, then it replaces from the end of the array.

number

The value to insert into the copied array.

Uint8Array<ArrayBuffer>

A copy of the original array with the inserted value.