@math.gl/core 5.0.0-alpha.17 → 5.0.0-alpha.19

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.
Files changed (148) hide show
  1. package/README.md +4 -0
  2. package/dist/classes/base/math-array.d.ts +1 -1
  3. package/dist/classes/base/math-array.d.ts.map +1 -1
  4. package/dist/classes/base/matrix.d.ts +1 -1
  5. package/dist/classes/base/matrix.d.ts.map +1 -1
  6. package/dist/classes/base/vector.d.ts +1 -1
  7. package/dist/classes/base/vector.d.ts.map +1 -1
  8. package/dist/classes/euler.d.ts +1 -1
  9. package/dist/classes/euler.d.ts.map +1 -1
  10. package/dist/classes/matrix3.d.ts +1 -1
  11. package/dist/classes/matrix3.d.ts.map +1 -1
  12. package/dist/classes/matrix4.d.ts +1 -1
  13. package/dist/classes/matrix4.d.ts.map +1 -1
  14. package/dist/classes/pose.d.ts +1 -1
  15. package/dist/classes/pose.d.ts.map +1 -1
  16. package/dist/classes/quaternion.d.ts +1 -1
  17. package/dist/classes/quaternion.d.ts.map +1 -1
  18. package/dist/classes/vector2.d.ts +1 -1
  19. package/dist/classes/vector2.d.ts.map +1 -1
  20. package/dist/classes/vector3.d.ts +1 -1
  21. package/dist/classes/vector3.d.ts.map +1 -1
  22. package/dist/classes/vector4.d.ts +1 -1
  23. package/dist/classes/vector4.d.ts.map +1 -1
  24. package/dist/expressions/expression-eval.d.ts +98 -0
  25. package/dist/expressions/expression-eval.d.ts.map +1 -0
  26. package/dist/expressions/expression-eval.js +302 -0
  27. package/dist/expressions/expression-eval.js.map +1 -0
  28. package/dist/expressions/function-libraries.d.ts +60 -0
  29. package/dist/expressions/function-libraries.d.ts.map +1 -0
  30. package/dist/expressions/function-libraries.js +69 -0
  31. package/dist/expressions/function-libraries.js.map +1 -0
  32. package/dist/expressions/function-registry.d.ts +93 -0
  33. package/dist/expressions/function-registry.d.ts.map +1 -0
  34. package/dist/expressions/function-registry.js +131 -0
  35. package/dist/expressions/function-registry.js.map +1 -0
  36. package/dist/expressions/get.d.ts +9 -0
  37. package/dist/expressions/get.d.ts.map +1 -0
  38. package/dist/expressions/get.js +32 -0
  39. package/dist/expressions/get.js.map +1 -0
  40. package/dist/expressions/index.cjs +1483 -0
  41. package/dist/expressions/index.cjs.map +6 -0
  42. package/dist/expressions/index.d.ts +7 -0
  43. package/dist/expressions/index.d.ts.map +1 -0
  44. package/dist/expressions/index.js +8 -0
  45. package/dist/expressions/index.js.map +1 -0
  46. package/dist/expressions/parse-expression-string.d.ts +21 -0
  47. package/dist/expressions/parse-expression-string.d.ts.map +1 -0
  48. package/dist/expressions/parse-expression-string.js +61 -0
  49. package/dist/expressions/parse-expression-string.js.map +1 -0
  50. package/dist/expressions/vendor/jsep/runtime.d.ts +3 -0
  51. package/dist/expressions/vendor/jsep/runtime.d.ts.map +1 -0
  52. package/dist/expressions/vendor/jsep/runtime.js +972 -0
  53. package/dist/expressions/vendor/jsep/runtime.js.map +1 -0
  54. package/dist/expressions/vendor/jsep/types.d.ts +141 -0
  55. package/dist/expressions/vendor/jsep/types.d.ts.map +1 -0
  56. package/dist/expressions/vendor/jsep/types.js +4 -0
  57. package/dist/expressions/vendor/jsep/types.js.map +1 -0
  58. package/dist/gl-matrix/common.d.ts +1 -1
  59. package/dist/gl-matrix/vec2.d.ts +1 -1
  60. package/dist/gl-matrix/vec2.d.ts.map +1 -1
  61. package/dist/index.d.ts +3 -3
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/lib/common.d.ts +1 -1
  64. package/dist/lib/common.d.ts.map +1 -1
  65. package/dist/lib/gl-matrix-extras.d.ts +1 -1
  66. package/dist/lib/gl-matrix-extras.d.ts.map +1 -1
  67. package/dist/lib/validators.d.ts +1 -1
  68. package/dist/lib/validators.d.ts.map +1 -1
  69. package/dist/local-frame.d.ts +1 -1
  70. package/dist/local-frame.d.ts.map +1 -1
  71. package/dist/spheroid.d.ts +1 -1
  72. package/dist/spheroid.d.ts.map +1 -1
  73. package/dist/types/array-types.d.ts +98 -0
  74. package/dist/types/array-types.d.ts.map +1 -0
  75. package/dist/types/array-types.js +6 -0
  76. package/dist/types/array-types.js.map +1 -0
  77. package/dist/types/bigint.d.ts +21 -0
  78. package/dist/types/bigint.d.ts.map +1 -0
  79. package/dist/types/bigint.js +48 -0
  80. package/dist/types/bigint.js.map +1 -0
  81. package/dist/types/bounds-types.d.ts +11 -0
  82. package/dist/types/bounds-types.d.ts.map +1 -0
  83. package/dist/types/bounds-types.js +17 -0
  84. package/dist/types/bounds-types.js.map +1 -0
  85. package/dist/types/float16.d.ts +32 -0
  86. package/dist/types/float16.d.ts.map +1 -0
  87. package/dist/types/float16.js +41 -0
  88. package/dist/types/float16.js.map +1 -0
  89. package/dist/types/index.d.ts +6 -0
  90. package/dist/types/index.d.ts.map +1 -0
  91. package/dist/types/index.js +6 -0
  92. package/dist/types/index.js.map +1 -0
  93. package/dist/types/is-array.d.ts +22 -0
  94. package/dist/types/is-array.d.ts.map +1 -0
  95. package/dist/types/is-array.js +36 -0
  96. package/dist/types/is-array.js.map +1 -0
  97. package/dist/types/spheroid.d.ts +8 -0
  98. package/dist/types/spheroid.d.ts.map +1 -0
  99. package/dist/types/spheroid.js +5 -0
  100. package/dist/types/spheroid.js.map +1 -0
  101. package/dist/types/typed-array-brand.d.ts +2 -0
  102. package/dist/types/typed-array-brand.d.ts.map +1 -0
  103. package/dist/types/typed-array-brand.js +10 -0
  104. package/dist/types/typed-array-brand.js.map +1 -0
  105. package/dist/types.cjs +67 -0
  106. package/dist/types.cjs.map +6 -0
  107. package/dist/types.d.ts +2 -0
  108. package/dist/types.d.ts.map +1 -0
  109. package/dist/types.js +5 -0
  110. package/dist/types.js.map +1 -0
  111. package/package.json +12 -5
  112. package/src/classes/base/math-array.ts +1 -1
  113. package/src/classes/base/matrix.ts +1 -1
  114. package/src/classes/base/vector.ts +1 -1
  115. package/src/classes/euler.ts +1 -1
  116. package/src/classes/matrix3.ts +1 -1
  117. package/src/classes/matrix4.ts +1 -1
  118. package/src/classes/pose.ts +1 -1
  119. package/src/classes/quaternion.ts +1 -1
  120. package/src/classes/vector2.ts +1 -1
  121. package/src/classes/vector3.ts +1 -1
  122. package/src/classes/vector4.ts +1 -1
  123. package/src/expressions/expression-eval.ts +435 -0
  124. package/src/expressions/function-libraries.ts +123 -0
  125. package/src/expressions/function-registry.ts +163 -0
  126. package/src/expressions/get.ts +37 -0
  127. package/src/expressions/index.ts +22 -0
  128. package/src/expressions/parse-expression-string.ts +80 -0
  129. package/src/expressions/vendor/jsep/LICENSE.txt +23 -0
  130. package/src/expressions/vendor/jsep/README.md +22 -0
  131. package/src/expressions/vendor/jsep/runtime.ts +949 -0
  132. package/src/expressions/vendor/jsep/types.ts +179 -0
  133. package/src/gl-matrix/vec2.ts +1 -1
  134. package/src/index.ts +3 -3
  135. package/src/lib/common.ts +1 -1
  136. package/src/lib/gl-matrix-extras.ts +1 -1
  137. package/src/lib/validators.ts +1 -1
  138. package/src/local-frame.ts +1 -1
  139. package/src/spheroid.ts +1 -1
  140. package/src/types/array-types.ts +148 -0
  141. package/src/types/bigint.ts +56 -0
  142. package/src/types/bounds-types.ts +29 -0
  143. package/src/types/float16.ts +47 -0
  144. package/src/types/index.ts +45 -0
  145. package/src/types/is-array.ts +41 -0
  146. package/src/types/spheroid.ts +11 -0
  147. package/src/types/typed-array-brand.ts +14 -0
  148. package/src/types.ts +5 -0
