Implement Array.isArray and Array#copyWithin (#331)

This commit is contained in:
Max Graey
2018-11-12 08:45:40 +02:00
committed by Daniel Wirtz
parent 4e89456dcb
commit 1882679807
13 changed files with 3591 additions and 2367 deletions

View File

@ -541,11 +541,15 @@ declare class Float64Array extends TypedArray<f64> {}
/** Class representing a sequence of values of type `T`. */
declare class Array<T> {
static isArray<U>(value: any): value is Array<any>;
[key: number]: T;
/** Current length of the array. */
length: i32;
/** Constructs a new array. */
constructor(capacity?: i32);
fill(value: T, start?: i32, end?: i32): this;
every(callbackfn: (element: T, index: i32, array?: Array<T>) => bool): bool;
findIndex(predicate: (element: T, index: i32, array?: Array<T>) => bool): i32;
@ -554,6 +558,7 @@ declare class Array<T> {
lastIndexOf(searchElement: T, fromIndex?: i32): i32;
push(element: T): i32;
concat(items: T[]): T[];
copyWithin(target: i32, start: i32, end?: i32): this;
pop(): T;
forEach(callbackfn: (value: T, index: i32, array: Array<T>) => void): void;
map<U>(callbackfn: (value: T, index: i32, array: Array<T>) => U): Array<U>;