package js.lib
implements ArrayBufferView
Available on js
The Int8Array typed array represents an array of twos-complement 8-bit signed integers. The contents are initialized to 0. Once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation).
Documentation Int8Array by Mozilla Contributors, licensed under CC-BY-SA 2.5.
staticfinalread onlyBYTES_PER_ELEMENT:IntReturns a number value of the element size. 1 in the case of an Int8Array.
staticfrom(source:{}, ?mapFn:(value:Int, index:Int) ‑> Int, ?thisArg:Any):Int8Arraystaticfrom(source:{}, ?mapFn:(value:Int) ‑> Int, ?thisArg:Any):Int8ArrayCreates a new Int8Array from an array-like or iterable object. See also Array.from().
staticof(elements:Rest<Dynamic>):Int8ArrayCreates a new Int8Array with a variable number of arguments. See also Array.of().
new(buffer:ArrayBuffer, ?byteOffset:Int, ?length:Int)new(length:Int)new(object:{})Throws:
null |
DOMError |
|---|
finalBYTES_PER_ELEMENT_:IntReturns a number value of the element size.
finalbuffer:ArrayBufferReturns the ArrayBuffer referenced by the Int8Array Fixed at construction time and thus read only.
finalbyteLength:IntReturns the length (in bytes) of the Int8Array from the start of its ArrayBuffer. Fixed at construction time and thus read only.
finalbyteOffset:IntReturns the offset (in bytes) of the Int8Array from the start of its ArrayBuffer. Fixed at construction time and thus read only.
finallength:IntReturns the number of elements hold in the Int8Array. Fixed at construction time and thus read only.
copyWithin(target:Int, start:Int, ?end:Int):Int8ArrayCopies a sequence of array elements within the array. See also Array.prototype.copyWithin().
entries():Iterator<KeyValue<Int, Int>>Returns a new Array Iterator object that contains the key/value pairs for each index in the array. See also Array.prototype.entries().
every(callback:(currentValue:Int, index:Int, array:Int8Array) ‑> Bool, ?thisArg:Any):Boolevery(callback:(currentValue:Int) ‑> Bool, ?thisArg:Any):Boolevery(callback:(currentValue:Int, index:Int) ‑> Bool, ?thisArg:Any):BoolTests whether all elements in the array pass the test provided by a function. See also Array.prototype.every().
fill(value:Int, ?start:Int, ?end:Int):Int8ArrayFills all the elements of an array from a start index to an end index with a static value. See also Array.prototype.fill().
filter(callback:(element:Int, index:Int, array:Int8Array) ‑> Bool, ?thisArg:Any):Int8Arrayfilter(callback:(element:Int) ‑> Bool, ?thisArg:Any):Int8Arrayfilter(callback:(element:Int, index:Int) ‑> Bool, ?thisArg:Any):Int8ArrayCreates a new array with all of the elements of this array for which the provided filtering function returns true. See also Array.prototype.filter().
find(callback:(element:Int, index:Int, array:Int8Array) ‑> Bool, ?thisArg:Any):Null<Int>find(callback:(element:Int) ‑> Bool, ?thisArg:Any):Null<Int>find(callback:(element:Int, index:Int) ‑> Bool, ?thisArg:Any):Null<Int>Returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found. See also Array.prototype.find().
findIndex(callback:(element:Int, index:Int, array:Int8Array) ‑> Bool, ?thisArg:Any):IntfindIndex(callback:(element:Int) ‑> Bool, ?thisArg:Any):IntfindIndex(callback:(element:Int, index:Int) ‑> Bool, ?thisArg:Any):IntReturns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found. See also Array.prototype.findIndex().
forEach(callback:(element:Int, index:Int, array:Int8Array) ‑> Void, ?thisArg:Any):VoidforEach(callback:(element:Int) ‑> Void, ?thisArg:Any):VoidforEach(callback:(element:Int, index:Int) ‑> Void, ?thisArg:Any):VoidCalls a function for each element in the array. See also Array.prototype.forEach().
includes(searchElement:Int, ?fromIndex:Int):BoolDetermines whether a typed array includes a certain element, returning true or false as appropriate. See also Array.prototype.includes().
indexOf(searchElement:Int, ?fromIndex:Int):IntReturns the first (least) index of an element within the array equal to the specified value, or -1 if none is found. See also Array.prototype.indexOf().
join(?separator:String):StringJoins all elements of an array into a string. See also Array.prototype.join().
keys():Iterator<Int>Returns a new Array Iterator that contains the keys for each index in the array. See also Array.prototype.keys().
lastIndexOf(searchElement:Int, ?fromIndex:Int):IntReturns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found. See also Array.prototype.lastIndexOf().
map(callback:(element:Int, index:Int, array:Int8Array) ‑> Int, ?thisArg:Any):Int8Arraymap(callback:(element:Int) ‑> Int, ?thisArg:Any):Int8Arraymap(callback:(element:Int, index:Int) ‑> Int, ?thisArg:Any):Int8ArrayCreates a new array with the results of calling a provided function on every element in this array. See also Array.prototype.map().
reduce<T>(callback:(previousValue:T, currentValue:Int, index:Int, array:Int8Array) ‑> T, initialValue:T):Treduce<T>(callback:(previousValue:T, currentValue:Int) ‑> T, initialValue:T):Treduce<T>(callback:(previousValue:T, currentValue:Int, index:Int) ‑> T, initialValue:T):Treduce(callbackfn:(previousValue:Int, currentValue:Int) ‑> Int):Intreduce(callbackfn:(previousValue:Int, currentValue:Int, index:Int) ‑> Int):Intreduce(callbackfn:(previousValue:Int, currentValue:Int, index:Int, array:Int8Array) ‑> Int):IntApply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value. See also Array.prototype.reduce().
reduceRight<T>(callback:(previousValue:T, currentValue:Int, index:Int, array:Int8Array) ‑> T, initialValue:T):TreduceRight<T>(callback:(previousValue:T, currentValue:Int) ‑> T, initialValue:T):TreduceRight<T>(callback:(previousValue:T, currentValue:Int, index:Int) ‑> T, initialValue:T):TreduceRight(callbackfn:(previousValue:Int, currentValue:Int) ‑> Int):IntreduceRight(callbackfn:(previousValue:Int, currentValue:Int, index:Int) ‑> Int):IntreduceRight(callbackfn:(previousValue:Int, currentValue:Int, index:Int, array:Int8Array) ‑> Int):IntApply a function against an accumulator and each value of the array (from right-to-left) as to reduce it to a single value. See also Array.prototype.reduceRight().
reverse():Int8ArrayReverses the order of the elements of an array — the first becomes the last, and the last becomes the first. See also Array.prototype.reverse().
set(array:Array<Int>, ?offset:Int):Voidset(array:Int8Array, ?offset:Int):Voidset(array:Uint8Array, ?offset:Int):Voidset(array:Uint8ClampedArray, ?offset:Int):Voidset(array:Int16Array, ?offset:Int):Voidset(array:Uint16Array, ?offset:Int):Voidset(array:Int32Array, ?offset:Int):Voidset(array:Uint32Array, ?offset:Int):Voidset(array:Float32Array, ?offset:Int):Voidset(array:Float64Array, ?offset:Int):VoidStores multiple values in the typed array, reading input values from a specified array.
slice(?start:Int, ?end:Int):Int8ArrayExtracts a section of an array and returns a new array. See also Array.prototype.slice().
some(callback:(element:Int, index:Int, array:Int8Array) ‑> Bool, ?thisArg:Any):Boolsome(callback:(element:Int) ‑> Bool, ?thisArg:Any):Boolsome(callback:(element:Int, index:Int) ‑> Bool, ?thisArg:Any):BoolReturns true if at least one element in this array satisfies the provided testing function. See also Array.prototype.some().
sort(?compareFn:(x:Int, y:Int) ‑> Int):Int8ArraySorts the elements of an array in place and returns the array. See also Array.prototype.sort().
subarray(?begin:Int, ?end:Int):Int8ArrayReturns a new TypedArray from the given start and end element index.
toLocaleString(?locales:String, ?options:Null<NumberFormatOptions>):StringReturns a string representing the array and its elements. See also Array.prototype.toString().
toString():StringReturns a string representing the array and its elements. See also Array.prototype.toString().
values():Iterator<Int>Returns a new Array Iterator object that contains the values for each index in the array. See also Array.prototype.values().
© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/lib/Int8Array.html