@math.gl/core 4.1.0-alpha.1 → 4.1.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,7 @@ import { checkNumber } from "../lib/validators.js";
9
9
  // Internal constants
10
10
  const ERR_UNKNOWN_ORDER = 'Unknown Euler angle order';
11
11
  const ALMOST_ONE = 0.99999;
12
+ // eslint-disable-next-line no-shadow
12
13
  var RotationOrder;
13
14
  (function (RotationOrder) {
14
15
  RotationOrder[RotationOrder["ZYX"] = 0] = "ZYX";
@@ -65,8 +66,8 @@ export class Euler extends MathArray {
65
66
  super(-0, -0, -0, -0);
66
67
  // eslint-disable-next-line prefer-rest-params
67
68
  if (arguments.length > 0 && Array.isArray(arguments[0])) {
68
- // eslint-disable-next-line prefer-rest-params
69
69
  // @ts-expect-error
70
+ // eslint-disable-next-line prefer-rest-params
70
71
  this.fromVector3(...arguments);
71
72
  }
72
73
  else {
@@ -8,6 +8,7 @@ import { vec4_transformMat3 } from "../lib/gl-matrix-extras.js";
8
8
  import { fromQuat as mat3_fromQuat, determinant as mat3_determinant, transpose as mat3_transpose, invert as mat3_invert, multiply as mat3_multiply, rotate as mat3_rotate, scale as mat3_scale, translate as mat3_translate } from "../gl-matrix/mat3.js";
9
9
  import { transformMat3 as vec2_transformMat3 } from "../gl-matrix/vec2.js";
10
10
  import { transformMat3 as vec3_transformMat3 } from "../gl-matrix/vec3.js";
11
+ // eslint-disable-next-line no-shadow
11
12
  var INDICES;
12
13
  (function (INDICES) {
13
14
  INDICES[INDICES["COL0ROW0"] = 0] = "COL0ROW0";
@@ -11,6 +11,7 @@ import { fromQuat as mat4_fromQuat, frustum as mat4_frustum, lookAt as mat4_look
11
11
  import { transformMat4 as vec2_transformMat4 } from "../gl-matrix/vec2.js";
12
12
  import { transformMat4 as vec3_transformMat4 } from "../gl-matrix/vec3.js";
13
13
  import { transformMat4 as vec4_transformMat4 } from "../gl-matrix/vec4.js";
14
+ // eslint-disable-next-line no-shadow
14
15
  var INDICES;
15
16
  (function (INDICES) {
16
17
  INDICES[INDICES["COL0ROW0"] = 0] = "COL0ROW0";
@@ -3,8 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
  // Copyright (c) 2017 Uber Technologies, Inc.
5
5
  import { Vector3 } from "./vector3.js";
6
- import { formatValue, equals, config } from "../lib/common.js";
7
- import { degrees, radians, clamp } from "../lib/common.js";
6
+ import { formatValue, equals, config, degrees, radians, clamp } from "../lib/common.js";
8
7
  // @ts-ignore gl-matrix types...
9
8
  import * as vec3 from "../gl-matrix/vec3.js";
10
9
  // TODO - import epsilon
@@ -1,3 +1,4 @@
1
+ import type { NumericArray } from '@math.gl/types';
1
2
  /**
2
3
  * 2 Dimensional Vector
3
4
  * @module vec2
@@ -5,24 +6,24 @@
5
6
  /**
6
7
  * Creates a new, empty vec2
7
8
  *
8
- * @returns {NumericArray} a new 2D vector
9
+ * @returns a new 2D vector
9
10
  */
10
- export declare function create(): any[] | Float32Array;
11
+ export declare function create(): NumericArray;
11
12
  /**
12
13
  * Creates a new vec2 initialized with values from an existing vector
13
14
  *
14
- * @param {Readonly<NumericArray>} a vector to clone
15
- * @returns {NumericArray} a new 2D vector
15
+ * @param a vector to clone
16
+ * @returns a new 2D vector
16
17
  */
17
- export declare function clone(a: any): any[] | Float32Array;
18
+ export declare function clone(a: Readonly<NumericArray>): NumericArray;
18
19
  /**
19
20
  * Creates a new vec2 initialized with the given values
20
21
  *
21
- * @param {Number} x X component
22
- * @param {Number} y Y component
23
- * @returns {NumericArray} a new 2D vector
22
+ * @param x X component
23
+ * @param y Y component
24
+ * @returns a new 2D vector
24
25
  */
25
- export declare function fromValues(x: any, y: any): any[] | Float32Array;
26
+ export declare function fromValues(x: number, y: number): NumericArray;
26
27
  /**
27
28
  * Copy the values from one vec2 to another
28
29
  *
@@ -8,7 +8,7 @@ import * as glMatrix from './common.js';
8
8
  /**
9
9
  * Creates a new, empty vec2
10
10
  *
11
- * @returns {NumericArray} a new 2D vector
11
+ * @returns a new 2D vector
12
12
  */
13
13
  export function create() {
14
14
  const out = new glMatrix.ARRAY_TYPE(2);
@@ -21,8 +21,8 @@ export function create() {
21
21
  /**
22
22
  * Creates a new vec2 initialized with values from an existing vector
23
23
  *
24
- * @param {Readonly<NumericArray>} a vector to clone
25
- * @returns {NumericArray} a new 2D vector
24
+ * @param a vector to clone
25
+ * @returns a new 2D vector
26
26
  */
27
27
  export function clone(a) {
28
28
  const out = new glMatrix.ARRAY_TYPE(2);
@@ -33,9 +33,9 @@ export function clone(a) {
33
33
  /**
34
34
  * Creates a new vec2 initialized with the given values
35
35
  *
36
- * @param {Number} x X component
37
- * @param {Number} y Y component
38
- * @returns {NumericArray} a new 2D vector
36
+ * @param x X component
37
+ * @param y Y component
38
+ * @returns a new 2D vector
39
39
  */
40
40
  export function fromValues(x, y) {
41
41
  const out = new glMatrix.ARRAY_TYPE(2);