@math.gl/core
Advanced tools
Comparing version 4.1.0-alpha.1 to 4.1.0-alpha.2
@@ -12,2 +12,3 @@ // math.gl | ||
const ALMOST_ONE = 0.99999; | ||
// eslint-disable-next-line no-shadow | ||
var RotationOrder; | ||
@@ -69,4 +70,4 @@ (function (RotationOrder) { | ||
if (arguments.length > 0 && Array.isArray(arguments[0])) { | ||
// @ts-expect-error | ||
// eslint-disable-next-line prefer-rest-params | ||
// @ts-expect-error | ||
this.fromVector3(...arguments); | ||
@@ -73,0 +74,0 @@ } |
@@ -11,2 +11,3 @@ // math.gl | ||
import { transformMat3 as vec3_transformMat3 } from "../gl-matrix/vec3.js"; | ||
// eslint-disable-next-line no-shadow | ||
var INDICES; | ||
@@ -13,0 +14,0 @@ (function (INDICES) { |
@@ -14,2 +14,3 @@ // math.gl | ||
import { transformMat4 as vec4_transformMat4 } from "../gl-matrix/vec4.js"; | ||
// eslint-disable-next-line no-shadow | ||
var INDICES; | ||
@@ -16,0 +17,0 @@ (function (INDICES) { |
@@ -6,4 +6,3 @@ // math.gl | ||
import { Vector3 } from "./vector3.js"; | ||
import { formatValue, equals, config } from "../lib/common.js"; | ||
import { degrees, radians, clamp } from "../lib/common.js"; | ||
import { formatValue, equals, config, degrees, radians, clamp } from "../lib/common.js"; | ||
// @ts-ignore gl-matrix types... | ||
@@ -10,0 +9,0 @@ import * as vec3 from "../gl-matrix/vec3.js"; |
@@ -0,1 +1,2 @@ | ||
import type { NumericArray } from '@math.gl/types'; | ||
/** | ||
@@ -8,20 +9,20 @@ * 2 Dimensional Vector | ||
* | ||
* @returns {NumericArray} a new 2D vector | ||
* @returns a new 2D vector | ||
*/ | ||
export declare function create(): any[] | Float32Array; | ||
export declare function create(): NumericArray; | ||
/** | ||
* Creates a new vec2 initialized with values from an existing vector | ||
* | ||
* @param {Readonly<NumericArray>} a vector to clone | ||
* @returns {NumericArray} a new 2D vector | ||
* @param a vector to clone | ||
* @returns a new 2D vector | ||
*/ | ||
export declare function clone(a: any): any[] | Float32Array; | ||
export declare function clone(a: Readonly<NumericArray>): NumericArray; | ||
/** | ||
* Creates a new vec2 initialized with the given values | ||
* | ||
* @param {Number} x X component | ||
* @param {Number} y Y component | ||
* @returns {NumericArray} a new 2D vector | ||
* @param x X component | ||
* @param y Y component | ||
* @returns a new 2D vector | ||
*/ | ||
export declare function fromValues(x: any, y: any): any[] | Float32Array; | ||
export declare function fromValues(x: number, y: number): NumericArray; | ||
/** | ||
@@ -28,0 +29,0 @@ * Copy the values from one vec2 to another |
@@ -11,3 +11,3 @@ // @eslint-disable | ||
* | ||
* @returns {NumericArray} a new 2D vector | ||
* @returns a new 2D vector | ||
*/ | ||
@@ -25,4 +25,4 @@ export function create() { | ||
* | ||
* @param {Readonly<NumericArray>} a vector to clone | ||
* @returns {NumericArray} a new 2D vector | ||
* @param a vector to clone | ||
* @returns a new 2D vector | ||
*/ | ||
@@ -38,5 +38,5 @@ export function clone(a) { | ||
* | ||
* @param {Number} x X component | ||
* @param {Number} y Y component | ||
* @returns {NumericArray} a new 2D vector | ||
* @param x X component | ||
* @param y Y component | ||
* @returns a new 2D vector | ||
*/ | ||
@@ -43,0 +43,0 @@ export function fromValues(x, y) { |
@@ -1,3 +0,3 @@ | ||
export type { TypedArray, TypedArrayConstructor, NumberArray, NumericArray } from '@math.gl/types'; | ||
export type { isTypedArray, isNumericArray } from '@math.gl/types'; | ||
export type { TypedArray, TypedArrayConstructor, NumericArray, NumberArray, NumberArray2, NumberArray3, NumberArray4, NumberArray6, NumberArray8, NumberArray9, NumberArray12, NumberArray16 } from '@math.gl/types'; | ||
export type { isTypedArray, isNumberArray, isNumericArray } from '@math.gl/types'; | ||
export { Vector2 } from "./classes/vector2.js"; | ||
@@ -4,0 +4,0 @@ export { Vector3 } from "./classes/vector3.js"; |
@@ -1,5 +0,5 @@ | ||
import { NumberArray } from '@math.gl/types'; | ||
export declare function validateVector(v: NumberArray, length: number): boolean; | ||
import { NumericArray } from '@math.gl/types'; | ||
export declare function validateVector(v: NumericArray, length: number): boolean; | ||
export declare function checkNumber(value: unknown): number; | ||
export declare function checkVector<T extends NumberArray>(v: T, length: number, callerName?: string): T; | ||
export declare function checkVector<T extends NumericArray>(v: T, length: number, callerName?: string): T; | ||
export declare function deprecated(method: string, version: string): void; |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "4.1.0-alpha.1", | ||
"version": "4.1.0-alpha.2", | ||
"keywords": [ | ||
@@ -49,5 +49,5 @@ "webgl", | ||
"dependencies": { | ||
"@math.gl/types": "4.1.0-alpha.1" | ||
"@math.gl/types": "4.1.0-alpha.2" | ||
}, | ||
"gitHead": "1a4dbbc6ab46271459d610411a7c644e45135c2c" | ||
"gitHead": "59eb434870991d06aecff5b1dee38078af0ca447" | ||
} |
@@ -53,3 +53,3 @@ // math.gl | ||
: // @ts-ignore | ||
this.fromObject(arrayOrObject); | ||
this.fromObject(arrayOrObject); | ||
} | ||
@@ -56,0 +56,0 @@ |
@@ -17,2 +17,3 @@ // math.gl | ||
// eslint-disable-next-line no-shadow | ||
enum RotationOrder { | ||
@@ -75,4 +76,4 @@ ZYX = 0, | ||
if (arguments.length > 0 && Array.isArray(arguments[0])) { | ||
// @ts-expect-error | ||
// eslint-disable-next-line prefer-rest-params | ||
// @ts-expect-error | ||
this.fromVector3(...arguments); | ||
@@ -79,0 +80,0 @@ } else { |
@@ -25,2 +25,3 @@ // math.gl | ||
// eslint-disable-next-line no-shadow | ||
enum INDICES { | ||
@@ -27,0 +28,0 @@ COL0ROW0 = 0, |
@@ -34,2 +34,3 @@ // math.gl | ||
// eslint-disable-next-line no-shadow | ||
enum INDICES { | ||
@@ -36,0 +37,0 @@ COL0ROW0 = 0, |
@@ -9,4 +9,3 @@ // math.gl | ||
import {Vector3} from './vector3'; | ||
import {formatValue, equals, config} from '../lib/common'; | ||
import {degrees, radians, clamp} from '../lib/common'; | ||
import {formatValue, equals, config, degrees, radians, clamp} from '../lib/common'; | ||
// @ts-ignore gl-matrix types... | ||
@@ -13,0 +12,0 @@ import * as vec3 from '../gl-matrix/vec3'; |
@@ -15,5 +15,5 @@ // @eslint-disable | ||
* | ||
* @returns {NumericArray} a new 2D vector | ||
* @returns a new 2D vector | ||
*/ | ||
export function create() { | ||
export function create(): NumericArray { | ||
const out = new glMatrix.ARRAY_TYPE(2); | ||
@@ -30,6 +30,6 @@ if (glMatrix.ARRAY_TYPE != Float32Array) { | ||
* | ||
* @param {Readonly<NumericArray>} a vector to clone | ||
* @returns {NumericArray} a new 2D vector | ||
* @param a vector to clone | ||
* @returns a new 2D vector | ||
*/ | ||
export function clone(a) { | ||
export function clone(a: Readonly<NumericArray>): NumericArray { | ||
const out = new glMatrix.ARRAY_TYPE(2); | ||
@@ -44,7 +44,7 @@ out[0] = a[0]; | ||
* | ||
* @param {Number} x X component | ||
* @param {Number} y Y component | ||
* @returns {NumericArray} a new 2D vector | ||
* @param x X component | ||
* @param y Y component | ||
* @returns a new 2D vector | ||
*/ | ||
export function fromValues(x, y) { | ||
export function fromValues(x: number, y: number): NumericArray { | ||
const out = new glMatrix.ARRAY_TYPE(2); | ||
@@ -51,0 +51,0 @@ out[0] = x; |
@@ -6,5 +6,18 @@ // math.gl | ||
// types | ||
export type {TypedArray, TypedArrayConstructor, NumberArray, NumericArray} from '@math.gl/types'; | ||
export type { | ||
TypedArray, | ||
TypedArrayConstructor, | ||
NumericArray, | ||
NumberArray, | ||
NumberArray2, | ||
NumberArray3, | ||
NumberArray4, | ||
NumberArray6, | ||
NumberArray8, | ||
NumberArray9, | ||
NumberArray12, | ||
NumberArray16 | ||
} from '@math.gl/types'; | ||
export type {isTypedArray, isNumericArray} from '@math.gl/types'; | ||
export type {isTypedArray, isNumberArray, isNumericArray} from '@math.gl/types'; | ||
@@ -11,0 +24,0 @@ // classes |
@@ -5,2 +5,4 @@ // math.gl | ||
/* eslint-disable no-shadow */ // radians and degrees are common variable names | ||
import type {NumericArray} from '@math.gl/types'; | ||
@@ -305,3 +307,3 @@ | ||
value: number | NumericArray, | ||
func: (x: number, index?: number, result?: NumericArray) => number, | ||
func: (x: number, index?: number, resultArray?: NumericArray) => number, | ||
result?: NumericArray | ||
@@ -308,0 +310,0 @@ ): number | NumericArray { |
@@ -5,6 +5,6 @@ // math.gl | ||
import {NumberArray} from '@math.gl/types'; | ||
import {NumericArray} from '@math.gl/types'; | ||
import {config} from './common'; | ||
export function validateVector(v: NumberArray, length: number): boolean { | ||
export function validateVector(v: NumericArray, length: number): boolean { | ||
if (v.length !== length) { | ||
@@ -29,3 +29,3 @@ return false; | ||
export function checkVector<T extends NumberArray>( | ||
export function checkVector<T extends NumericArray>( | ||
v: T, | ||
@@ -32,0 +32,0 @@ length: number, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1256043
30707
+ Added@math.gl/types@4.1.0-alpha.2(transitive)
- Removed@math.gl/types@4.1.0-alpha.1(transitive)
Updated@math.gl/types@4.1.0-alpha.2