/** * A generic constructor for an `ArrayBufferView` */ export interface ArrayBufferViewConstructor { readonly prototype: ArrayBufferView; new (length: number): ArrayBufferView; new (array: ArrayLike): ArrayBufferView; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): ArrayBufferView; new (array: ArrayLike | ArrayBuffer): ArrayBufferView; } /** * A generic typed array. * @see https://mdn.io/TypedArray */ export interface TypedArray extends ArrayBufferView { /** * The size in bytes of each element in the array. */ readonly BYTES_PER_ELEMENT: number; /** * Returns the this object after copying a section of the array identified by start and end * to the same array starting at position target * @param target If target is negative, it is treated as length+target where length is the * length of the array. * @param start If start is negative, it is treated as length+start. If end is negative, it * is treated as length+end. * @param end If not specified, length of the this object is used as its default value. */ copyWithin(target: number, start: number, end?: number): this; /** * Determines whether all the members of an array satisfy the specified test. * @param predicate A function that accepts up to three arguments. The every method calls * the predicate function for each element in the array until the predicate returns a value * which is coercible to the Boolean value false, or until the end of the array. * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ every(predicate: (value: TValue, index: number, array: this) => unknown, thisArg?: any): boolean; /** * Changes all array elements from `start` to `end` index to a static `value` and returns the modified array * @param value value to fill array section with * @param start index to start filling the array at. If start is negative, it is treated as * length+start where length is the length of the array. * @param end index to stop filling the array at. If end is negative, it is treated as * length+end. */ fill(value: TValue, start?: number, end?: number): this; /** * Returns the elements of an array that meet the condition specified in a callback function. * @param predicate A function that accepts up to three arguments. The filter method calls * the predicate function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ filter(predicate: (value: TValue, index: number, array: this) => any, thisArg?: any): TypedArray; /** * Returns the value of the first element in the array where predicate is true, and undefined * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, find * immediately returns that element value. Otherwise, find returns undefined. * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ find(predicate: (value: TValue, index: number, obj: this) => boolean, thisArg?: any): TValue | undefined; /** * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, * findIndex immediately returns that element index. Otherwise, findIndex returns -1. * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ findIndex(predicate: (value: TValue, index: number, obj: this) => boolean, thisArg?: any): number; /** * Performs the specified action for each element in an array. * @param callbackfn A function that accepts up to three arguments. forEach calls the * callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. * If thisArg is omitted, undefined is used as the this value. */ forEach(callbackfn: (value: TValue, index: number, array: this) => void, thisArg?: any): void; /** * Returns the index of the first occurrence of a value in an array. * @param searchElement The value to locate in the array. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the * search starts at index 0. */ indexOf(searchElement: TValue, fromIndex?: number): number; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the * resulting String. If omitted, the array elements are separated with a comma. */ join(separator?: string): string; /** * Returns the index of the last occurrence of a value in an array. * @param searchElement The value to locate in the array. * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the * search starts at index 0. */ lastIndexOf(searchElement: TValue, fromIndex?: number): number; /** * The length of the array. */ readonly length: number; /** * Calls a defined callback function on each element of an array, and returns an array that * contains the results. * @param callbackfn A function that accepts up to three arguments. The map method calls the * callbackfn function one time for each element in the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. * If thisArg is omitted, undefined is used as the this value. */ map(callbackfn: (value: TValue, index: number, array: this) => TValue, thisArg?: any): TypedArray; /** * Calls the specified callback function for all the elements in an array. The return value of * the callback function is the accumulated result, and is provided as an argument in the next * call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the * callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ reduce(callbackfn: (previousValue: TValue, currentValue: TValue, currentIndex: number, array: this) => number): number; reduce(callbackfn: (previousValue: TValue, currentValue: TValue, currentIndex: number, array: this) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of * the callback function is the accumulated result, and is provided as an argument in the next * call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the * callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ reduce(callbackfn: (previousValue: U, currentValue: TValue, currentIndex: number, array: this) => U, initialValue: U): U; /** * Calls the specified callback function for all the elements in an array, in descending order. * The return value of the callback function is the accumulated result, and is provided as an * argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls * the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ reduceRight(callbackfn: (previousValue: TValue, currentValue: TValue, currentIndex: number, array: this) => number): number; reduceRight(callbackfn: (previousValue: TValue, currentValue: TValue, currentIndex: number, array: this) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. * The return value of the callback function is the accumulated result, and is provided as an * argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls * the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ reduceRight(callbackfn: (previousValue: U, currentValue: TValue, currentIndex: TValue, array: this) => U, initialValue: U): U; /** * Reverses the elements in an Array. */ reverse(): this; /** * Sets a value or an array of values. * @param array A typed or untyped array of values to set. * @param offset The index in the current array at which the values are to be written. */ set(array: ArrayLike, offset?: number): void; /** * Returns a section of an array. * @param start The beginning of the specified portion of the array. * @param end The end of the specified portion of the array. This is exclusive of the element at the index 'end'. */ slice(start?: number, end?: number): TypedArray; /** * Determines whether the specified callback function returns true for any element of an array. * @param predicate A function that accepts up to three arguments. The some method calls * the predicate function for each element in the array until the predicate returns a value * which is coercible to the Boolean value true, or until the end of the array. * @param thisArg An object to which the this keyword can refer in the predicate function. * If thisArg is omitted, undefined is used as the this value. */ some(predicate: (value: TValue, index: number, array: this) => unknown, thisArg?: any): boolean; /** * Sorts an array. * @param compareFn Function used to determine the order of the elements. It is expected to return * a negative value if first argument is less than second argument, zero if they're equal and a positive * value otherwise. If omitted, the elements are sorted in ascending order. * ```ts * [11,2,22,1].sort((a, b) => a - b) * ``` */ sort(compareFn?: (a: TValue, b: TValue) => number): this; /** * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements * at begin, inclusive, up to end, exclusive. * @param begin The index of the beginning of the array. * @param end The index of the end of the array. */ subarray(begin?: number, end?: number): TypedArray; /** * Converts a number to a string by using the current locale. */ toLocaleString(): string; /** * Returns a string representation of an array. */ toString(): string; /** Returns the primitive value of the specified object. */ valueOf(): this; [index: number]: TValue; } export interface TypedArrayConstructor { readonly prototype: TypedArray; new (length: number): TypedArray; new (array: ArrayLike): TypedArray; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): TypedArray; new (array: ArrayLike | ArrayBuffer): TypedArray; readonly BYTES_PER_ELEMENT: number; } /** * Grows a buffer if it isn't large enough * @returns The original buffer if resized successfully, or a newly created buffer */ export declare function extendBuffer(buffer: T, newByteLength: number): T; export declare function toUint8Array(buffer: ArrayBufferLike | ArrayBufferView): Uint8Array; /** A generic view of an array buffer */ export declare class BufferView extends DataView implements ArrayBufferView { constructor(_buffer?: T | ArrayBufferView | ArrayLike | number, _byteOffset?: number, _byteLength?: number); } /** Creates a fixed-size array of a buffer view type */ export declare function BufferViewArray(element: T, size: number): { new (_buffer?: TArrayBuffer | ArrayBufferView | ArrayLike, _byteOffset?: number, _byteLength?: number): { [n: number]: any; readonly BYTES_PER_ELEMENT: number; readonly buffer: TArrayBuffer; readonly byteOffset: number; readonly byteLength: number; length: number; toString(): string; toLocaleString(): string; toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string; pop(): any; push(...items: any[]): number; concat(...items: ConcatArray[]): any[]; concat(...items: any[]): any[]; join(separator?: string): string; reverse(): any[]; shift(): any; slice(start?: number, end?: number): any[]; sort(compareFn?: ((a: any, b: any) => number) | undefined): /*elided*/ any; splice(start: number, deleteCount?: number): any[]; splice(start: number, deleteCount: number, ...items: any[]): any[]; unshift(...items: any[]): number; indexOf(searchElement: any, fromIndex?: number): number; lastIndexOf(searchElement: any, fromIndex?: number): number; every(predicate: (value: any, index: number, array: any[]) => value is S, thisArg?: any): this is S[]; every(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): boolean; some(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): boolean; forEach(callbackfn: (value: any, index: number, array: any[]) => void, thisArg?: any): void; map(callbackfn: (value: any, index: number, array: any[]) => U, thisArg?: any): U[]; filter(predicate: (value: any, index: number, array: any[]) => value is S, thisArg?: any): S[]; filter(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): any[]; reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; reduce(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; reduce(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; reduceRight(callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; reduceRight(callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; find(predicate: (value: any, index: number, obj: any[]) => value is S, thisArg?: any): S | undefined; find(predicate: (value: any, index: number, obj: any[]) => unknown, thisArg?: any): any; findIndex(predicate: (value: any, index: number, obj: any[]) => unknown, thisArg?: any): number; fill(value: any, start?: number, end?: number): /*elided*/ any; copyWithin(target: number, start: number, end?: number): /*elided*/ any; entries(): ArrayIterator<[number, any]>; keys(): ArrayIterator; values(): ArrayIterator; includes(searchElement: any, fromIndex?: number): boolean; flatMap(callback: (this: This, value: any, index: number, array: any[]) => U | readonly U[], thisArg?: This | undefined): U[]; flat(this: A, depth?: D | undefined): FlatArray[]; at(index: number): any; findLast(predicate: (value: any, index: number, array: any[]) => value is S, thisArg?: any): S | undefined; findLast(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): any; findLastIndex(predicate: (value: any, index: number, array: any[]) => unknown, thisArg?: any): number; toReversed(): any[]; toSorted(compareFn?: ((a: any, b: any) => number) | undefined): any[]; toSpliced(start: number, deleteCount: number, ...items: any[]): any[]; toSpliced(start: number, deleteCount?: number): any[]; with(index: number, value: any): any[]; [Symbol.iterator](): ArrayIterator; readonly [Symbol.unscopables]: { [x: number]: boolean | undefined; length?: boolean | undefined; toString?: boolean | undefined; toLocaleString?: boolean | undefined; pop?: boolean | undefined; push?: boolean | undefined; concat?: boolean | undefined; join?: boolean | undefined; reverse?: boolean | undefined; shift?: boolean | undefined; slice?: boolean | undefined; sort?: boolean | undefined; splice?: boolean | undefined; unshift?: boolean | undefined; indexOf?: boolean | undefined; lastIndexOf?: boolean | undefined; every?: boolean | undefined; some?: boolean | undefined; forEach?: boolean | undefined; map?: boolean | undefined; filter?: boolean | undefined; reduce?: boolean | undefined; reduceRight?: boolean | undefined; find?: boolean | undefined; findIndex?: boolean | undefined; fill?: boolean | undefined; copyWithin?: boolean | undefined; entries?: boolean | undefined; keys?: boolean | undefined; values?: boolean | undefined; includes?: boolean | undefined; flatMap?: boolean | undefined; flat?: boolean | undefined; at?: boolean | undefined; findLast?: boolean | undefined; findLastIndex?: boolean | undefined; toReversed?: boolean | undefined; toSorted?: boolean | undefined; toSpliced?: boolean | undefined; with?: boolean | undefined; [Symbol.iterator]?: boolean | undefined; readonly [Symbol.unscopables]?: boolean | undefined; }; }; isArray(arg: any): arg is any[]; from(arrayLike: ArrayLike): T_1[]; from(arrayLike: ArrayLike, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[]; from(iterable: Iterable | ArrayLike): T_1[]; from(iterable: Iterable | ArrayLike, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[]; of(...items: T_1[]): T_1[]; fromAsync(iterableOrArrayLike: AsyncIterable | Iterable> | ArrayLike>): Promise; fromAsync(iterableOrArrayLike: AsyncIterable | Iterable | ArrayLike, mapFn: (value: Awaited, index: number) => U, thisArg?: any): Promise[]>; readonly [Symbol.species]: ArrayConstructor; };