mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-07-31 06:02:11 +00:00
Implement TypedArray#every/some/findIndex and improve map/reduce/reduceRight (#433)
This commit is contained in:
12
std/assembly/index.d.ts
vendored
12
std/assembly/index.d.ts
vendored
@@ -591,6 +591,18 @@ declare abstract class TypedArray<T> implements ArrayBufferView<T> {
|
||||
callbackfn: (accumulator: W, value: T, index: i32, self: this) => W,
|
||||
initialValue: W,
|
||||
): W;
|
||||
/** The some() method tests whether some element in the typed array passes the test implemented by the provided function. This method has the same algorithm as Array.prototype.some().*/
|
||||
some(callbackfn: (value: T, index: i32, self: this) => bool): bool;
|
||||
/** The map() method creates a new typed array with the results of calling a provided function on every element in this typed array. This method has the same algorithm as Array.prototype.map().*/
|
||||
map(callbackfn: (value: T, index: i32, self: this) => T): this;
|
||||
/** The sort() method sorts the elements of a typed array numerically in place and returns the typed array. This method has the same algorithm as Array.prototype.sort(), except that sorts the values numerically instead of as strings. TypedArray is one of the typed array types here. */
|
||||
sort(callback?: (a: T, b: T) => i32): this;
|
||||
/** The fill() method fills all the elements of a typed array from a start index to an end index with a static value. This method has the same algorithm as Array.prototype.fill(). */
|
||||
fill(value: T, start?: i32, end?: i32): this;
|
||||
/** The findIndex() method returns an index in the typed array, if an element in the typed array satisfies the provided testing function. Otherwise -1 is returned. See also the find() [not implemented] method, which returns the value of a found element in the typed array instead of its index. */
|
||||
findIndex(callbackfn: (value: T, index: i32, self: this) => bool): i32;
|
||||
/** The every() method tests whether all elements in the typed array pass the test implemented by the provided function. This method has the same algorithm as Array.prototype.every(). */
|
||||
every(callbackfn: (value: T, index: i32, self: this) => bool): i32;
|
||||
}
|
||||
|
||||
/** An array of twos-complement 8-bit signed integers. */
|
||||
|
Reference in New Issue
Block a user