@@ -0,0 +1,32 @@
1
+ import type { TypedArrayConstructor } from "./array-types.js";
2
+ /**
3
+ * Checks for native Float16Array values, including arrays from other realms.
4
+ * Does not identify Uint16Array binary16 storage as a decoded Float16Array.
5
+ * Does not require a Float16Array constructor in the current realm.
6
+ */
7
+ export declare function isFloat16Array(value: unknown): value is Float16Array;
8
+ /**
9
+ * The native `Float16Array` constructor exposed by the current JavaScript runtime.
10
+ *
11
+ * @remarks This is `undefined` when the runtime does not provide `Float16Array`. The value is
12
+ * captured when this module is evaluated, so a polyfill must be installed before importing
13
+ * `@math.gl/core/types`.
14
+ */
15
+ export declare const NativeFloat16ArrayConstructor: TypedArrayConstructor | undefined;
16
+ /**
17
+ * Returns the typed array constructor used for half-precision storage.
18
+ *
19
+ * @returns The native `Float16Array` constructor when available, otherwise `Uint16Array`.
20
+ * @remarks The `Uint16Array` fallback stores encoded IEEE 754 binary16 bit patterns. Unlike a
21
+ * native `Float16Array`, it does not encode numeric assignments or decode values when read.
22
+ */
23
+ export declare function getFloat16ArrayConstructor(): TypedArrayConstructor;
24
+ /**
25
+ * Checks whether a value is the native `Float16Array` constructor for the current runtime.
26
+ *
27
+ * @param value The value to test.
28
+ * @returns `true` when `value` matches `NativeFloat16ArrayConstructor`. Returns `false` for the
29
+ * `Uint16Array` fallback.
30
+ */
31
+ export declare function isFloat16ArrayConstructor(value: unknown): boolean;
32
+ //# sourceMappingURL=float16.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"float16.d.ts","sourceRoot":"","sources":["../../src/types/float16.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,qBAAqB,EAAC,yBAAsB;AAGzD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B,EAAE,qBAAqB,GAAG,SAC3C,CAAC;AAE1B;;;;;;GAMG;AACH,wBAAgB,0BAA0B,IAAI,qBAAqB,CAElE;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAEjE"}
@@ -0,0 +1,41 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { getTypedArrayName } from "./typed-array-brand.js";
5
+ /**
6
+ * Checks for native Float16Array values, including arrays from other realms.
7
+ * Does not identify Uint16Array binary16 storage as a decoded Float16Array.
8
+ * Does not require a Float16Array constructor in the current realm.
9
+ */
10
+ export function isFloat16Array(value) {
11
+ return getTypedArrayName(value) === 'Float16Array';
12
+ }
13
+ /**
14
+ * The native `Float16Array` constructor exposed by the current JavaScript runtime.
15
+ *
16
+ * @remarks This is `undefined` when the runtime does not provide `Float16Array`. The value is
17
+ * captured when this module is evaluated, so a polyfill must be installed before importing
18
+ * `@math.gl/core/types`.
19
+ */
20
+ export const NativeFloat16ArrayConstructor = globalThis.Float16Array;
21
+ /**
22
+ * Returns the typed array constructor used for half-precision storage.
23
+ *
24
+ * @returns The native `Float16Array` constructor when available, otherwise `Uint16Array`.
25
+ * @remarks The `Uint16Array` fallback stores encoded IEEE 754 binary16 bit patterns. Unlike a
26
+ * native `Float16Array`, it does not encode numeric assignments or decode values when read.
27
+ */
28
+ export function getFloat16ArrayConstructor() {
29
+ return NativeFloat16ArrayConstructor ?? Uint16Array;
30
+ }
31
+ /**
32
+ * Checks whether a value is the native `Float16Array` constructor for the current runtime.
33
+ *
34
+ * @param value The value to test.
35
+ * @returns `true` when `value` matches `NativeFloat16ArrayConstructor`. Returns `false` for the
36
+ * `Uint16Array` fallback.
37
+ */
38
+ export function isFloat16ArrayConstructor(value) {
39
+ return Boolean(NativeFloat16ArrayConstructor && value === NativeFloat16ArrayConstructor);
40
+ }
41
+ //# sourceMappingURL=float16.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"float16.js","sourceRoot":"","sources":["../../src/types/float16.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAG5D,OAAO,EAAC,iBAAiB,EAAC,+BAA4B;AAEtD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,iBAAiB,CAAC,KAAK,CAAC,KAAK,cAAc,CAAC;AACrD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GACxC,UAAU,CAAC,YAAY,CAAC;AAE1B;;;;;;GAMG;AACH,MAAM,UAAU,0BAA0B;IACxC,OAAO,6BAA6B,IAAI,WAAW,CAAC;AACtD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,yBAAyB,CAAC,KAAc;IACtD,OAAO,OAAO,CAAC,6BAA6B,IAAI,KAAK,KAAK,6BAA6B,CAAC,CAAC;AAC3F,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type { TypedArray, TypedArrayConstructor, BigTypedArray, BigTypedArrayConstructor, NumberArray, NumberArray1, NumberArray2, NumberArray3, NumberArray4, NumberArray6, NumberArray8, NumberArray9, NumberArray12, NumberArray16, NumericArray, NumericArray1, NumericArray2, NumericArray3, NumericArray4, NumericArray6, NumericArray8, NumericArray9, NumericArray12, NumericArray16 } from "./array-types.js";
2
+ export { isTypedArray, isUint16Array, isNumberArray, isNumericArray } from "./is-array.js";
3
+ export { NativeFloat16ArrayConstructor, getFloat16ArrayConstructor, isFloat16ArrayConstructor, isFloat16Array } from "./float16.js";
4
+ export type { Bounds, Bounds2D, Bounds3D } from "./bounds-types.js";
5
+ export type { SpheroidParameters } from "./spheroid.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAEV,UAAU,EACV,qBAAqB,EACrB,aAAa,EACb,wBAAwB,EAExB,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EAEb,YAAY,EACZ,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,EACd,cAAc,EACf,yBAAsB;AAEvB,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAC,sBAAmB;AACtF,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,cAAc,EACf,qBAAkB;AAEnB,YAAY,EAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAC,0BAAuB;AAE/D,YAAY,EAAC,kBAAkB,EAAC,sBAAmB"}
@@ -0,0 +1,6 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ export { isTypedArray, isUint16Array, isNumberArray, isNumericArray } from "./is-array.js";
5
+ export { NativeFloat16ArrayConstructor, getFloat16ArrayConstructor, isFloat16ArrayConstructor, isFloat16Array } from "./float16.js";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAgC5D,OAAO,EAAC,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAC,sBAAmB;AACtF,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,yBAAyB,EACzB,cAAc,EACf,qBAAkB"}
@@ -0,0 +1,22 @@
1
+ import { TypedArray, NumericArray, NumberArray } from "./array-types.js";
2
+ /** Checks for unsigned 16-bit samples, including typed arrays from other realms. */
3
+ export declare function isUint16Array(value: unknown): value is Uint16Array;
4
+ /**
5
+ * Check is an array is a typed array
6
+ * @param value value to be tested
7
+ * @returns input with type narrowed to TypedArray, or null
8
+ */
9
+ export declare function isTypedArray(value: unknown): value is TypedArray;
10
+ /**
11
+ * Check is an array is an array of numbers)
12
+ * @param value value to be tested
13
+ * @returns input with type narrowed to NumberArray, or null
14
+ */
15
+ export declare function isNumberArray(value: unknown): value is NumberArray;
16
+ /**
17
+ * Check is an array is a numeric array (typed array or array of numbers)
18
+ * @param value value to be tested
19
+ * @returns input with type narrowed to NumericArray, or null
20
+ */
21
+ export declare function isNumericArray(value: unknown): value is NumericArray;
22
+ //# sourceMappingURL=is-array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-array.d.ts","sourceRoot":"","sources":["../../src/types/is-array.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAE,YAAY,EAAE,WAAW,EAAC,yBAAsB;AAGpE,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAKlE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE"}
@@ -0,0 +1,36 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { getTypedArrayName } from "./typed-array-brand.js";
5
+ /** Checks for unsigned 16-bit samples, including typed arrays from other realms. */
6
+ export function isUint16Array(value) {
7
+ return getTypedArrayName(value) === 'Uint16Array';
8
+ }
9
+ /**
10
+ * Check is an array is a typed array
11
+ * @param value value to be tested
12
+ * @returns input with type narrowed to TypedArray, or null
13
+ */
14
+ export function isTypedArray(value) {
15
+ return ArrayBuffer.isView(value) && !(value instanceof DataView);
16
+ }
17
+ /**
18
+ * Check is an array is an array of numbers)
19
+ * @param value value to be tested
20
+ * @returns input with type narrowed to NumberArray, or null
21
+ */
22
+ export function isNumberArray(value) {
23
+ if (Array.isArray(value)) {
24
+ return value.length === 0 || typeof value[0] === 'number';
25
+ }
26
+ return false;
27
+ }
28
+ /**
29
+ * Check is an array is a numeric array (typed array or array of numbers)
30
+ * @param value value to be tested
31
+ * @returns input with type narrowed to NumericArray, or null
32
+ */
33
+ export function isNumericArray(value) {
34
+ return isTypedArray(value) || isNumberArray(value);
35
+ }
36
+ //# sourceMappingURL=is-array.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-array.js","sourceRoot":"","sources":["../../src/types/is-array.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAG5D,OAAO,EAAC,iBAAiB,EAAC,+BAA4B;AAEtD,oFAAoF;AACpF,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,iBAAiB,CAAC,KAAK,CAAC,KAAK,aAAa,CAAC;AACpD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,YAAY,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC;IAC5D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAc;IAC3C,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;AACrD,CAAC"}
@@ -0,0 +1,8 @@
1
+ /** Geometry of a sphere or oblate spheroid, in metres. No datum, axes or epoch metadata.
2
+ * Both axes must be finite and positive, with semiMinorAxis <= semiMajorAxis.
3
+ */
4
+ export type SpheroidParameters = {
5
+ readonly semiMajorAxis: number;
6
+ readonly semiMinorAxis: number;
7
+ };
8
+ //# sourceMappingURL=spheroid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spheroid.d.ts","sourceRoot":"","sources":["../../src/types/spheroid.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,CAAC"}
@@ -0,0 +1,5 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ export {};
5
+ //# sourceMappingURL=spheroid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spheroid.js","sourceRoot":"","sources":["../../src/types/spheroid.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D"}
@@ -0,0 +1,2 @@
1
+ export declare function getTypedArrayName(value: unknown): string | undefined;
2
+ //# sourceMappingURL=typed-array-brand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed-array-brand.d.ts","sourceRoot":"","sources":["../../src/types/typed-array-brand.ts"],"names":[],"mappings":"AAWA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEpE"}
@@ -0,0 +1,10 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ // Use the intrinsic getter so constructor and Symbol.toStringTag overrides cannot
5
+ // disguise a typed array's element type. It also works for arrays from other realms.
6
+ const typedArrayTagGetter = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get;
7
+ export function getTypedArrayName(value) {
8
+ return ArrayBuffer.isView(value) ? typedArrayTagGetter.call(value) : undefined;
9
+ }
10
+ //# sourceMappingURL=typed-array-brand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed-array-brand.js","sourceRoot":"","sources":["../../src/types/typed-array-brand.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,kFAAkF;AAClF,qFAAqF;AACrF,MAAM,mBAAmB,GAAG,MAAM,CAAC,wBAAwB,CACzD,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,EAC3C,MAAM,CAAC,WAAW,CAClB,CAAC,GAAI,CAAC;AAER,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,OAAO,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACjF,CAAC"}
package/dist/types.cjs ADDED
@@ -0,0 +1,67 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // dist/types.js
20
+ var types_exports = {};
21
+ __export(types_exports, {
22
+ NativeFloat16ArrayConstructor: () => NativeFloat16ArrayConstructor,
23
+ getFloat16ArrayConstructor: () => getFloat16ArrayConstructor,
24
+ isFloat16Array: () => isFloat16Array,
25
+ isFloat16ArrayConstructor: () => isFloat16ArrayConstructor,
26
+ isNumberArray: () => isNumberArray,
27
+ isNumericArray: () => isNumericArray,
28
+ isTypedArray: () => isTypedArray,
29
+ isUint16Array: () => isUint16Array
30
+ });
31
+ module.exports = __toCommonJS(types_exports);
32
+
33
+ // dist/types/typed-array-brand.js
34
+ var typedArrayTagGetter = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), Symbol.toStringTag).get;
35
+ function getTypedArrayName(value) {
36
+ return ArrayBuffer.isView(value) ? typedArrayTagGetter.call(value) : void 0;
37
+ }
38
+
39
+ // dist/types/is-array.js
40
+ function isUint16Array(value) {
41
+ return getTypedArrayName(value) === "Uint16Array";
42
+ }
43
+ function isTypedArray(value) {
44
+ return ArrayBuffer.isView(value) && !(value instanceof DataView);
45
+ }
46
+ function isNumberArray(value) {
47
+ if (Array.isArray(value)) {
48
+ return value.length === 0 || typeof value[0] === "number";
49
+ }
50
+ return false;
51
+ }
52
+ function isNumericArray(value) {
53
+ return isTypedArray(value) || isNumberArray(value);
54
+ }
55
+
56
+ // dist/types/float16.js
57
+ function isFloat16Array(value) {
58
+ return getTypedArrayName(value) === "Float16Array";
59
+ }
60
+ var NativeFloat16ArrayConstructor = globalThis.Float16Array;
61
+ function getFloat16ArrayConstructor() {
62
+ return NativeFloat16ArrayConstructor ?? Uint16Array;
63
+ }
64
+ function isFloat16ArrayConstructor(value) {
65
+ return Boolean(NativeFloat16ArrayConstructor && value === NativeFloat16ArrayConstructor);
66
+ }
67
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/types.ts", "../src/types/typed-array-brand.ts", "../src/types/is-array.ts", "../src/types/float16.ts"],
4
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;ACMA,IAAM,sBAAsB,OAAO,yBACjC,OAAO,eAAe,WAAW,SAAS,GAC1C,OAAO,WAAW,EACjB;AAEG,SAAU,kBAAkB,OAAc;AAC9C,SAAO,YAAY,OAAO,KAAK,IAAI,oBAAoB,KAAK,KAAK,IAAI;AACvE;;;ACLM,SAAU,cAAc,OAAc;AAC1C,SAAO,kBAAkB,KAAK,MAAM;AACtC;AAOM,SAAU,aAAa,OAAc;AACzC,SAAO,YAAY,OAAO,KAAK,KAAK,EAAE,iBAAiB;AACzD;AAOM,SAAU,cAAc,OAAc;AAC1C,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,WAAO,MAAM,WAAW,KAAK,OAAO,MAAM,CAAC,MAAM;EACnD;AACA,SAAO;AACT;AAOM,SAAU,eAAe,OAAc;AAC3C,SAAO,aAAa,KAAK,KAAK,cAAc,KAAK;AACnD;;;AC5BM,SAAU,eAAe,OAAc;AAC3C,SAAO,kBAAkB,KAAK,MAAM;AACtC;AASO,IAAM,gCACX,WAAW;AASP,SAAU,6BAA0B;AACxC,SAAO,iCAAiC;AAC1C;AASM,SAAU,0BAA0B,OAAc;AACtD,SAAO,QAAQ,iCAAiC,UAAU,6BAA6B;AACzF;",
5
+ "names": []
6
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./types/index.js";
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,iCAA8B"}
package/dist/types.js ADDED
@@ -0,0 +1,5 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ export * from "./types/index.js";
5
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,iCAA8B"}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
- "version": "5.0.0-alpha.17",
9
+ "version": "5.0.0-alpha.19",
10
10
  "keywords": [
11
11
  "webgl",
12
12
  "javascript",
@@ -75,6 +75,16 @@
75
75
  "types": "./dist/spheroid.d.ts",
76
76
  "import": "./dist/spheroid.js",
77
77
  "require": "./dist/spheroid.cjs"
78
+ },
79
+ "./types": {
80
+ "types": "./dist/types.d.ts",
81
+ "import": "./dist/types.js",
82
+ "require": "./dist/types.cjs"
83
+ },
84
+ "./expressions": {
85
+ "types": "./dist/expressions/index.d.ts",
86
+ "import": "./dist/expressions/index.js",
87
+ "require": "./dist/expressions/index.cjs"
78
88
  }
