mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-23 19:51:47 +00:00
Add array methods: findIndex, reduce, some, every (#49)
This commit is contained in:
4
std/assembly.d.ts
vendored
4
std/assembly.d.ts
vendored
@ -273,12 +273,16 @@ declare class Array<T> {
|
||||
length: i32;
|
||||
/** Constructs a new array. */
|
||||
constructor(capacity?: i32);
|
||||
every(callbackfn: (element: T, index: i32, array?: Array<T>) => bool): bool;
|
||||
findIndex(predicate: (element: T, index: i32, array?: Array<T>) => bool): i32;
|
||||
includes(searchElement: T, fromIndex?: i32): bool;
|
||||
indexOf(searchElement: T, fromIndex?: i32): i32;
|
||||
lastIndexOf(searchElement: T, fromIndex?: i32): i32;
|
||||
push(element: T): void;
|
||||
pop(): T;
|
||||
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: i32, array: Array<T>) => U, initialValue: U): U;
|
||||
shift(): T;
|
||||
some(callbackfn: (element: T, index: i32, array?: Array<T>) => bool): bool;
|
||||
unshift(element: T): i32;
|
||||
slice(from: i32, to?: i32): T[];
|
||||
splice(start: i32, deleteCount?: i32): void;
|
||||
|
Reference in New Issue
Block a user