diff --git a/types/three/examples/jsm/deprecated/Geometry.d.ts b/types/three/examples/jsm/deprecated/Geometry.d.ts deleted file mode 100644 index 9f884006f..000000000 --- a/types/three/examples/jsm/deprecated/Geometry.d.ts +++ /dev/null @@ -1,341 +0,0 @@ -import { - AnimationClip, - Bone, - Box3, - BufferGeometry, - Color, - EventDispatcher, - Matrix, - Matrix4, - Mesh, - Object3D, - Sphere, - Vector2, - Vector3, - Vector4, -} from "three"; - -/** - * @deprecated Use Face3 instead. - */ - -export interface MorphTarget { - name: string; - vertices: Vector3[]; -} - -export interface MorphColor { - name: string; - colors: Color[]; -} - -export interface MorphNormals { - name: string; - normals: Vector3[]; -} - -/** - * Base class for geometries - */ -export class Geometry extends EventDispatcher { - constructor(); - - /** - * Unique number of this geometry instance - */ - id: number; - - uuid: string; - - readonly isGeometry: true; - - /** - * Name for this geometry. Default is an empty string. - * @default '' - */ - name: string; - - /** - * @default 'Geometry' - */ - type: string; - - /** - * The array of vertices hold every position of points of the model. - * To signal an update in this array, Geometry.verticesNeedUpdate needs to be set to true. - * @default [] - */ - vertices: Vector3[]; - - /** - * Array of vertex colors, matching number and order of vertices. - * Used in ParticleSystem, Line and Ribbon. - * Meshes use per-face-use-of-vertex colors embedded directly in faces. - * To signal an update in this array, Geometry.colorsNeedUpdate needs to be set to true. - * @default [] - */ - colors: Color[]; - - /** - * Array of triangles or/and quads. - * The array of faces describe how each vertex in the model is connected with each other. - * To signal an update in this array, Geometry.elementsNeedUpdate needs to be set to true. - * @default [] - */ - faces: Face3[]; - - /** - * Array of face UV layers. - * Each UV layer is an array of UV matching order and number of vertices in faces. - * To signal an update in this array, Geometry.uvsNeedUpdate needs to be set to true. - * @default [[]] - */ - faceVertexUvs: Vector2[][][]; - - /** - * Array of morph targets. Each morph target is a Javascript object: - * - * { name: "targetName", vertices: [ new THREE.Vector3(), ... ] } - * - * Morph vertices match number and order of primary vertices. - * @default [] - */ - morphTargets: MorphTarget[]; - - /** - * Array of morph normals. Morph normals have similar structure as morph targets, each normal set is a Javascript object: - * - * morphNormal = { name: "NormalName", normals: [ new THREE.Vector3(), ... ] } - * @default [] - */ - morphNormals: MorphNormals[]; - - /** - * Array of skinning weights, matching number and order of vertices. - * @default [] - */ - skinWeights: Vector4[]; - - /** - * Array of skinning indices, matching number and order of vertices. - * @default [] - */ - skinIndices: Vector4[]; - - /** - * @default [] - */ - lineDistances: number[]; - - /** - * Bounding box. - * @default null - */ - boundingBox: Box3 | null; - - /** - * Bounding sphere. - * @default null - */ - boundingSphere: Sphere | null; - - /** - * Set to true if the vertices array has been updated. - * @default false - */ - verticesNeedUpdate: boolean; - - /** - * Set to true if the faces array has been updated. - * @default false - */ - elementsNeedUpdate: boolean; - - /** - * Set to true if the uvs array has been updated. - * @default false - */ - uvsNeedUpdate: boolean; - - /** - * Set to true if the normals array has been updated. - * @default false - */ - normalsNeedUpdate: boolean; - - /** - * Set to true if the colors array has been updated. - * @default false - */ - colorsNeedUpdate: boolean; - - /** - * Set to true if the linedistances array has been updated. - * @default false - */ - lineDistancesNeedUpdate: boolean; - - /** - * @default false - */ - groupsNeedUpdate: boolean; - - /** - * Bakes matrix transform directly into vertex coordinates. - */ - applyMatrix4(matrix: Matrix4): Geometry; - - rotateX(angle: number): Geometry; - rotateY(angle: number): Geometry; - rotateZ(angle: number): Geometry; - - translate(x: number, y: number, z: number): Geometry; - scale(x: number, y: number, z: number): Geometry; - lookAt(vector: Vector3): void; - - fromBufferGeometry(geometry: BufferGeometry): Geometry; - - center(): Geometry; - - normalize(): Geometry; - - /** - * Computes face normals. - */ - computeFaceNormals(): void; - - /** - * Computes vertex normals by averaging face normals. - * Face normals must be existing / computed beforehand. - */ - computeVertexNormals(areaWeighted?: boolean): void; - - /** - * Compute vertex normals, but duplicating face normals. - */ - computeFlatVertexNormals(): void; - - /** - * Computes morph normals. - */ - computeMorphNormals(): void; - - /** - * Computes bounding box of the geometry, updating {@link Geometry.boundingBox} attribute. - */ - computeBoundingBox(): void; - - /** - * Computes bounding sphere of the geometry, updating Geometry.boundingSphere attribute. - * Neither bounding boxes or bounding spheres are computed by default. They need to be explicitly computed, otherwise they are null. - */ - computeBoundingSphere(): void; - - merge(geometry: Geometry, matrix?: Matrix, materialIndexOffset?: number): void; - - mergeMesh(mesh: Mesh): void; - - /** - * Checks for duplicate vertices using hashmap for specified number of decimal points, e.g. 4 for epsilon of 0.0001 - * Duplicated vertices are removed and faces' vertices are updated. - */ - mergeVertices(precisionPoints?: number): number; - - setFromPoints(points: Vector2[] | Vector3[]): this; - - sortFacesByMaterialIndex(): void; - - toBufferGeometry(): BufferGeometry; - - static createBufferGeometryFromObject(object: Object3D): BufferGeometry; - - toJSON(): any; - - /** - * Creates a new clone of the Geometry. - */ - clone(): Geometry; - - copy(source: Geometry): this; - - /** - * Removes The object from memory. - * Don't forget to call this method when you remove an geometry because it can cuase meomory leaks. - */ - dispose(): void; - - // These properties do not exist in a normal Geometry class, but if you use the instance that was passed by JSONLoader, it will be added. - bones: Bone[]; - animation: AnimationClip; - animations: AnimationClip[]; -} - -/** - * Triangle face. - */ -export class Face3 { - /** - * @param a Vertex A index. - * @param b Vertex B index. - * @param c Vertex C index. - * @param normal Face normal or array of vertex normals. - * @param color Face color or array of vertex colors. - * @param materialIndex Material index. - */ - constructor( - a: number, - b: number, - c: number, - normal?: Vector3 | Vector3[], - color?: Color | Color[], - materialIndex?: number, - ); - - /** - * Vertex A index. - */ - a: number; - - /** - * Vertex B index. - */ - b: number; - - /** - * Vertex C index. - */ - c: number; - - /** - * Face normal. - * @default new THREE.Vector3() - */ - normal: Vector3; - - /** - * Array of 3 vertex normals. - * @default [] - */ - vertexNormals: Vector3[]; - - /** - * Face color. - * @default new THREE.Color() - */ - color: Color; - - /** - * Array of 3 vertex colors. - * @default [] - */ - vertexColors: Color[]; - - /** - * Material index (points to {@link Mesh.material}). - * @default 0 - */ - materialIndex: number; - - clone(): this; - copy(source: Face3): this; -} diff --git a/types/three/src/Three.WebGPU.d.ts b/types/three/src/Three.WebGPU.d.ts index b0292c357..35e68cc4f 100644 --- a/types/three/src/Three.WebGPU.d.ts +++ b/types/three/src/Three.WebGPU.d.ts @@ -104,6 +104,7 @@ export * from "./math/interpolants/LinearInterpolant.js"; export * from "./math/interpolants/QuaternionLinearInterpolant.js"; export * from "./math/Line3.js"; export { MathUtils } from "./math/MathUtils.js"; +export * from "./math/Matrix2.js"; export * from "./math/Matrix3.js"; export * from "./math/Matrix4.js"; export * from "./math/Plane.js"; diff --git a/types/three/src/Three.d.ts b/types/three/src/Three.d.ts index 7b8d48a67..d3778afe7 100644 --- a/types/three/src/Three.d.ts +++ b/types/three/src/Three.d.ts @@ -104,6 +104,7 @@ export * from "./math/interpolants/LinearInterpolant.js"; export * from "./math/interpolants/QuaternionLinearInterpolant.js"; export * from "./math/Line3.js"; export { MathUtils } from "./math/MathUtils.js"; +export * from "./math/Matrix2.js"; export * from "./math/Matrix3.js"; export * from "./math/Matrix4.js"; export * from "./math/Plane.js"; diff --git a/types/three/src/core/InterleavedBufferAttribute.d.ts b/types/three/src/core/InterleavedBufferAttribute.d.ts index 2de21d885..955049938 100644 --- a/types/three/src/core/InterleavedBufferAttribute.d.ts +++ b/types/three/src/core/InterleavedBufferAttribute.d.ts @@ -1,4 +1,4 @@ -import { Matrix } from "../math/Matrix3.js"; +import { Matrix3 } from "../math/Matrix3.js"; import { Matrix4 } from "../math/Matrix4.js"; import { BufferAttribute, TypedArray } from "./BufferAttribute.js"; import { InterleavedBuffer } from "./InterleavedBuffer.js"; @@ -84,13 +84,13 @@ export class InterleavedBufferAttribute { * Applies normal matrix {@link Matrix3 | m} to every Vector3 element of this InterleavedBufferAttribute. * @param m */ - applyNormalMatrix(m: Matrix): this; + applyNormalMatrix(m: Matrix3): this; /** * Applies matrix {@link Matrix4 | m} to every Vector3 element of this InterleavedBufferAttribute, interpreting the elements as a direction vectors. * @param m */ - transformDirection(m: Matrix): this; + transformDirection(m: Matrix4): this; /** * Returns the given component of the vector at the given index. diff --git a/types/three/src/math/Matrix2.d.ts b/types/three/src/math/Matrix2.d.ts new file mode 100644 index 000000000..263dd55a7 --- /dev/null +++ b/types/three/src/math/Matrix2.d.ts @@ -0,0 +1,58 @@ +export type Matrix2Tuple = [ + n11: number, + n12: number, + n13: number, + n21: number, + n22: number, + n23: number, + n31: number, + n32: number, + n33: number, +]; + +/** + * A class representing a 2x2 {@link https://en.wikipedia.org/wiki/Matrix_(mathematics) matrix}. + * + * @example + * const m = new Matrix2(); + */ +export class Matrix2 { + readonly isMatrix2: true; + + /** + * A {@link https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major} list of matrix values. + */ + elements: Matrix2Tuple; + + /** + * Creates a 2x2 {@link https://en.wikipedia.org/wiki/Identity_matrix identity matrix}. + */ + constructor(); + + /** + * Creates a 2x2 matrix with the given arguments in row-major order. + */ + constructor(n11: number, n12: number, n21: number, n22: number); + + /** + * Resets this matrix to the 2x2 identity matrix: + */ + identity(): this; + + /** + * Sets the elements of this matrix based on an array in + * {@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major} format. + * + * @param array the array to read the elements from + * @param offset (optional) index of first element in the array. Default is `0`. + */ + fromArray(array: ArrayLike, offset?: number): this; + + /** + * Sets the 2x2 matrix values to the given + * {@link https://en.wikipedia.org/wiki/Row-_and_column-major_order row-major} sequence of values: + * [n11, n12, + * n21, n22] + */ + set(n11: number, n12: number, n21: number, n22: number): this; +} diff --git a/types/three/src/math/Matrix3.d.ts b/types/three/src/math/Matrix3.d.ts index d2dbb91f3..4fcb48edc 100644 --- a/types/three/src/math/Matrix3.d.ts +++ b/types/three/src/math/Matrix3.d.ts @@ -16,53 +16,14 @@ export type Matrix3Tuple = [ n33: number, ]; -/** - * ( interface Matrix ) - */ -export interface Matrix { - /** - * Array with matrix values. - */ - elements: number[]; - - /** - * identity():T; - */ - identity(): Matrix; - - /** - * copy(m:T):T; - */ - copy(m: this): this; - - /** - * multiplyScalar(s:number):T; - */ - multiplyScalar(s: number): Matrix; - - determinant(): number; - - /** - * transpose():T; - */ - transpose(): Matrix; - - /** - * invert():T; - */ - invert(): Matrix; +export class Matrix3 { + readonly isMatrix3: true; /** - * clone():T; + * Array with matrix values. + * @default [1, 0, 0, 0, 1, 0, 0, 0, 1] */ - clone(): Matrix; -} - -/** - * ( class Matrix3 implements Matrix ) - */ -export class Matrix3 implements Matrix { - readonly isMatrix3: true; + elements: Matrix3Tuple; /** * Creates an identity matrix. @@ -83,12 +44,6 @@ export class Matrix3 implements Matrix { n33: number, ); - /** - * Array with matrix values. - * @default [1, 0, 0, 0, 1, 0, 0, 0, 1] - */ - elements: number[]; - set( n11: number, n12: number, @@ -100,34 +55,68 @@ export class Matrix3 implements Matrix { n32: number, n33: number, ): Matrix3; - identity(): Matrix3; - clone(): this; + + identity(): this; + copy(m: Matrix3): this; - extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix3; + + extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): this; + setFromMatrix4(m: Matrix4): Matrix3; - multiplyScalar(s: number): Matrix3; + + /** + * Multiplies this matrix by m. + */ + multiply(m: Matrix3): this; + + premultiply(m: Matrix3): this; + + /** + * Sets this matrix to a x b. + */ + multiplyMatrices(a: Matrix3, b: Matrix3): this; + + multiplyScalar(s: number): this; + determinant(): number; /** * Inverts this matrix in place. */ - invert(): Matrix3; + invert(): this; /** * Transposes this matrix in place. */ - transpose(): Matrix3; - getNormalMatrix(matrix4: Matrix4): Matrix3; + transpose(): this; + + getNormalMatrix(matrix4: Matrix4): this; /** * Transposes this matrix into the supplied array r, and returns itself. */ - transposeIntoArray(r: number[]): Matrix3; + transposeIntoArray(r: number[]): this; + + setUvTransform(tx: number, ty: number, sx: number, sy: number, rotation: number, cx: number, cy: number): this; + + scale(sx: number, sy: number): this; - setUvTransform(tx: number, ty: number, sx: number, sy: number, rotation: number, cx: number, cy: number): Matrix3; + rotate(theta: number): this; - scale(sx: number, sy: number): Matrix3; + translate(tx: number, ty: number): this; + /** + * Sets this matrix as a 2D translation transform: + * + * ``` + * 1, 0, x, + * 0, 1, y, + * 0, 0, 1 + * ``` + * + * @param v the amount to translate. + */ + makeTranslation(v: Vector2): this; /** * Sets this matrix as a 2D translation transform: * @@ -140,7 +129,6 @@ export class Matrix3 implements Matrix { * @param x the amount to translate in the X axis. * @param y the amount to translate in the Y axis. */ - makeTranslation(v: Vector2): this; makeTranslation(x: number, y: number): this; /** @@ -155,7 +143,6 @@ export class Matrix3 implements Matrix { * @param theta Rotation angle in radians. Positive values rotate counterclockwise. */ makeRotation(theta: number): this; - makeRotation(theta: number): Matrix3; /** * Sets this matrix as a 2D scale transform: @@ -170,11 +157,6 @@ export class Matrix3 implements Matrix { * @param y the amount to scale in the Y axis. */ makeScale(x: number, y: number): this; - makeScale(x: number, y: number): Matrix3; - - rotate(theta: number): Matrix3; - - translate(tx: number, ty: number): Matrix3; equals(matrix: Matrix3): boolean; @@ -183,55 +165,15 @@ export class Matrix3 implements Matrix { * @param array the source array or array-like. * @param offset (optional) offset into the array-like. Default is 0. */ - fromArray(array: number[] | ArrayLike, offset?: number): Matrix3; - - /** - * Returns an array with the values of this matrix, or copies them into the provided array. - * @param array (optional) array to store the matrix to. If this is not provided, a new array will be created. - * @param offset (optional) optional offset into the array. - * @return The created or provided array. - */ - toArray(array?: number[], offset?: number): number[]; - toArray(array?: Matrix3Tuple, offset?: 0): Matrix3Tuple; - - /** - * Copies he values of this matrix into the provided array-like. - * @param array array-like to store the matrix to. - * @param offset (optional) optional offset into the array-like. - * @return The provided array-like. - */ - toArray(array?: ArrayLike, offset?: number): ArrayLike; - - /** - * Multiplies this matrix by m. - */ - multiply(m: Matrix3): Matrix3; - - premultiply(m: Matrix3): Matrix3; - - /** - * Sets this matrix to a x b. - */ - multiplyMatrices(a: Matrix3, b: Matrix3): Matrix3; - - /** - * @deprecated Use {@link Vector3.applyMatrix3 vector.applyMatrix3( matrix )} instead. - */ - multiplyVector3(vector: Vector3): any; + fromArray(array: ArrayLike, offset?: number): this; /** - * @deprecated This method has been removed completely. + * Writes the elements of this matrix to an array in + * {@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major} format. + * @param array (optional) array to store the resulting vector in. If not given a new array will be created. + * @param offset (optional) offset in the array at which to put the result. */ - multiplyVector3Array(a: any): any; + toArray = number[]>(array?: TArray, offset?: number): TArray; - /** - * @deprecated Use {@link Matrix3#invert .invert()} instead. - */ - getInverse(matrix: Matrix4, throwOnDegenerate?: boolean): Matrix3; - getInverse(matrix: Matrix): Matrix; - - /** - * @deprecated Use {@link Matrix3#toArray .toArray()} instead. - */ - flattenToArrayOffset(array: number[], offset: number): number[]; + clone(): this; } diff --git a/types/three/src/math/Matrix4.d.ts b/types/three/src/math/Matrix4.d.ts index 584eb91ae..e047a87cd 100644 --- a/types/three/src/math/Matrix4.d.ts +++ b/types/three/src/math/Matrix4.d.ts @@ -1,6 +1,6 @@ import { CoordinateSystem } from "../constants.js"; import { Euler } from "./Euler.js"; -import { Matrix, Matrix3 } from "./Matrix3.js"; +import { Matrix3 } from "./Matrix3.js"; import { Quaternion } from "./Quaternion.js"; import { Vector3 } from "./Vector3.js"; @@ -41,9 +41,15 @@ export type Matrix4Tuple = [ * m.multiplyMatrices( m1, m2 ); * m.multiply( m3 ); */ -export class Matrix4 implements Matrix { +export class Matrix4 { readonly isMatrix4: true; + /** + * Array with matrix values. + * @default [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] + */ + elements: Matrix4Tuple; + /** * Creates an identity matrix. */ @@ -70,12 +76,6 @@ export class Matrix4 implements Matrix { n44: number, ); - /** - * Array with matrix values. - * @default [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] - */ - elements: number[]; - /** * Sets all fields of this matrix. */ @@ -102,18 +102,31 @@ export class Matrix4 implements Matrix { * Resets this matrix to identity. */ identity(): this; + clone(): Matrix4; + copy(m: Matrix4): this; + copyPosition(m: Matrix4): this; + + /** + * Set the upper 3x3 elements of this matrix to the values of the Matrix3 m. + */ + setFromMatrix3(m: Matrix3): this; + extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): this; + makeBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): this; /** * Copies the rotation component of the supplied matrix m into this matrix rotation component. */ extractRotation(m: Matrix4): this; + makeRotationFromEuler(euler: Euler): this; + makeRotationFromQuaternion(q: Quaternion): this; + /** * Constructs a rotation matrix, looking from eye towards center with defined up vector. */ @@ -131,14 +144,6 @@ export class Matrix4 implements Matrix { */ multiplyMatrices(a: Matrix4, b: Matrix4): this; - /** - * Sets this matrix to a x b and stores the result into the flat array r. - * r can be either a regular Array or a TypedArray. - * - * @deprecated This method has been removed completely. - */ - multiplyToArray(a: Matrix4, b: Matrix4, r: number[]): Matrix4; - /** * Multiplies this matrix by s. */ @@ -172,6 +177,7 @@ export class Matrix4 implements Matrix { scale(v: Vector3): this; getMaxScaleOnAxis(): number; + /** * Sets this matrix as translation transform. */ @@ -204,7 +210,7 @@ export class Matrix4 implements Matrix { * Based on http://www.gamedev.net/reference/articles/article1199.asp. * * @param axis Rotation axis. - * @param theta Rotation angle in radians. + * @param angle Rotation angle in radians. */ makeRotationAxis(axis: Vector3, angle: number): this; @@ -221,12 +227,12 @@ export class Matrix4 implements Matrix { /** * Sets this matrix to the transformation composed of translation, rotation and scale. */ - compose(translation: Vector3, rotation: Quaternion, scale: Vector3): this; + compose(position: Vector3, quaternion: Quaternion, scale: Vector3): this; /** * Decomposes this matrix into it's position, quaternion and scale components. */ - decompose(translation: Vector3, rotation: Quaternion, scale: Vector3): this; + decompose(position: Vector3, quaternion: Quaternion, scale: Vector3): this; /** * Creates a perspective projection matrix. @@ -253,6 +259,7 @@ export class Matrix4 implements Matrix { far: number, coordinateSystem?: CoordinateSystem, ): this; + equals(matrix: Matrix4): boolean; /** @@ -260,72 +267,13 @@ export class Matrix4 implements Matrix { * @param array the source array or array-like. * @param offset (optional) offset into the array-like. Default is 0. */ - fromArray(array: number[] | ArrayLike, offset?: number): this; - - /** - * Returns an array with the values of this matrix, or copies them into the provided array. - * @param array (optional) array to store the matrix to. If this is not provided, a new array will be created. - * @param offset (optional) optional offset into the array. - * @return The created or provided array. - */ - toArray(array?: number[], offset?: number): number[]; - toArray(array?: Matrix4Tuple, offset?: 0): Matrix4Tuple; - - /** - * Copies he values of this matrix into the provided array-like. - * @param array array-like to store the matrix to. - * @param offset (optional) optional offset into the array-like. - * @return The provided array-like. - */ - toArray(array?: ArrayLike, offset?: number): ArrayLike; - - /** - * Set the upper 3x3 elements of this matrix to the values of the Matrix3 m. - */ - setFromMatrix3(m: Matrix3): this; - - /** - * @deprecated Use {@link Matrix4#copyPosition .copyPosition()} instead. - */ - extractPosition(m: Matrix4): Matrix4; - - /** - * @deprecated Use {@link Matrix4#makeRotationFromQuaternion .makeRotationFromQuaternion()} instead. - */ - setRotationFromQuaternion(q: Quaternion): Matrix4; - - /** - * @deprecated Use {@link Vector3#applyMatrix4 vector.applyMatrix4( matrix )} instead. - */ - multiplyVector3(v: any): any; - - /** - * @deprecated Use {@link Vector4#applyMatrix4 vector.applyMatrix4( matrix )} instead. - */ - multiplyVector4(v: any): any; - - /** - * @deprecated This method has been removed completely. - */ - multiplyVector3Array(array: number[]): number[]; - - /** - * @deprecated Use {@link Vector3#transformDirection Vector3.transformDirection( matrix )} instead. - */ - rotateAxis(v: any): void; - - /** - * @deprecated Use {@link Vector3#applyMatrix4 vector.applyMatrix4( matrix )} instead. - */ - crossVector(v: any): void; - - /** - * @deprecated Use {@link Matrix4#toArray .toArray()} instead. - */ - flattenToArrayOffset(array: number[], offset: number): number[]; + fromArray(array: ArrayLike, offset?: number): this; /** - * @deprecated Use {@link Matrix4#invert .invert()} instead. + * Writes the elements of this matrix to an array in + * {@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major} format. + * @param array (optional) array to store the resulting vector in. + * @param offset (optional) offset in the array at which to put the result. */ - getInverse(matrix: Matrix): Matrix; + toArray = number[]>(array?: TArray, offset?: number): TArray; }