79
89
  },
80
90
  "files": [
@@ -85,8 +95,5 @@
85
95
  "sideEffects": [
86
96
  "./src/lib/common.js"
87
97
  ],
88
- "dependencies": {
89
- "@math.gl/types": "5.0.0-alpha.17"
90
- },
91
- "gitHead": "e8a0013a8e4b09aac7ad1257e49a459911cee549"
98
+ "gitHead": "f5700027934faf25c37230905c7ffa14d7f677a7"
92
99
  }
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
 
5
- import {NumericArray} from '@math.gl/types';
5
+ import {NumericArray} from '../../types';
6
6
  import {ConfigurationOptions, config, formatValue, equals, isArray} from '../../lib/common';
7
7
 
8
8
  /** Base class for vectors and matrices */
@@ -3,7 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
  // SPDX-FileCopyrightText: Copyright (c) 2017 Uber Technologies, Inc.
5
5
 
6
- import {NumericArray} from '@math.gl/types';
6
+ import {NumericArray} from '../../types';
7
7
  import {MathArray} from './math-array';
8
8
  import {checkNumber} from '../../lib/validators';
9
9
  import {config} from '../../lib/common';
@@ -3,7 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
  // SPDX-FileCopyrightText: Copyright (c) 2017 Uber Technologies, Inc.
