@loaders.gl/schema 5.0.0-alpha.1 → 5.0.0-alpha.11

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 (44) hide show
  1. package/LICENSE +14 -3
  2. package/dist/categories/category-mesh.d.ts +31 -5
  3. package/dist/categories/category-mesh.d.ts.map +1 -1
  4. package/dist/categories/category-mesh.js +1 -1
  5. package/dist/categories/category-mesh.js.map +1 -1
  6. package/dist/deprecated/mesh-utils.d.ts +5 -18
  7. package/dist/deprecated/mesh-utils.d.ts.map +1 -1
  8. package/dist/deprecated/mesh-utils.js +13 -25
  9. package/dist/deprecated/mesh-utils.js.map +1 -1
  10. package/dist/dist.dev.js +1246 -227
  11. package/dist/dist.min.js +3 -3
  12. package/dist/float16.d.ts +19 -0
  13. package/dist/float16.d.ts.map +1 -0
  14. package/dist/float16.js +90 -0
  15. package/dist/float16.js.map +1 -0
  16. package/dist/geometry/geoarrow.d.ts +69 -0
  17. package/dist/geometry/geoarrow.d.ts.map +1 -0
  18. package/dist/geometry/geoarrow.js +5 -0
  19. package/dist/geometry/geoarrow.js.map +1 -0
  20. package/dist/index.cjs +162 -21
  21. package/dist/index.cjs.map +2 -3
  22. package/dist/index.d.ts +7 -2
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +4 -3
  25. package/dist/index.js.map +1 -1
  26. package/dist/metadata.d.ts +40 -0
  27. package/dist/metadata.d.ts.map +1 -0
  28. package/dist/metadata.js +86 -0
  29. package/dist/metadata.js.map +1 -0
  30. package/dist/types/schema.d.ts +4 -1
  31. package/dist/types/schema.d.ts.map +1 -1
  32. package/dist/types/types.d.ts +3 -2
  33. package/dist/types/types.d.ts.map +1 -1
  34. package/dist/types/types.js +1 -0
  35. package/dist/types/types.js.map +1 -1
  36. package/package.json +3 -2
  37. package/src/categories/category-mesh.ts +45 -6
  38. package/src/deprecated/mesh-utils.ts +15 -35
  39. package/src/float16.ts +111 -0
  40. package/src/geometry/geoarrow.ts +116 -0
  41. package/src/index.ts +43 -8
  42. package/src/metadata.ts +115 -0
  43. package/src/types/schema.ts +3 -0
  44. package/src/types/types.ts +7 -0
@@ -1,38 +1,17 @@
1
- // Mesh category utilities
2
- // TODO - move to mesh category module, or to math.gl/geometry module
3
- import {MeshAttributes} from '../categories/category-mesh';
4
- import {TypedArray} from '../types/types';
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
5
4
 
6
- type TypedArrays = {[key: string]: TypedArray};
5
+ import {MeshAttributes} from '../categories/category-mesh';
7
6
 
8
- /**
9
- * Holds an axis aligned bounding box
10
- * TODO - make sure AxisAlignedBoundingBox in math.gl/culling understands this format (or change this format)
11
- */
12
7
  type BoundingBox = [[number, number, number], [number, number, number]];
13
8
 
14
9
  /**
15
- * Get number of vertices in mesh
16
- * @param attributes
17
- * @deprecated Import from shema-utils
18
- */
19
- export function getMeshSize(attributes: TypedArrays): number {
20
- let size = 0;
21
- for (const attributeName in attributes) {
22
- const attribute = attributes[attributeName];
23
- if (ArrayBuffer.isView(attribute)) {
24
- // @ts-ignore DataView doesn't have BYTES_PER_ELEMENT
25
- size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;
26
- }
27
- }
28
- return size;
29
- }
30
-
31
- /**
32
- * Get the (axis aligned) bounding box of a mesh
33
- * @param attributes
34
- * @returns array of two vectors representing the axis aligned bounding box
35
- * @deprecated Import from shema-utils
10
+ * Get the (axis aligned) bounding box of a mesh.
11
+ * @param attributes Mesh attributes.
12
+ * @returns The axis aligned bounding box as minimum and maximum vectors.
13
+ * @deprecated Import `getMeshBoundingBox` from `@loaders.gl/schema-utils` instead. This root
14
+ * export remains temporarily for deck.gl 9.4 compatibility.
36
15
  */
