Skip to content

Commit

Permalink
chore: bump to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen committed Aug 3, 2024
1 parent 6352db8 commit add0cd1
Show file tree
Hide file tree
Showing 16 changed files with 349 additions and 144 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ module.exports = getESLintConfig({
{
files: ['modules/**/*.ts', 'modules/**/*.js'],
rules: {
'no-use-before-define': 0,
'import/no-unresolved': 0,
'import/named': 0,
'@typescript-eslint/ban-ts-comment': 0 // We do need our ts-ignores
}
},
Expand Down
3 changes: 2 additions & 1 deletion modules/core/src/classes/euler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {checkNumber} from '../lib/validators';
const ERR_UNKNOWN_ORDER = 'Unknown Euler angle order';
const ALMOST_ONE = 0.99999;

// eslint-disable-next-line no-shadow
enum RotationOrder {
ZYX = 0,
YXZ = 1,
Expand Down Expand Up @@ -71,8 +72,8 @@ export class Euler extends MathArray {
super(-0, -0, -0, -0);
// eslint-disable-next-line prefer-rest-params
if (arguments.length > 0 && Array.isArray(arguments[0])) {
// eslint-disable-next-line prefer-rest-params
// @ts-expect-error
// eslint-disable-next-line prefer-rest-params
this.fromVector3(...arguments);
} else {
this.set(x, y, z, order);
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/classes/matrix3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
import {transformMat3 as vec2_transformMat3} from '../gl-matrix/vec2';
import {transformMat3 as vec3_transformMat3} from '../gl-matrix/vec3';

// eslint-disable-next-line no-shadow
enum INDICES {
COL0ROW0 = 0,
COL0ROW1 = 1,
Expand Down
1 change: 1 addition & 0 deletions modules/core/src/classes/matrix4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {transformMat4 as vec2_transformMat4} from '../gl-matrix/vec2';
import {transformMat4 as vec3_transformMat4} from '../gl-matrix/vec3';
import {transformMat4 as vec4_transformMat4} from '../gl-matrix/vec4';

// eslint-disable-next-line no-shadow
enum INDICES {
COL0ROW0 = 0,
COL0ROW1 = 1,
Expand Down
3 changes: 1 addition & 2 deletions modules/core/src/classes/spherical-coordinates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
// Adaptation of THREE.js Spherical class, under MIT license
import {NumericArray} from '@math.gl/types';
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...
import * as vec3 from '../gl-matrix/vec3';

Expand Down
18 changes: 9 additions & 9 deletions modules/core/src/gl-matrix/vec2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import * as glMatrix from './common.js';
/**
* Creates a new, empty vec2
*
* @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);
if (glMatrix.ARRAY_TYPE != Float32Array) {
out[0] = 0;
Expand All @@ -26,10 +26,10 @@ export function create() {
/**
* 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 function clone(a) {
export function clone(a: Readonly<NumericArray>): NumericArray {
const out = new glMatrix.ARRAY_TYPE(2);
out[0] = a[0];
out[1] = a[1];
Expand All @@ -39,11 +39,11 @@ export function clone(a) {
/**
* 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 function fromValues(x, y) {
export function fromValues(x: number, y: number): NumericArray {
const out = new glMatrix.ARRAY_TYPE(2);
out[0] = x;
out[1] = y;
Expand Down
17 changes: 15 additions & 2 deletions modules/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@
// Copyright (c) vis.gl contributors

// 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';

// classes
export {Vector2} from './classes/vector2';
Expand Down
4 changes: 3 additions & 1 deletion modules/core/src/lib/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors

/* eslint-disable no-shadow */ // radians and degrees are common variable names

import type {NumericArray} from '@math.gl/types';

import type {MathArray} from '../classes/base/math-array';
Expand Down Expand Up @@ -301,7 +303,7 @@ function duplicateArray(array: NumericArray): NumericArray {
// otherwise applies func to the argument value
function map(
value: number | NumericArray,
func: (x: number, index?: number, result?: NumericArray) => number,
func: (x: number, index?: number, resultArray?: NumericArray) => number,
result?: NumericArray
): number | NumericArray {
if (isArray(value)) {
Expand Down
3 changes: 2 additions & 1 deletion modules/culling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"src"
],
"dependencies": {
"@math.gl/core": "4.1.0-alpha.1"
"@math.gl/core": "4.1.0-alpha.1",
"@math.gl/types": "4.1.0-alpha.1"
},
"gitHead": "e1a95300cb225a90da6e90333d4adf290f7ba501"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
// This file is derived from the Cesium math library under Apache 2 license
// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md

import {Vector3, Matrix3, Matrix4, Quaternion, NumericArray} from '@math.gl/core';
import {NumericArray} from '@math.gl/types';
import {Vector3, Matrix3, Matrix4, Quaternion} from '@math.gl/core';
import type {BoundingVolume} from './bounding-volume';
import {BoundingSphere} from './bounding-sphere';
import type {Plane} from '../plane';
Expand Down
3 changes: 2 additions & 1 deletion modules/culling/src/lib/perspective-frustum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
// - It has not been fully adapted to math.gl conventions
// - Documentation has not been ported

import {assert, Matrix4, NumericArray, Vector2} from '@math.gl/core';
import {NumericArray} from '@math.gl/types';
import {assert, Matrix4, Vector2} from '@math.gl/core';
import {PerspectiveOffCenterFrustum} from './perspective-off-center-frustum';
import {CullingVolume} from './culling-volume';

Expand Down
3 changes: 2 additions & 1 deletion modules/geospatial/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
"src"
],
"dependencies": {
"@math.gl/core": "4.1.0-alpha.1"
"@math.gl/core": "4.1.0-alpha.1",
"@math.gl/types": "4.1.0-alpha.1"
},
"gitHead": "e1a95300cb225a90da6e90333d4adf290f7ba501"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// SPDX-License-Identifier: MIT and Apache-2.0
// Copyright (c) vis.gl contributors

import {NumericArray, Vector3, assert, equals as equalsEpsilon} from '@math.gl/core';
import {NumericArray} from '@math.gl/types';
import {Vector3, assert, equals as equalsEpsilon} from '@math.gl/core';

import type {Ellipsoid} from '../ellipsoid';

Expand Down
1 change: 1 addition & 0 deletions modules/web-mercator/src/web-mercator-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export function addMetersToLngLat(lngLatZ: number[], xyz: number[]): number[] {
const [longitude, latitude, z0] = lngLatZ;
const [x, y, z] = xyz;

// eslint-disable-next-line no-shadow
const {unitsPerMeter, unitsPerMeter2} = getDistanceScales({
longitude,
latitude,
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"examples/*"
],
"scripts": {
"bootstrap": "yarn && ocular-bootstrap",
"bootstrap": "ocular-bootstrap",
"clean": "ocular-clean",
"build": "npm run clean && time ocular-build",
"cover": "ocular-test cover",
Expand All @@ -26,9 +26,10 @@
"@probe.gl/bench": "^4.0.0",
"@turf/destination": "^6.0.1",
"@types/tape-promise": "^4.0.1",
"ocular-dev-tools": "2.0.0-alpha.33",
"ocular-dev-tools": "2.0.0-alpha.34",
"pre-commit": "^1.2.2",
"puppeteer": "^22.0.0"
"puppeteer": "^22.0.0",
"tap-spec": "^5.0.0"
},
"resolutions": {
"typescript": "5.4.3"
Expand Down
Loading

0 comments on commit add0cd1

Please sign in to comment.