rc-js-util
Version:
A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.
180 lines • 7.56 kB
JavaScript
/**
* @public
* Common methods of typed arrays, extend to make typed array tuples.
*/
export class ATypedArrayTuple {
/**
* 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, _start, _end) {
throw new Error();
}
/**
* Determines whether all the members of an array satisfy the specified test.
* @param _callbackfn - A function that accepts up to three arguments. The every method calls
* the _callbackfn function for each element in array1 until the _callbackfn returns false,
* or until the end of 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.
*/
every(_callbackfn, _thisArg) {
throw new Error();
}
/**
* Returns the this object after filling the section identified by start and end with value
* @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, _start, _end) {
throw new Error();
}
/**
* Returns the elements of an array that meet the condition specified in a callback function.
* @param _callbackfn - A function that accepts up to three arguments. The filter 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.
*/
filter(_callbackfn, _thisArg) {
throw new Error();
}
/**
* 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, _thisArg) {
throw new Error();
}
/**
* 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, _thisArg) {
throw new Error();
}
/**
* 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, _thisArg) {
throw new Error();
}
/**
* 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, _fromIndex) {
throw new Error();
}
/**
* 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) {
throw new Error();
}
/**
* 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, _fromIndex) {
throw new Error();
}
/**
* 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, _thisArg) {
throw new Error();
}
reduce(__callbackfn, _initialValue) {
throw new Error();
}
reduceRight(__callbackfn, _initialValue) {
throw new Error();
}
/**
* Reverses the elements in an Array.
*/
reverse() {
throw Error();
}
set(_array, _offset) {
throw new Error();
}
slice(_start, _end) {
throw new Error();
}
/**
* Determines whether the specified callback function returns true for any element of an array.
* @param _callbackfn - A function that accepts up to three arguments. The some method calls the
* _callbackfn function for each element in array1 until the _callbackfn returns true, or until
* the end of 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.
*/
some(_callbackfn, _thisArg) {
throw new Error();
}
/**
* Sorts an array.
* @param _compareFn - The name of the function used to determine the order of the elements. If
* omitted, the elements are sorted in ascending, ASCII character order.
*/
sort(_compareFn) {
throw new Error();
}
/**
* Gets a new this 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, _end) {
throw new Error();
}
/**
* Converts a number to a string by using the current locale.
*/
toLocaleString() {
throw new Error();
}
/**
* Returns a string representation of an array.
*/
toString() {
throw new Error();
}
}
//# sourceMappingURL=a-typed-array-tuple.js.map