|
@@ -21,6 +21,8 @@
|
|
|
*/
|
|
|
package js.lib;
|
|
|
|
|
|
+import js.lib.intl.NumberFormat.NumberFormatOptions;
|
|
|
+
|
|
|
/**
|
|
|
The `Uint8ClampedArray` typed array represents an array of 8-bit unsigned integers clamped
|
|
|
to 0-255; if you specified a value that is out of the range of [0,255], 0 or 255 will be set instead;
|
|
@@ -32,45 +34,231 @@ package js.lib;
|
|
|
**/
|
|
|
@:native("Uint8ClampedArray")
|
|
|
extern class Uint8ClampedArray implements ArrayAccess<Int> {
|
|
|
- static inline var BYTES_PER_ELEMENT : Int = 1;
|
|
|
+ /**
|
|
|
+ Returns a number value of the element size. 1 in the case of an `Uint8ClampedArray`.
|
|
|
+ */
|
|
|
+ static final BYTES_PER_ELEMENT : Int;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Creates a new `Uint8ClampedArray` from an array-like or iterable object. See also [Array.from()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from).
|
|
|
+ */
|
|
|
+ @:overload(function( source : {}, ?mapFn : (value : Int) -> Int, ?thisArg : Any ) : Uint8ClampedArray {})
|
|
|
+ @:pure static function from( source : {}, ?mapFn : (value : Int, index : Int) -> Int, ?thisArg : Any ) : Uint8ClampedArray;
|
|
|
|
|
|
- @:pure
|
|
|
- static function of( items : haxe.extern.Rest<Array<Dynamic>> ) : Uint8ClampedArray;
|
|
|
- @:pure
|
|
|
- static function from( source : Array<Int>, ?mapFn : Int -> Int -> Int, ?thisArg : Dynamic ) : Uint8ClampedArray;
|
|
|
+ /**
|
|
|
+ Creates a new `Uint8ClampedArray` with a variable number of arguments. See also [Array.of()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/of).
|
|
|
+ */
|
|
|
+ @:pure static function of( elements : haxe.extern.Rest<Dynamic> ) : Uint8ClampedArray;
|
|
|
|
|
|
+ /**
|
|
|
+ Returns a number value of the element size.
|
|
|
+ */
|
|
|
@:native("BYTES_PER_ELEMENT")
|
|
|
final BYTES_PER_ELEMENT_ : Int;
|
|
|
- final length : Int;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns the `ArrayBuffer` referenced by the `Uint8ClampedArray` Fixed at construction time and thus read only.
|
|
|
+ */
|
|
|
final buffer : ArrayBuffer;
|
|
|
- final byteOffset : Int;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns the length (in bytes) of the `Uint8ClampedArray` from the start of its `ArrayBuffer`. Fixed at construction time and thus read only.
|
|
|
+ */
|
|
|
final byteLength : Int;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns the offset (in bytes) of the `Uint8ClampedArray` from the start of its `ArrayBuffer`. Fixed at construction time and thus read only.
|
|
|
+ */
|
|
|
+ final byteOffset : Int;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns the number of elements hold in the `Uint8ClampedArray`. Fixed at construction time and thus read only.
|
|
|
+ */
|
|
|
+ final length : Int;
|
|
|
|
|
|
/** @throws DOMError */
|
|
|
- @:overload( function( length : Int ) : Void {} )
|
|
|
- @:overload( function( array : Uint8ClampedArray ) : Void {} )
|
|
|
- @:overload( function( array : Array<Int> ) : Void {} )
|
|
|
- function new( buffer : ArrayBuffer, ?byteOffset : Int, ?length : Int ) : Void;
|
|
|
- @:overload( function( array : Uint8ClampedArray, ?offset : Int ) : Void {} )
|
|
|
- function set( array : Array<Int>, ?offset : Int ) : Void;
|
|
|
+ @:overload( function ( length : Int ) : Void {} )
|
|
|
+ @:overload( function ( object : {} ) : Void {} )
|
|
|
+ @:pure function new( buffer : ArrayBuffer, ?byteOffset : Int, ?length : Int ) : Void;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Copies a sequence of array elements within the array.
|
|
|
+ See also [Array.prototype.copyWithin()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin).
|
|
|
+ */
|
|
|
function copyWithin( target : Int, start : Int, ?end : Int ) : Uint8ClampedArray;
|
|
|
- function every( callback : Int -> Int -> Uint8ClampedArray -> Bool, ?thisArg : Dynamic ) : Bool;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns a new Array Iterator object that contains the key/value pairs for each index in the array.
|
|
|
+ See also [Array.prototype.entries()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries).
|
|
|
+ */
|
|
|
+ @:pure function entries() : Iterator<Int>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Tests whether all elements in the array pass the test provided by a function.
|
|
|
+ See also [Array.prototype.every()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every).
|
|
|
+ */
|
|
|
+ @:overload(function ( callback : (currentValue : Int) -> Bool, ?thisArg : Any ) : Bool {})
|
|
|
+ @:overload(function ( callback : (currentValue : Int, index : Int) -> Bool, ?thisArg : Any ) : Bool {})
|
|
|
+ function every( callback : (currentValue : Int, index : Int, array : Uint8ClampedArray) -> Bool, ?thisArg : Any ) : Bool;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Fills all the elements of an array from a start index to an end index with a static value.
|
|
|
+ See also [Array.prototype.fill()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill).
|
|
|
+ */
|
|
|
function fill( value : Int, ?start : Int, ?end : Int ) : Uint8ClampedArray;
|
|
|
- function filter( callbackfn : Int -> Int -> Uint8ClampedArray -> Dynamic, ?thisArg : Dynamic ) : Uint8ClampedArray;
|
|
|
- function find( predicate : Int -> Int -> Uint8ClampedArray -> Bool, ?thisArg : Dynamic ) : Dynamic;
|
|
|
- function findIndex( predicate : Int -> Int -> Uint8ClampedArray -> Bool, ?thisArg : Dynamic ) : Int;
|
|
|
- function forEach( callbackfn : Int -> Int -> Uint8ClampedArray -> Void, ?thisArg : Dynamic ) : Void;
|
|
|
- function indexOf( searchElement : Int, ?fromIndex : Int ) : Int;
|
|
|
- function join( ?separator : String ) : String;
|
|
|
- function lastIndexOf( searchElement : Int, ?fromIndex : Int ) : Int;
|
|
|
- function map( callbackfn : Int -> Int -> Uint8ClampedArray -> Int, ?thisArg : Dynamic ) : Uint8ClampedArray;
|
|
|
- @:overload( function( callbackfn : Int -> Int -> Int -> Uint8ClampedArray -> Int ) : Int {} )
|
|
|
- function reduce( callbackfn : Dynamic -> Int -> Int -> Uint8ClampedArray -> Dynamic, initialValue : Dynamic ) : Dynamic;
|
|
|
- @:overload( function( callbackfn : Int -> Int -> Int -> Uint8ClampedArray -> Int ) : Int {} )
|
|
|
- function reduceRight( callbackfn : Dynamic -> Int -> Int -> Uint8ClampedArray -> Dynamic, initialValue : Dynamic ) : Dynamic;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Creates a new array with all of the elements of this array for which the provided filtering function returns true.
|
|
|
+ See also [Array.prototype.filter()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter).
|
|
|
+ */
|
|
|
+ @:overload(function ( callback : (element : Int) -> Bool, ?thisArg : Any ) : Uint8ClampedArray {})
|
|
|
+ @:overload(function ( callback : (element : Int, index : Int) -> Bool, ?thisArg : Any ) : Uint8ClampedArray {})
|
|
|
+ function filter( callback : (element : Int, index : Int, array : Uint8ClampedArray) -> Bool, ?thisArg : Any ) : Uint8ClampedArray;
|
|
|
+
|
|
|
+ /**
|
|
|
+ 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find).
|
|
|
+ */
|
|
|
+ @:overload(function ( callback : (element : Int) -> Bool, ?thisArg : Any ) : Null<Int> {})
|
|
|
+ @:overload(function ( callback : (element : Int, index : Int) -> Bool, ?thisArg : Any ) : Null<Int> {})
|
|
|
+ function find( callback : (element : Int, index : Int, array : Uint8ClampedArray) -> Bool, ?thisArg : Any ) : Null<Int>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex).
|
|
|
+ */
|
|
|
+ @:overload(function ( callback : (element : Int) -> Bool, ?thisArg : Any ) : Int {})
|
|
|
+ @:overload(function ( callback : (element : Int, index : Int) -> Bool, ?thisArg : Any ) : Int {})
|
|
|
+ function findIndex( callback : (element : Int, index : Int, array : Uint8ClampedArray) -> Bool, ?thisArg : Any ) : Int;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Calls a function for each element in the array.
|
|
|
+ See also [Array.prototype.forEach()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach).
|
|
|
+ */
|
|
|
+ @:overload(function ( callback : (element : Int) -> Void, ?thisArg : Any ) : Void {})
|
|
|
+ @:overload(function ( callback : (element : Int, index : Int) -> Void, ?thisArg : Any ) : Void {})
|
|
|
+ function forEach( callback : (element : Int, index : Int, array : Uint8ClampedArray) -> Void, ?thisArg : Any ) : Void;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Determines whether a typed array includes a certain element, returning true or false as appropriate.
|
|
|
+ See also [Array.prototype.includes()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes).
|
|
|
+ */
|
|
|
+ @:pure function includes( searchElement: Int, ?fromIndex: Int ): Bool;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf).
|
|
|
+ */
|
|
|
+ @:pure function indexOf( searchElement : Int, ?fromIndex : Int ) : Int;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Joins all elements of an array into a string.
|
|
|
+ See also [Array.prototype.join()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join).
|
|
|
+ */
|
|
|
+ @:pure function join( ?separator : String ) : String;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns a new Array Iterator that contains the keys for each index in the array.
|
|
|
+ See also [Array.prototype.keys()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/keys).
|
|
|
+ */
|
|
|
+ @:pure function keys() : Iterator<Int>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf).
|
|
|
+ */
|
|
|
+ @:pure function lastIndexOf( searchElement : Int, ?fromIndex : Int ) : Int;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Creates a new array with the results of calling a provided function on every element in this array.
|
|
|
+ See also [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map).
|
|
|
+ */
|
|
|
+ @:overload(function ( callback : (element : Int) -> Int, ?thisArg : Any ) : Uint8ClampedArray {})
|
|
|
+ @:overload(function ( callback : (element : Int, index : Int) -> Int, ?thisArg : Any ) : Uint8ClampedArray {})
|
|
|
+ function map( callback : (element : Int, index : Int, array : Uint8ClampedArray) -> Int, ?thisArg : Any ) : Uint8ClampedArray;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Apply 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce).
|
|
|
+ */
|
|
|
+ @:overload(function<T> ( callback : (previousValue : T, currentValue : Int) -> T, initialValue : T ) : T {} )
|
|
|
+ @:overload(function<T> ( callback : (previousValue : T, currentValue : Int, index : Int) -> T, initialValue : T ) : T {} )
|
|
|
+ @:overload(function( callbackfn : (previousValue : Int, currentValue : Int) -> Int ) : Int {} )
|
|
|
+ @:overload(function( callbackfn : (previousValue : Int, currentValue : Int, index : Int) -> Int ) : Int {} )
|
|
|
+ @:overload(function( callbackfn : (previousValue : Int, currentValue : Int, index : Int, array : Uint8ClampedArray) -> Int ) : Int {} )
|
|
|
+ function reduce<T>( callback : (previousValue : T, currentValue : Int, index : Int, array : Uint8ClampedArray) -> T, initialValue : T ) : T;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Apply 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()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduceRight).
|
|
|
+ */
|
|
|
+ @:overload(function<T> ( callback : (previousValue : T, currentValue : Int) -> T, initialValue : T ) : T {} )
|
|
|
+ @:overload(function<T> ( callback : (previousValue : T, currentValue : Int, index : Int) -> T, initialValue : T ) : T {} )
|
|
|
+ @:overload(function( callbackfn : (previousValue : Int, currentValue : Int) -> Int ) : Int {} )
|
|
|
+ @:overload(function( callbackfn : (previousValue : Int, currentValue : Int, index : Int) -> Int ) : Int {} )
|
|
|
+ @:overload(function( callbackfn : (previousValue : Int, currentValue : Int, index : Int, array : Uint8ClampedArray) -> Int ) : Int {} )
|
|
|
+ function reduceRight<T>( callback : (previousValue : T, currentValue : Int, index : Int, array : Uint8ClampedArray) -> T, initialValue : T ) : T;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Reverses the order of the elements of an array — the first becomes the last, and the last becomes the first.
|
|
|
+ See also [Array.prototype.reverse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse).
|
|
|
+ */
|
|
|
function reverse() : Uint8ClampedArray;
|
|
|
- function slice( ?start : Int, ?end : Int ) : Uint8ClampedArray;
|
|
|
- function some( callbackfn : Int -> Int -> Uint8ClampedArray -> Bool, ?thisArg : Dynamic ) : Bool;
|
|
|
- function sort( ?compareFn : Int -> Int -> Int ) : Uint8ClampedArray;
|
|
|
- function subarray( begin : Int, ?end : Int ) : Uint8ClampedArray;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Stores multiple values in the typed array, reading input values from a specified array.
|
|
|
+ */
|
|
|
+ @:overload( function ( array : Int8Array, ?offset : Int ) : Void {} )
|
|
|
+ @:overload( function ( array : Uint8Array, ?offset : Int ) : Void {} )
|
|
|
+ @:overload( function ( array : Uint8ClampedArray, ?offset : Int ) : Void {} )
|
|
|
+ @:overload( function ( array : Int16Array, ?offset : Int ) : Void {} )
|
|
|
+ @:overload( function ( array : Uint16Array, ?offset : Int ) : Void {} )
|
|
|
+ @:overload( function ( array : Int32Array, ?offset : Int ) : Void {} )
|
|
|
+ @:overload( function ( array : Uint32Array, ?offset : Int ) : Void {} )
|
|
|
+ @:overload( function ( array : Float32Array, ?offset : Int ) : Void {} )
|
|
|
+ @:overload( function ( array : Float64Array, ?offset : Int ) : Void {} )
|
|
|
+ function set( array : Array<Int>, ?offset : Int ) : Void;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Extracts a section of an array and returns a new array.
|
|
|
+ See also [Array.prototype.slice()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice).
|
|
|
+ */
|
|
|
+ @:pure function slice( ?start : Int, ?end : Int ) : Uint8ClampedArray;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns true if at least one element in this array satisfies the provided testing function.
|
|
|
+ See also [Array.prototype.some()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some).
|
|
|
+ */
|
|
|
+ @:overload(function ( callback : (element : Int) -> Bool, ?thisArg : Any ) : Bool {})
|
|
|
+ @:overload(function ( callback : (element : Int, index : Int) -> Bool, ?thisArg : Any ) : Bool {})
|
|
|
+ function some( callback : (element : Int, index : Int, array : Uint8ClampedArray) -> Bool, ?thisArg : Any ) : Bool;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Sorts the elements of an array in place and returns the array.
|
|
|
+ See also [Array.prototype.sort()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort).
|
|
|
+ */
|
|
|
+ function sort( ?compareFn : (x : Int, y : Int) -> Int ) : Uint8ClampedArray;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns a new TypedArray from the given start and end element index.
|
|
|
+ */
|
|
|
+ @:pure function subarray( ?begin : Int, ?end : Int ) : Uint8ClampedArray;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns a new Array Iterator object that contains the values for each index in the array.
|
|
|
+ See also [Array.prototype.values()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/values).
|
|
|
+ */
|
|
|
+ @:pure function values() : Iterator<Int>;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns a string representing the array and its elements.
|
|
|
+ See also [Array.prototype.toString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString).
|
|
|
+ */
|
|
|
+ @:pure function toLocaleString( ?locales : String, ?options : NumberFormatOptions ) : String;
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns a string representing the array and its elements.
|
|
|
+ See also [Array.prototype.toString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString).
|
|
|
+ */
|
|
|
+ @:pure function toString(): String;
|
|
|
}
|