5
5
 
6
- import {NumericArray} from '@math.gl/types';
6
+ import {NumericArray} from '../../types';
7
7
  import {MathArray} from './math-array';
8
8
  import {checkNumber} from '../../lib/validators';
9
9
  import {assert} from '../../lib/assert';
@@ -4,7 +4,7 @@
4
4
  // SPDX-FileCopyrightText: Copyright (c) 2017 Uber Technologies, Inc.
5
5
 
6
6
  import {MathArray} from './base/math-array';
7
- import {NumericArray} from '@math.gl/types';
7
+ import {NumericArray} from '../types';
8
8
  import type {EulerRotationOrder} from './euler-types';
9
9
 
10
10
  import {clamp} from '../lib/common';
@@ -3,7 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
  // SPDX-FileCopyrightText: Copyright (c) 2017 Uber Technologies, Inc.
5
5
 
6
- import {NumericArray, NumericArray9} from '@math.gl/types';
6
+ import {NumericArray, NumericArray9} from '../types';
7
7
  import {Matrix} from './base/matrix';
8
8
  import {checkVector} from '../lib/validators';
9
9
 
@@ -3,7 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
  // SPDX-FileCopyrightText: Copyright (c) 2017 Uber Technologies, Inc.
5
5
 
6
- import {NumericArray, NumericArray16} from '@math.gl/types';
6
+ import {NumericArray, NumericArray16} from '../types';
7
7
  import {Matrix} from './base/matrix';