37
16
  // eslint-disable-next-line complexity
38
17
  export function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox {
@@ -44,12 +23,12 @@ export function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox {
44
23
  let maxZ = -Infinity;
45
24
 
46
25
  const positions = attributes.POSITION ? attributes.POSITION.value : [];
47
- const len = positions && positions.length;
26
+ const length = positions && positions.length;
48
27
 
49
- for (let i = 0; i < len; i += 3) {
50
- const x = positions[i];
51
- const y = positions[i + 1];
52
- const z = positions[i + 2];
28
+ for (let index = 0; index < length; index += 3) {
29
+ const x = positions[index];
30
+ const y = positions[index + 1];
31
+ const z = positions[index + 2];
53
32
 
54
33
  minX = x < minX ? x : minX;
55
34
  minY = y < minY ? y : minY;
@@ -59,6 +38,7 @@ export function getMeshBoundingBox(attributes: MeshAttributes): BoundingBox {
59
38
  maxY = y > maxY ? y : maxY;
60
39
  maxZ = z > maxZ ? z : maxZ;
61
40
  }
41
+
62
42
  return [
63
43
  [minX, minY, minZ],
64
44
  [maxX, maxY, maxZ]
package/src/float16.ts ADDED
@@ -0,0 +1,111 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import {getFloat16ArrayConstructor, NativeFloat16ArrayConstructor} from '@math.gl/types';
6
+
7
+ /** Array storage used for logical Float16 values. */
8
+ export type Float16ArrayStorage = Float16Array | Uint16Array;
9
+
10
+ /** Create native Float16 storage when the runtime supports it. */
11
+ export function createFloat16Array(length: number): Float16ArrayStorage {
12
+ const ArrayConstructor = getFloat16ArrayConstructor();
13
+ return new ArrayConstructor(length) as Float16ArrayStorage;
14
+ }
15
+
16
+ /** Check whether an array is backed by the native Float16Array implementation. */
17
+ export function isNativeFloat16Array(value: unknown): value is Float16Array {
18
+ return Boolean(NativeFloat16ArrayConstructor && value instanceof NativeFloat16ArrayConstructor);
19
+ }
20
+
21
+ /** Write a numeric value into native or binary16 fallback storage. */
22
+ export function setFloat16Value(array: Float16ArrayStorage, index: number, value: number): void {
23
+ if (isNativeFloat16Array(array)) {
24
+ array[index] = value;
25
+ } else {
26
+ array[index] = encodeFloat16(value);
27
+ }
28
+ }
29
+
30
+ /** Read a numeric value from native or binary16 fallback storage. */
31
+ export function getFloat16Value(array: Float16ArrayStorage, index: number): number {
32
+ if (isNativeFloat16Array(array)) {
33
+ return array[index];
34
+ }
35
+ return decodeFloat16(array[index]);
36
+ }
37
+
38
+ /** Return the binary16 words used by Apache Arrow and GPU APIs. */
39
+ export function getFloat16Storage(array: Float16ArrayStorage): Uint16Array {
40
+ return isNativeFloat16Array(array)
41
+ ? new Uint16Array(array.buffer, array.byteOffset, array.length)
42
+ : array;
43
+ }
44
+
45
+ /** Convert byte- or word-scaled color components to logical Float16 values. */
46
+ export function convertColorArrayToFloat16(
47
+ values: ArrayLike<number>,
48
+ sourceScale: number
49
+ ): Float16ArrayStorage {
50
+ const result = createFloat16Array(values.length);
51
+ for (let index = 0; index < values.length; index++) {
52
+ setFloat16Value(result, index, values[index] / sourceScale);
53
+ }
54
+ return result;
55
+ }
56
+
57
+ /** Convert byte- or word-scaled color components to logical Float32 values. */
58
+ export function convertColorArrayToFloat32(
59
+ values: ArrayLike<number>,
60
+ sourceScale: number
61
+ ): Float32Array {
62
+ return Float32Array.from(values, value => value / sourceScale);
63
+ }
64
+
65
+ /** Encode a JavaScript number as an IEEE-754 binary16 bit pattern. */
66
+ export function encodeFloat16(value: number): number {
67
+ if (!Number.isFinite(value)) {
68
+ return value === Infinity ? 0x7c00 : value === -Infinity ? 0xfc00 : 0x7e00;
69
+ }
70
+
71
+ const sign = value < 0 || Object.is(value, -0) ? 0x8000 : 0;
72
+ const absoluteValue = Math.abs(value);
73
+ if (absoluteValue === 0) {
74
+ return sign;
75
+ }
76
+
77
+ // Values at or above the midpoint between the largest finite half and
78
+ // infinity round to infinity using IEEE-754 round-to-nearest-even.
79
+ if (absoluteValue >= 65520) {
80
+ return sign | 0x7c00;
81
+ }
82
+ if (absoluteValue >= 65504) {
83
+ return sign | 0x7bff;
84
+ }
85
+
86
+ const exponent = Math.floor(Math.log2(absoluteValue));
87
+ if (exponent < -14) {
88
+ return sign | Math.round(absoluteValue / 2 ** -24);
89
+ }
90
+
91
+ const normalizedExponent = exponent + 15;
92
+ const mantissa = Math.round((absoluteValue / 2 ** exponent - 1) * 1024);
93
+ if (mantissa === 1024) {
94
+ return sign | ((normalizedExponent + 1) << 10);
95
+ }
96
+ return sign | (normalizedExponent << 10) | mantissa;
97
+ }
98
+
99
+ /** Decode an IEEE-754 binary16 bit pattern. */
100
+ function decodeFloat16(value: number): number {
101
+ const sign = value & 0x8000 ? -1 : 1;
102
+ const exponent = (value >> 10) & 0x1f;
103
+ const mantissa = value & 0x3ff;
104
+ if (exponent === 0) {
105
+ return sign * mantissa * 2 ** -24;
106
+ }
107
+ if (exponent === 0x1f) {
108
+ return mantissa ? NaN : sign * Infinity;
109
+ }
110
+ return sign * (1 + mantissa / 1024) * 2 ** (exponent - 15);
111
+ }
@@ -0,0 +1,116 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ /** Canonical GeoArrow extension names. */
6
+ export type GeoArrowEncoding =
7
+ | 'geoarrow.geometry'
8
+ | 'geoarrow.geometrycollection'
9
+ | 'geoarrow.multipolygon'
10
+ | 'geoarrow.polygon'
11
+ | 'geoarrow.multilinestring'
12
+ | 'geoarrow.linestring'
13
+ | 'geoarrow.multipoint'
14
+ | 'geoarrow.point'
15
+ | 'geoarrow.box'
16
+ | 'geoarrow.wkb'
17
+ | 'geoarrow.wkt';
18
+
19
+ /** Preferred output policy for loader-facing GeoArrow conversions. */
20
+ export type GeoArrowEncodingPreference = 'geoarrow.wkb' | 'geoarrow.geometry' | 'optimized';
21
+
22
+ /** Coordinate dimensions understood by GeoArrow and GeoParquet. */
23
+ export type GeoArrowDimension = 'xy' | 'xyz' | 'xym' | 'xyzm';
24
+
25
+ /** Coordinate memory layouts understood by GeoArrow. */
26
+ export type GeoArrowCoordinateLayout = 'interleaved' | 'separated';
27
+
28
+ /** Offset widths supported by variable-length GeoArrow arrays. */
29
+ export type GeoArrowOffsetType = 'int32' | 'int64';
30
+
31
+ /** One axis-aligned GeoArrow Box value in canonical child order. */
32
+ export type GeoArrowBox = {
33
+ xmin: number;
34
+ ymin: number;
35
+ xmax: number;
36
+ ymax: number;
37
+ zmin?: number;
38
+ zmax?: number;
39
+ mmin?: number;
40
+ mmax?: number;
41
+ };
42
+
43
+ /** Non-planar edge interpretations used by geospatial metadata. */
44
+ export type GeoArrowEdgeType = 'spherical' | 'vincenty' | 'thomas' | 'andoyer' | 'karney';
45
+
46
+ /** Geometry type names used by GeoParquet metadata. */
47
+ export type GeoParquetGeometryType =
48
+ | 'Point'
49
+ | 'LineString'
50
+ | 'Polygon'
51
+ | 'MultiPoint'
52
+ | 'MultiLineString'
53
+ | 'MultiPolygon'
54
+ | 'GeometryCollection'
55
+ | 'Point Z'
56
+ | 'LineString Z'
57
+ | 'Polygon Z'
58
+ | 'MultiPoint Z'
59
+ | 'MultiLineString Z'
60
+ | 'MultiPolygon Z'
61
+ | 'GeometryCollection Z'
62
+ | 'Point M'
63
+ | 'LineString M'
64
+ | 'Polygon M'
65
+ | 'MultiPoint M'
66
+ | 'MultiLineString M'
67
+ | 'MultiPolygon M'
68
+ | 'GeometryCollection M'
69
+ | 'Point ZM'
70
+ | 'LineString ZM'
71
+ | 'Polygon ZM'
72
+ | 'MultiPoint ZM'
73
+ | 'MultiLineString ZM'
74
+ | 'MultiPolygon ZM'
75
+ | 'GeometryCollection ZM';
76
+
77
+ /** JSON-compatible CRS value accepted by GeoArrow extension metadata. */
78
+ export type GeoArrowCRSValue = Record<string, unknown> | string;
79
+
80
+ /** CRS representation tag used by GeoArrow extension metadata. */
81
+ export type GeoArrowCRSType = 'projjson' | 'wkt2:2019' | 'authority_code' | 'srid';
82
+
83
+ /** CRS metadata attached to a GeoArrow field. */
84
+ export type GeoArrowCRSMetadata =
85
+ | {crs?: undefined; crs_type?: undefined}
86
+ | {crs: Record<string, unknown>; crs_type?: 'projjson'}
87
+ | {crs: string; crs_type: 'wkt2:2019' | 'authority_code' | 'srid'}
88
+ | {crs: string; crs_type?: undefined};
89
+
90
+ /** Metadata attached to a GeoArrow extension field. */
91
+ export type GeoArrowMetadata = GeoArrowCRSMetadata & {
92
+ encoding?: GeoArrowEncoding;
93
+ edges?: GeoArrowEdgeType;
94
+ geometry_types?: GeoParquetGeometryType[];
95
+ [key: string]: unknown;
96
+ };
97
+
98
+ /** Metadata for one geometry column in a GeoParquet file. */
99
+ export type GeoColumnMetadata = {
100
+ encoding: string;
101
+ geometry_types: GeoParquetGeometryType[];
102
+ crs?: Record<string, unknown> | null;
103
+ orientation?: 'counterclockwise';
104
+ bbox?: number[];
105
+ edges?: 'planar' | GeoArrowEdgeType;
106
+ epoch?: number;
107
+ [key: string]: unknown;
108
+ };
109
+
110
+ /** File-level GeoParquet metadata stored under the `geo` key. */
111
+ export type GeoMetadata = {
112
+ version?: string;
113
+ primary_column?: string;
114
+ columns: Record<string, GeoColumnMetadata>;
115
+ [key: string]: unknown;
116
+ };
package/src/index.ts CHANGED
@@ -12,11 +12,47 @@ export type {
12
12
  ArrayType,
13
13
  AnyArray
14
14
  } from './types/types';
15
+ export {
16
+ createFloat16Array,
17
+ convertColorArrayToFloat16,
18
+ convertColorArrayToFloat32,
19
+ encodeFloat16,
20
+ getFloat16Storage,
21
+ getFloat16Value,
22
+ isNativeFloat16Array,
23
+ setFloat16Value
24
+ } from './float16';
15
25
 
16
26
  // SCHEMAS AND DATA TYPES
17
27
 
18
28
  export type {Schema, Field, DataType, KeyType, SchemaMetadata, FieldMetadata} from './types/schema';
29
+ export type {Metadata, SchemaWithMetadata} from './metadata';
30
+ export {
31
+ getGeoMetadata,
32
+ getMetadataValue,
33
+ parseJSONStringMetadata,
34
+ setGeoMetadata,
35
+ setMetadataValue,
36
+ unpackGeoMetadata,
37
+ unpackJSONStringMetadata
38
+ } from './metadata';
19
39
  export type {Batch} from './types/batch';
40
+ export type {
41
+ GeoArrowEncoding,
42
+ GeoArrowEncodingPreference,
43
+ GeoArrowDimension,
44
+ GeoArrowCoordinateLayout,
45
+ GeoArrowOffsetType,
46
+ GeoArrowBox,
47
+ GeoArrowEdgeType,
48
+ GeoArrowCRSValue,
49
+ GeoArrowCRSType,
50
+ GeoArrowCRSMetadata,
51
+ GeoArrowMetadata,
52
+ GeoParquetGeometryType,
53
+ GeoColumnMetadata,
54
+ GeoMetadata
55
+ } from './geometry/geoarrow';
20
56
 
21
57
  // TABLE CATEGORY TYPES
22
58
  export type {
@@ -49,10 +85,15 @@ export type {
49
85
  Mesh,
50
86
  MeshGeometry,
51
87
  MeshAttribute,
52
- MeshAttributes
88
+ MeshAttributeOctahedronTransform,
89
+ MeshAttributeQuantizationTransform,
90
+ MeshAttributeTransform,
91
+ MeshAttributes,
92
+ MeshTopology
53
93
  } from './categories/category-mesh';
54
94
  export {meshArrowSchema, indexedMeshArrowSchema} from './categories/category-mesh';
55
-
95
+ /** @deprecated Import `getMeshBoundingBox` from `@loaders.gl/schema-utils`. */
96
+ export {getMeshBoundingBox} from './deprecated/mesh-utils';
56
97
  // TEXTURES
57
98
  export type {
58
99
  TextureMetadata,
@@ -126,9 +167,3 @@ export type {
126
167
  ArrowBinaryFeatureCollection,
127
168
  BinaryFeatureCollectionLike
128
169
  } from './categories/category-gis';
129
-
130
- // DEPRECATED EXPORTS
131
-
132
- // MESH CATEGORY
133
-
134
- export {getMeshSize, getMeshBoundingBox} from './deprecated/mesh-utils';
@@ -0,0 +1,115 @@
1
+ // loaders.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+
5
+ import type {GeoMetadata} from './geometry/geoarrow';
6
+
7
+ /** Metadata container compatible with Apache Arrow metadata maps and plain objects. */
8
+ export type Metadata = Map<string, string> | Record<string, string>;
9
+
10
+ /** Arrow-like schema shape that exposes schema and field metadata. */
11
+ export type SchemaWithMetadata = {
12
+ /** Schema-level metadata. */
13
+ metadata?: Metadata;
14
+ /** Top-level fields with optional metadata. */
15
+ fields?: {name: string; metadata?: Metadata}[];
16
+ };
17
+
18
+ /**
19
+ * Reads one metadata value from an Arrow-like metadata container.
20
+ *
21
+ * @param metadata Metadata map or object.
22
+ * @param key Metadata key.
23
+ * @returns Stored value or `null` when absent.
24
+ */
25
+ export function getMetadataValue(metadata: Metadata, key: string): string | null {
26
+ return metadata instanceof Map ? metadata.get(key) || null : metadata[key] || null;
27
+ }
28
+
29
+ /**
30
+ * Writes one metadata value to an Arrow-like metadata container.
31
+ *
32
+ * @param metadata Metadata map or object.
33
+ * @param key Metadata key.
34
+ * @param value Metadata value.
35
+ */
36
+ export function setMetadataValue(metadata: Metadata, key: string, value: string): void {
37
+ if (metadata instanceof Map) {
38
+ metadata.set(key, value);
39
+ } else {
40
+ metadata[key] = value;
41
+ }
42
+ }
43
+
44
+ /** Reads GeoParquet metadata from a schema metadata container. */
45
+ export function getGeoMetadata(metadata: Metadata | undefined): GeoMetadata | null {
46
+ if (!metadata) {
47
+ return null;
48
+ }
49
+
50
+ const stringifiedGeoMetadata = getMetadataValue(metadata, 'geo');
51
+ const geoMetadata = stringifiedGeoMetadata && parseJSONStringMetadata(stringifiedGeoMetadata);
52
+ if (!geoMetadata) {
53
+ return null;
54
+ }
55
+
56
+ for (const column of Object.values(geoMetadata.columns || {})) {
57
+ if (column && typeof column === 'object' && typeof column.encoding === 'string') {
58
+ column.encoding = column.encoding.toLowerCase();
59
+ }
60
+ }
61
+
62
+ return geoMetadata as GeoMetadata;
63
+ }
64
+
65
+ /** Stores GeoParquet metadata under the top-level `geo` key. */
66
+ export function setGeoMetadata(metadata: Metadata, geoMetadata: GeoMetadata): void {
67
+ setMetadataValue(metadata, 'geo', JSON.stringify(geoMetadata));
68
+ }
69
+
70
+ /** Unpacks top-level GeoParquet metadata into flattened metadata entries. */
71
+ export function unpackGeoMetadata(metadata: Metadata): void {
72
+ const geoMetadata = getGeoMetadata(metadata);
73
+ if (!geoMetadata) {
74
+ return;
75
+ }
76
+
77
+ const {version, primary_column: primaryColumn, columns} = geoMetadata;
78
+ if (version) {
79
+ setMetadataValue(metadata, 'geo.version', version);
80
+ }
81
+ if (primaryColumn) {
82
+ setMetadataValue(metadata, 'geo.primary_column', primaryColumn);
83
+ }
84
+ setMetadataValue(metadata, 'geo.columns', Object.keys(columns || {}).join(','));
85
+ }
86
+
87
+ /** Unpacks one JSON metadata value into flattened metadata entries. */
88
+ export function unpackJSONStringMetadata(metadata: Metadata, metadataKey: string): void {
89
+ const stringifiedMetadata = getMetadataValue(metadata, metadataKey);
90
+ const json = stringifiedMetadata && parseJSONStringMetadata(stringifiedMetadata);
91
+
92
+ for (const [key, value] of Object.entries(json || {})) {
93
+ setMetadataValue(
94
+ metadata,
95
+ `${metadataKey}.${key}`,
96
+ typeof value === 'string' ? value : JSON.stringify(value)
97
+ );
98
+ }
99
+ }
100
+
101
+ /** Parses one JSON metadata value into an object. */
102
+ export function parseJSONStringMetadata(
103
+ stringifiedMetadata: string
104
+ ): Record<string, unknown> | null {
105
+ if (!stringifiedMetadata) {
106
+ return null;
107
+ }
108
+
109
+ try {
110
+ const metadata = JSON.parse(stringifiedMetadata);
111
+ return metadata && typeof metadata === 'object' ? metadata : null;
112
+ } catch {
113
+ return null;
114
+ }
115
+ }
@@ -24,7 +24,9 @@ export type DataType =
24
24
  | 'float32'
25
25
  | 'float64'
26
26
  | 'binary'
27
+ | 'binary-view'
27
28
  | 'utf8'
29
+ | 'utf8-view'
28
30
  | 'date-day'
29
31
  | 'date-millisecond'
30
32
  | 'time-second'
@@ -40,6 +42,7 @@ export type DataType =
40
42
  // Composite types
41
43
  | {type: 'decimal'; bitWidth: number; precision: number; scale: number}
42
44
  | {type: 'list'; children: Field[]} // one child only
45
+ | {type: 'large-list'; children: Field[]} // one child only, with 64-bit offsets
43
46
  | {type: 'struct'; children: Field[]}
44
47
  | {
45
48
  type: 'sparse-union';
@@ -2,6 +2,11 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
+ // Float16Array is declared in a separate TypeScript library. Preserve this reference so
6
+ // published declarations remain self-contained without changing the target or emitting runtime code.
7
+ // eslint-disable-next-line spaced-comment
8
+ /// <reference lib="es2025.float16" preserve="true" />
9
+
5
10
  /** Any typed array */
6
11
  export type TypedArray =
7
12
  | Int8Array
@@ -11,6 +16,7 @@ export type TypedArray =
11
16
  | Int32Array
12
17
  | Uint32Array
13
18
  | Uint8ClampedArray
19
+ | Float16Array
14
20
  | Float32Array
15
21
  | Float64Array;
16
22
 
@@ -23,6 +29,7 @@ export type TypedArrayConstructor =
23
29
  | Uint16ArrayConstructor
24
30
  | Int32ArrayConstructor
25
31
  | Uint32ArrayConstructor
32
+ | Float16ArrayConstructor
26
33
  | Float32ArrayConstructor
27
34
  | Float64ArrayConstructor;
28
35