rc-js-util
Advanced tools
Comparing version 5.0.0-alpha.1 to 5.0.0-alpha.3
@@ -1,5 +0,4 @@ | ||
import { ATypedArrayTuple } from "./a-typed-array-tuple"; | ||
import { ITypedArrayTupleFactory } from "./i-typed-array-tuple-factory"; | ||
import { IEmscriptenWrapper } from "../../web-assembly/emscripten/i-emscripten-wrapper"; | ||
export declare abstract class AF32TupleFactory<T extends ATypedArrayTuple<any>, TCtorArgs extends number[]> implements ITypedArrayTupleFactory<T, TCtorArgs> { | ||
export declare abstract class AF32TupleFactory<T extends object, TCtorArgs extends number[]> implements ITypedArrayTupleFactory<T, TCtorArgs> { | ||
private readonly length; | ||
@@ -6,0 +5,0 @@ protected constructor(length: number); |
@@ -0,1 +1,2 @@ | ||
import { TTupleLikeOfLength } from "../../typescript/t-tuple-like-of-length"; | ||
/** | ||
@@ -5,3 +6,3 @@ * @public | ||
*/ | ||
export declare abstract class ATypedArrayTuple<T extends ATypedArrayTuple<T>> { | ||
export declare abstract class ATypedArrayTuple<TLength extends number> { | ||
/** | ||
@@ -26,3 +27,3 @@ * The size in bytes of each element in the array. | ||
*/ | ||
abstract readonly length: number; | ||
abstract readonly length: TLength; | ||
/** | ||
@@ -46,3 +47,3 @@ * Returns the this object after copying a section of the array identified by start and end | ||
*/ | ||
abstract every(callbackfn: (value: number, index: number, array: T) => boolean, thisArg?: unknown): boolean; | ||
abstract every(callbackfn: (value: number, index: Extract<keyof this, number>, array: this) => boolean, thisArg?: unknown): boolean; | ||
/** | ||
@@ -64,3 +65,3 @@ * Returns the this object after filling the section identified by start and end with value | ||
*/ | ||
abstract filter(callbackfn: (value: number, index: number, array: T) => unknown, thisArg?: unknown): T; | ||
abstract filter(callbackfn: (value: number, index: Extract<keyof this, number>, array: this) => unknown, thisArg?: unknown): ATypedArrayTuple<number>; | ||
/** | ||
@@ -75,3 +76,3 @@ * Returns the value of the first element in the array where predicate is true, and undefined | ||
*/ | ||
abstract find(predicate: (value: number, index: number, obj: T) => boolean, thisArg?: unknown): number | undefined; | ||
abstract find(predicate: (value: number, index: Extract<keyof this, number>, obj: this) => boolean, thisArg?: unknown): number | undefined; | ||
/** | ||
@@ -86,3 +87,3 @@ * Returns the index of the first element in the array where predicate is true, and -1 | ||
*/ | ||
abstract findIndex(predicate: (value: number, index: number, obj: T) => boolean, thisArg?: unknown): number; | ||
abstract findIndex(predicate: (value: number, index: Extract<keyof this, number>, obj: this) => boolean, thisArg?: unknown): number; | ||
/** | ||
@@ -95,3 +96,3 @@ * Performs the specified action for each element in an array. | ||
*/ | ||
abstract forEach(callbackfn: (value: number, index: number, array: T) => void, thisArg?: unknown): void; | ||
abstract forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: unknown): void; | ||
/** | ||
@@ -125,3 +126,3 @@ * Returns the index of the first occurrence of a value in an array. | ||
*/ | ||
abstract map(callbackfn: (value: number, index: number, array: T) => number, thisArg?: unknown): T; | ||
abstract map(callbackfn: (value: number, index: Extract<keyof this, number>, array: this) => number, thisArg?: unknown): this; | ||
/** | ||
@@ -137,4 +138,4 @@ * Calls the specified callback function for all the elements in an array. The return value of | ||
*/ | ||
abstract reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: T) => number): number; | ||
abstract reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: T) => number, initialValue: number): number; | ||
abstract reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: Extract<keyof this, number>, array: this) => number): number; | ||
abstract reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: Extract<keyof this, number>, array: this) => number, initialValue: number): number; | ||
/** | ||
@@ -150,3 +151,3 @@ * Calls the specified callback function for all the elements in an array. The return value of | ||
*/ | ||
abstract reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: T) => U, initialValue: U): U; | ||
abstract reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: Extract<keyof this, number>, array: this) => U, initialValue: U): U; | ||
/** | ||
@@ -162,4 +163,4 @@ * Calls the specified callback function for all the elements in an array, in descending order. | ||
*/ | ||
abstract reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: T) => number): number; | ||
abstract reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: T) => number, initialValue: number): number; | ||
abstract reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: Extract<keyof this, number>, array: this) => number): number; | ||
abstract reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: Extract<keyof this, number>, array: this) => number, initialValue: number): number; | ||
/** | ||
@@ -175,7 +176,7 @@ * Calls the specified callback function for all the elements in an array, in descending order. | ||
*/ | ||
abstract reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: T) => U, initialValue: U): U; | ||
abstract reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: Extract<keyof this, number>, array: this) => U, initialValue: U): U; | ||
/** | ||
* Reverses the elements in an Array. | ||
*/ | ||
abstract reverse(): T; | ||
abstract reverse(): this; | ||
/** | ||
@@ -186,3 +187,3 @@ * Sets a value or an array of values. | ||
*/ | ||
abstract set(array: ArrayLike<number>, offset?: number): void; | ||
abstract set(array: TTupleLikeOfLength<number, TLength>, offset?: number): void; | ||
/** | ||
@@ -193,3 +194,3 @@ * Returns a section of an array. | ||
*/ | ||
abstract slice(start?: number, end?: number): T; | ||
abstract slice(start?: number, end?: number): this; | ||
/** | ||
@@ -203,3 +204,3 @@ * Determines whether the specified callback function returns true for any element of an array. | ||
*/ | ||
abstract some(callbackfn: (value: number, index: number, array: T) => boolean, thisArg?: unknown): boolean; | ||
abstract some(callbackfn: (value: number, index: Extract<keyof this, number>, array: this) => boolean, thisArg?: unknown): boolean; | ||
/** | ||
@@ -212,3 +213,3 @@ * Sorts an array. | ||
/** | ||
* Gets a new T view of the ArrayBuffer store for this array, referencing the elements | ||
* Gets a new this view of the ArrayBuffer store for this array, referencing the elements | ||
* at begin, inclusive, up to end, exclusive. | ||
@@ -218,3 +219,3 @@ * @param begin - The index of the beginning of the array. | ||
*/ | ||
abstract subarray(begin: number, end?: number): T; | ||
abstract subarray(begin: number, end?: number): this; | ||
/** | ||
@@ -221,0 +222,0 @@ * Converts a number to a string by using the current locale. |
@@ -10,3 +10,3 @@ import { ATypedArrayTuple } from "../a-typed-array-tuple"; | ||
*/ | ||
export declare abstract class AMat2<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<AMat2<TArray>> { | ||
export declare abstract class AMat2<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<4> { | ||
/** | ||
@@ -13,0 +13,0 @@ * c1r1 |
@@ -17,4 +17,4 @@ import { ITypedArrayTupleFactory } from "../i-typed-array-tuple-factory"; | ||
createIdentityMatrix(): AMat2<TArray>; | ||
getElement(column: number, row: number): Extract<keyof Mat2<never>, number>; | ||
getIndex(column: number, row: number): Extract<keyof Mat2<never>, number>; | ||
getLoggableValue(value: AMat2<TArray>): number[][]; | ||
} |
@@ -20,3 +20,3 @@ "use strict"; | ||
} | ||
getElement(column, row) { | ||
getIndex(column, row) { | ||
DEBUG_MODE && _debug_1._Debug.assert(column >= 0 && column < 2 && row >= 0 && row < 2, "out of bounds"); | ||
@@ -23,0 +23,0 @@ return row * 2 + column; |
@@ -10,3 +10,3 @@ import { ATypedArrayTuple } from "../a-typed-array-tuple"; | ||
*/ | ||
export declare abstract class AMat3<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<AMat3<TArray>> { | ||
export declare abstract class AMat3<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<9> { | ||
/** | ||
@@ -13,0 +13,0 @@ * c1r1 |
@@ -27,3 +27,3 @@ import { ITypedArrayTupleFactory } from "../i-typed-array-tuple-factory"; | ||
createIdentityMatrix(): AMat3<TArray>; | ||
getElement(column: number, row: number): Extract<keyof AMat3<never>, number>; | ||
getIndex(column: number, row: number): Extract<keyof AMat3<never>, number>; | ||
/** | ||
@@ -30,0 +30,0 @@ * counter clockwise |
@@ -21,3 +21,3 @@ "use strict"; | ||
} | ||
getElement(column, row) { | ||
getIndex(column, row) { | ||
DEBUG_MODE && _debug_1._Debug.assert(column >= 0 && column < 3 && row >= 0 && row < 3, "out of bounds"); | ||
@@ -24,0 +24,0 @@ return row * 3 + column; |
@@ -10,3 +10,3 @@ import { ATypedArrayTuple } from "../a-typed-array-tuple"; | ||
*/ | ||
export declare abstract class AMat4<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<AMat4<TArray>> { | ||
export declare abstract class AMat4<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<16> { | ||
/** | ||
@@ -13,0 +13,0 @@ * c1r1 |
@@ -34,4 +34,4 @@ import { ITypedArrayTupleFactory } from "../i-typed-array-tuple-factory"; | ||
createIdentityMatrix(): AMat4<TArray>; | ||
getElement(column: number, row: number): Extract<keyof AMat4<never>, number>; | ||
getIndex(column: number, row: number): Extract<keyof AMat4<never>, number>; | ||
getLoggableValue(value: AMat4<TArray>): number[][]; | ||
} |
@@ -22,3 +22,3 @@ "use strict"; | ||
} | ||
getElement(column, row) { | ||
getIndex(column, row) { | ||
DEBUG_MODE && _debug_1._Debug.assert(column >= 0 && column < 4 && row >= 0 && row < 4, "out of bounds"); | ||
@@ -25,0 +25,0 @@ return row * 4 + column; |
@@ -10,3 +10,3 @@ import { ATypedArrayTuple } from "../a-typed-array-tuple"; | ||
*/ | ||
export declare abstract class AVec2<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<AVec2<TArray>> { | ||
export declare abstract class AVec2<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<2> { | ||
/** | ||
@@ -13,0 +13,0 @@ * x |
@@ -10,3 +10,3 @@ import { ATypedArrayTuple } from "../a-typed-array-tuple"; | ||
*/ | ||
export declare abstract class AVec3<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<AVec3<TArray>> { | ||
export declare abstract class AVec3<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<3> { | ||
/** | ||
@@ -13,0 +13,0 @@ * x |
@@ -10,3 +10,3 @@ import { ATypedArrayTuple } from "../a-typed-array-tuple"; | ||
*/ | ||
export declare abstract class AVec4<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<AVec4<TArray>> { | ||
export declare abstract class AVec4<TArray extends EArrayTypeGuard> extends ATypedArrayTuple<4> { | ||
/** | ||
@@ -13,0 +13,0 @@ * x |
@@ -49,5 +49,8 @@ export { IDebugWeakStore, IDebugSharedObject, IDebugSharedObjectLifeCycleChecks, TDebugListener, IDebugProtectedView, IDebugWeakBroadcastEvent } from "rc-js-util-globals/index"; | ||
export { TKeysOf } from "./typescript/t-keys-of"; | ||
export { TNextInt } from "./typescript/t-next-int"; | ||
export { TNullable } from "./typescript/t-nullable"; | ||
export { TPickExcept } from "./typescript/t-pick-except"; | ||
export { TPredicate } from "./typescript/t-predicate"; | ||
export { TTupleLike } from "./typescript/t-tuple-like"; | ||
export { TTupleLikeOfLength } from "./typescript/t-tuple-like-of-length"; | ||
export { TTypedArrayCast } from "./typescript/t-typed-array-cast"; | ||
@@ -54,0 +57,0 @@ export { TUnionToIntersection } from "./typescript/t-union-to-intersection"; |
@@ -16,2 +16,2 @@ import { ATypedArrayTuple } from "../array/typed-array/a-typed-array-tuple"; | ||
*/ | ||
export declare type TTypedArrayCast<U extends ATypedArrayTuple<any>> = TPickExcept<U, "TTypeGuardTypedArray" | keyof ATypedArrayTuple<any>>; | ||
export declare type TTypedArrayCast<U extends ATypedArrayTuple<number>> = TPickExcept<U, "TTypeGuardTypedArray" | keyof ATypedArrayTuple<number>>; |
{ | ||
"name": "rc-js-util", | ||
"version": "5.0.0-alpha.1", | ||
"version": "5.0.0-alpha.3", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
446319
466
6113