8
8
  import type {Matrix3Like} from './matrix3';
9
9
  import {checkVector} from '../lib/validators';
@@ -6,7 +6,7 @@
6
6
  import {Matrix4} from './matrix4';
7
7
  import {Vector3} from './vector3';
8
8
  import {Euler} from './euler';
9
- import {NumericArray} from '@math.gl/types';
9
+ import {NumericArray} from '../types';
10
10
 
11
11
  type PoseOptions = {
12
12
  position?: Readonly<NumericArray>;
@@ -3,7 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
  // SPDX-FileCopyrightText: Copyright (c) 2017 Uber Technologies, Inc.
5
5
 
6
- import {NumericArray} from '@math.gl/types';
6
+ import {NumericArray} from '../types';
7
7
  import {MathArray} from './base/math-array';
8
8
  import {checkNumber} from '../lib/validators';
9
9
  import type {EulerLike} from './euler-types';
@@ -3,7 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
  // SPDX-FileCopyrightText: Copyright (c) 2017 Uber Technologies, Inc.
5
5
 
6
- import {NumericArray, NumericArray2} from '@math.gl/types';
6
+ import {NumericArray, NumericArray2} from '../types';
7
7
 
8
8
  import {Vector} from './base/vector';
9
9
  import {config, isArray} from '../lib/common';
@@ -3,7 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
  // SPDX-FileCopyrightText: Copyright (c) 2017 Uber Technologies, Inc.
5
5
 
6
- import {NumericArray, NumericArray3} from '@math.gl/types';
6
+ import {NumericArray, NumericArray3} from '../types';
7
7
  import {Vector} from './base/vector';
8
8
  import {config, isArray} from '../lib/common';
9
9
  import {checkNumber} from '../lib/validators';
@@ -3,7 +3,7 @@
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
  // SPDX-FileCopyrightText: Copyright (c) 2017 Uber Technologies, Inc.
5
5
 
6
- import {NumericArray, NumericArray4} from '@math.gl/types';
6
+ import {NumericArray, NumericArray4} from '../types';
7
7
  /* eslint-disable camelcase */
8
8
  import {
9
9
  transformMat4 as vec4_transformMat4,