@loaders.gl/schema 4.3.2 → 4.4.0-alpha.2

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 (163) hide show
  1. package/dist/categories/category-gis.d.ts +6 -0
  2. package/dist/categories/category-gis.d.ts.map +1 -0
  3. package/dist/categories/category-image.d.ts.map +1 -0
  4. package/dist/{types → categories}/category-mesh.d.ts +2 -2
  5. package/dist/categories/category-mesh.d.ts.map +1 -0
  6. package/dist/{types → categories}/category-table.d.ts +14 -14
  7. package/dist/categories/category-table.d.ts.map +1 -0
  8. package/dist/categories/category-texture.d.ts.map +1 -0
  9. package/dist/{lib/mesh → deprecated}/mesh-utils.d.ts +4 -2
  10. package/dist/deprecated/mesh-utils.d.ts.map +1 -0
  11. package/dist/{lib/mesh → deprecated}/mesh-utils.js +2 -0
  12. package/dist/dist.dev.js +0 -1836
  13. package/dist/dist.min.js +1 -1
  14. package/dist/geometry/binary-features.d.ts +30 -0
  15. package/dist/geometry/binary-features.d.ts.map +1 -0
  16. package/dist/geometry/binary-geometries.d.ts +33 -0
  17. package/dist/geometry/binary-geometries.d.ts.map +1 -0
  18. package/dist/geometry/flat-geometries.d.ts +61 -0
  19. package/dist/geometry/flat-geometries.d.ts.map +1 -0
  20. package/dist/index.cjs +2 -1792
  21. package/dist/index.cjs.map +4 -4
  22. package/dist/index.d.ts +10 -28
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +3 -23
  25. package/dist/types/batch.d.ts +3 -1
  26. package/dist/types/batch.d.ts.map +1 -1
  27. package/package.json +5 -4
  28. package/src/{types → categories}/category-gis.ts +7 -18
  29. package/src/{types → categories}/category-mesh.ts +2 -2
  30. package/src/{types → categories}/category-table.ts +14 -17
  31. package/src/{lib/mesh → deprecated}/mesh-utils.ts +4 -2
  32. package/src/geometry/binary-features.ts +43 -0
  33. package/src/geometry/binary-geometries.ts +45 -0
  34. package/src/{types → geometry}/flat-geometries.ts +44 -14
  35. package/src/index.ts +15 -101
  36. package/src/types/batch.ts +3 -1
  37. package/dist/lib/mesh/convert-mesh.d.ts +0 -15
  38. package/dist/lib/mesh/convert-mesh.d.ts.map +0 -1
  39. package/dist/lib/mesh/convert-mesh.js +0 -37
  40. package/dist/lib/mesh/deduce-mesh-schema.d.ts +0 -24
  41. package/dist/lib/mesh/deduce-mesh-schema.d.ts.map +0 -1
  42. package/dist/lib/mesh/deduce-mesh-schema.js +0 -62
  43. package/dist/lib/mesh/mesh-to-arrow-table.d.ts +0 -1
  44. package/dist/lib/mesh/mesh-to-arrow-table.d.ts.map +0 -1
  45. package/dist/lib/mesh/mesh-to-arrow-table.js +0 -47
  46. package/dist/lib/mesh/mesh-utils.d.ts.map +0 -1
  47. package/dist/lib/table/arrow-api/arrow-like-field.d.ts +0 -19
  48. package/dist/lib/table/arrow-api/arrow-like-field.d.ts.map +0 -1
  49. package/dist/lib/table/arrow-api/arrow-like-field.js +0 -36
  50. package/dist/lib/table/arrow-api/arrow-like-interface.d.ts +0 -43
  51. package/dist/lib/table/arrow-api/arrow-like-interface.d.ts.map +0 -1
  52. package/dist/lib/table/arrow-api/arrow-like-schema.d.ts +0 -12
  53. package/dist/lib/table/arrow-api/arrow-like-schema.d.ts.map +0 -1
  54. package/dist/lib/table/arrow-api/arrow-like-schema.js +0 -81
  55. package/dist/lib/table/arrow-api/arrow-like-table.d.ts +0 -24
  56. package/dist/lib/table/arrow-api/arrow-like-table.d.ts.map +0 -1
  57. package/dist/lib/table/arrow-api/arrow-like-table.js +0 -63
  58. package/dist/lib/table/arrow-api/arrow-like-type.d.ts +0 -177
  59. package/dist/lib/table/arrow-api/arrow-like-type.d.ts.map +0 -1
  60. package/dist/lib/table/arrow-api/arrow-like-type.js +0 -442
  61. package/dist/lib/table/arrow-api/enum.d.ts +0 -92
  62. package/dist/lib/table/arrow-api/enum.d.ts.map +0 -1
  63. package/dist/lib/table/arrow-api/enum.js +0 -97
  64. package/dist/lib/table/arrow-api/get-type-info.d.ts +0 -13
  65. package/dist/lib/table/arrow-api/get-type-info.d.ts.map +0 -1
  66. package/dist/lib/table/arrow-api/get-type-info.js +0 -27
  67. package/dist/lib/table/arrow-api/index.d.ts +0 -5
  68. package/dist/lib/table/arrow-api/index.d.ts.map +0 -1
  69. package/dist/lib/table/arrow-api/index.js +0 -7
  70. package/dist/lib/table/batches/base-table-batch-aggregator.d.ts +0 -20
  71. package/dist/lib/table/batches/base-table-batch-aggregator.d.ts.map +0 -1
  72. package/dist/lib/table/batches/base-table-batch-aggregator.js +0 -63
  73. package/dist/lib/table/batches/columnar-table-batch-aggregator.d.ts +0 -23
  74. package/dist/lib/table/batches/columnar-table-batch-aggregator.d.ts.map +0 -1
  75. package/dist/lib/table/batches/columnar-table-batch-aggregator.js +0 -91
  76. package/dist/lib/table/batches/row-table-batch-aggregator.d.ts +0 -22
  77. package/dist/lib/table/batches/row-table-batch-aggregator.d.ts.map +0 -1
  78. package/dist/lib/table/batches/row-table-batch-aggregator.js +0 -85
  79. package/dist/lib/table/batches/table-batch-aggregator.d.ts +0 -25
  80. package/dist/lib/table/batches/table-batch-aggregator.d.ts.map +0 -1
  81. package/dist/lib/table/batches/table-batch-aggregator.js +0 -4
  82. package/dist/lib/table/batches/table-batch-builder.d.ts +0 -53
  83. package/dist/lib/table/batches/table-batch-builder.d.ts.map +0 -1
  84. package/dist/lib/table/batches/table-batch-builder.js +0 -151
  85. package/dist/lib/table/simple-table/convert-table.d.ts +0 -43
  86. package/dist/lib/table/simple-table/convert-table.d.ts.map +0 -1
  87. package/dist/lib/table/simple-table/convert-table.js +0 -118
  88. package/dist/lib/table/simple-table/data-type.d.ts +0 -17
  89. package/dist/lib/table/simple-table/data-type.d.ts.map +0 -1
  90. package/dist/lib/table/simple-table/data-type.js +0 -88
  91. package/dist/lib/table/simple-table/make-table-from-batches.d.ts +0 -22
  92. package/dist/lib/table/simple-table/make-table-from-batches.d.ts.map +0 -1
  93. package/dist/lib/table/simple-table/make-table-from-batches.js +0 -79
  94. package/dist/lib/table/simple-table/make-table.d.ts +0 -65
  95. package/dist/lib/table/simple-table/make-table.d.ts.map +0 -1
  96. package/dist/lib/table/simple-table/make-table.js +0 -94
  97. package/dist/lib/table/simple-table/row-utils.d.ts +0 -15
  98. package/dist/lib/table/simple-table/row-utils.d.ts.map +0 -1
  99. package/dist/lib/table/simple-table/row-utils.js +0 -49
  100. package/dist/lib/table/simple-table/table-accessors.d.ts +0 -68
  101. package/dist/lib/table/simple-table/table-accessors.d.ts.map +0 -1
  102. package/dist/lib/table/simple-table/table-accessors.js +0 -350
  103. package/dist/lib/table/simple-table/table-column.d.ts +0 -7
  104. package/dist/lib/table/simple-table/table-column.d.ts.map +0 -1
  105. package/dist/lib/table/simple-table/table-column.js +0 -39
  106. package/dist/lib/table/simple-table/table-schema.d.ts +0 -15
  107. package/dist/lib/table/simple-table/table-schema.d.ts.map +0 -1
  108. package/dist/lib/table/simple-table/table-schema.js +0 -100
  109. package/dist/lib/utils/assert.d.ts +0 -2
  110. package/dist/lib/utils/assert.d.ts.map +0 -1
  111. package/dist/lib/utils/assert.js +0 -8
  112. package/dist/lib/utils/async-queue.d.ts +0 -18
  113. package/dist/lib/utils/async-queue.d.ts.map +0 -1
  114. package/dist/lib/utils/async-queue.js +0 -90
  115. package/dist/types/binary-geometries.d.ts +0 -57
  116. package/dist/types/binary-geometries.d.ts.map +0 -1
  117. package/dist/types/category-gis.d.ts +0 -18
  118. package/dist/types/category-gis.d.ts.map +0 -1
  119. package/dist/types/category-image.d.ts.map +0 -1
  120. package/dist/types/category-mesh.d.ts.map +0 -1
  121. package/dist/types/category-table.d.ts.map +0 -1
  122. package/dist/types/category-texture.d.ts.map +0 -1
  123. package/dist/types/flat-geometries.d.ts +0 -30
  124. package/dist/types/flat-geometries.d.ts.map +0 -1
  125. package/src/lib/mesh/convert-mesh.ts +0 -51
  126. package/src/lib/mesh/deduce-mesh-schema.ts +0 -76
  127. package/src/lib/mesh/mesh-to-arrow-table.ts +0 -47
  128. package/src/lib/table/arrow-api/arrow-like-field.ts +0 -53
  129. package/src/lib/table/arrow-api/arrow-like-interface.ts +0 -84
  130. package/src/lib/table/arrow-api/arrow-like-schema.ts +0 -101
  131. package/src/lib/table/arrow-api/arrow-like-table.ts +0 -86
  132. package/src/lib/table/arrow-api/arrow-like-type.ts +0 -502
  133. package/src/lib/table/arrow-api/enum.ts +0 -99
  134. package/src/lib/table/arrow-api/get-type-info.ts +0 -38
  135. package/src/lib/table/arrow-api/index.ts +0 -8
  136. package/src/lib/table/batches/base-table-batch-aggregator.ts +0 -83
  137. package/src/lib/table/batches/columnar-table-batch-aggregator.ts +0 -112
  138. package/src/lib/table/batches/row-table-batch-aggregator.ts +0 -109
  139. package/src/lib/table/batches/table-batch-aggregator.ts +0 -29
  140. package/src/lib/table/batches/table-batch-builder.ts +0 -190
  141. package/src/lib/table/simple-table/convert-table.ts +0 -149
  142. package/src/lib/table/simple-table/data-type.ts +0 -104
  143. package/src/lib/table/simple-table/make-table-from-batches.ts +0 -98
  144. package/src/lib/table/simple-table/make-table.ts +0 -111
  145. package/src/lib/table/simple-table/row-utils.ts +0 -59
  146. package/src/lib/table/simple-table/table-accessors.ts +0 -417
  147. package/src/lib/table/simple-table/table-column.ts +0 -49
  148. package/src/lib/table/simple-table/table-schema.ts +0 -121
  149. package/src/lib/utils/assert.ts +0 -8
  150. package/src/lib/utils/async-queue.ts +0 -104
  151. package/src/types/binary-geometries.ts +0 -67
  152. /package/dist/{types → categories}/category-gis.js +0 -0
  153. /package/dist/{types → categories}/category-image.d.ts +0 -0
  154. /package/dist/{types → categories}/category-image.js +0 -0
  155. /package/dist/{types → categories}/category-mesh.js +0 -0
  156. /package/dist/{types → categories}/category-table.js +0 -0
  157. /package/dist/{types → categories}/category-texture.d.ts +0 -0
  158. /package/dist/{types → categories}/category-texture.js +0 -0
  159. /package/dist/{lib/table/arrow-api/arrow-like-interface.js → geometry/binary-features.js} +0 -0
  160. /package/dist/{types → geometry}/binary-geometries.js +0 -0
  161. /package/dist/{types → geometry}/flat-geometries.js +0 -0
  162. /package/src/{types → categories}/category-image.ts +0 -0
  163. /package/src/{types → categories}/category-texture.ts +0 -0
@@ -1,442 +0,0 @@
1
- // loaders.gl
2
- // SPDX-License-Identifier: MIT
3
- // Copyright (c) vis.gl contributors
4
- // This code is adapted from ArrowJS https://github.com/apache/arrow
5
- // under Apache license http://www.apache.org/licenses/LICENSE-2.0
6
- import { Type } from "./enum.js";
7
- export { Type } from "./enum.js";
8
- /** ArrowLike DataType class */
9
- export class DataType {
10
- static isNull(x) {
11
- return x && x.typeId === Type.Null;
12
- }
13
- static isInt(x) {
14
- return x && x.typeId === Type.Int;
15
- }
16
- static isFloat(x) {
17
- return x && x.typeId === Type.Float;
18
- }
19
- static isBinary(x) {
20
- return x && x.typeId === Type.Binary;
21
- }
22
- static isUtf8(x) {
23
- return x && x.typeId === Type.Utf8;
24
- }
25
- static isBool(x) {
26
- return x && x.typeId === Type.Bool;
27
- }
28
- static isDecimal(x) {
29
- return x && x.typeId === Type.Decimal;
30
- }
31
- static isDate(x) {
32
- return x && x.typeId === Type.Date;
33
- }
34
- static isTime(x) {
35
- return x && x.typeId === Type.Time;
36
- }
37
- static isTimestamp(x) {
38
- return x && x.typeId === Type.Timestamp;
39
- }
40
- static isInterval(x) {
41
- return x && x.typeId === Type.Interval;
42
- }
43
- static isList(x) {
44
- return x && x.typeId === Type.List;
45
- }
46
- static isStruct(x) {
47
- return x && x.typeId === Type.Struct;
48
- }
49
- static isUnion(x) {
50
- return x && x.typeId === Type.Union;
51
- }
52
- static isFixedSizeBinary(x) {
53
- return x && x.typeId === Type.FixedSizeBinary;
54
- }
55
- static isFixedSizeList(x) {
56
- return x && x.typeId === Type.FixedSizeList;
57
- }
58
- static isMap(x) {
59
- return x && x.typeId === Type.Map;
60
- }
61
- static isDictionary(x) {
62
- return x && x.typeId === Type.Dictionary;
63
- }
64
- get typeId() {
65
- return Type.NONE;
66
- }
67
- // get ArrayType(): AnyArrayType {
68
- // return Int8Array;
69
- // }
70
- // get ArrayType() { return Array; }
71
- compareTo(other) {
72
- // TODO
73
- return this === other; // comparer.visit(this, other);
74
- }
75
- }
76
- // NULL
77
- export class Null extends DataType {
78
- get typeId() {
79
- return Type.Null;
80
- }
81
- get [Symbol.toStringTag]() {
82
- return 'Null';
83
- }
84
- toString() {
85
- return 'Null';
86
- }
87
- }
88
- // BOOLEANS
89
- export class Bool extends DataType {
90
- get typeId() {
91
- return Type.Bool;
92
- }
93
- // get ArrayType() {
94
- // return Uint8Array;
95
- // }
96
- get [Symbol.toStringTag]() {
97
- return 'Bool';
98
- }
99
- toString() {
100
- return 'Bool';
101
- }
102
- }
103
- // INTS
104
- export class Int extends DataType {
105
- isSigned;
106
- bitWidth;
107
- constructor(isSigned, bitWidth) {
108
- super();
109
- this.isSigned = isSigned;
110
- this.bitWidth = bitWidth;
111
- }
112
- get typeId() {
113
- return Type.Int;
114
- }
115
- // get ArrayType() {
116
- // switch (this.bitWidth) {
117
- // case 8:
118
- // return this.isSigned ? Int8Array : Uint8Array;
119
- // case 16:
120
- // return this.isSigned ? Int16Array : Uint16Array;
121
- // case 32:
122
- // return this.isSigned ? Int32Array : Uint32Array;
123
- // case 64:
124
- // return this.isSigned ? Int32Array : Uint32Array;
125
- // default:
126
- // throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
127
- // }
128
- // }
129
- get [Symbol.toStringTag]() {
130
- return 'Int';
131
- }
132
- toString() {
133
- return `${this.isSigned ? 'I' : 'Ui'}nt${this.bitWidth}`;
134
- }
135
- }
136
- export class Int8 extends Int {
137
- constructor() {
138
- super(true, 8);
139
- }
140
- }
141
- export class Int16 extends Int {
142
- constructor() {
143
- super(true, 16);
144
- }
145
- }
146
- export class Int32 extends Int {
147
- constructor() {
148
- super(true, 32);
149
- }
150
- }
151
- export class Int64 extends Int {
152
- constructor() {
153
- super(true, 64);
154
- }
155
- }
156
- export class Uint8 extends Int {
157
- constructor() {
158
- super(false, 8);
159
- }
160
- }
161
- export class Uint16 extends Int {
162
- constructor() {
163
- super(false, 16);
164
- }
165
- }
166
- export class Uint32 extends Int {
167
- constructor() {
168
- super(false, 32);
169
- }
170
- }
171
- export class Uint64 extends Int {
172
- constructor() {
173
- super(false, 64);
174
- }
175
- }
176
- // FLOATS
177
- const Precision = {
178
- HALF: 16,
179
- SINGLE: 32,
180
- DOUBLE: 64
181
- };
182
- export class Float extends DataType {
183
- precision;
184
- constructor(precision) {
185
- super();
186
- this.precision = precision;
187
- }
188
- get typeId() {
189
- return Type.Float;
190
- }
191
- // get ArrayType() {
192
- // switch (this.precision) {
193
- // case Precision.HALF:
194
- // return Uint16Array;
195
- // case Precision.SINGLE:
196
- // return Float32Array;
197
- // case Precision.DOUBLE:
198
- // return Float64Array;
199
- // default:
200
- // throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`);
201
- // }
202
- // }
203
- get [Symbol.toStringTag]() {
204
- return 'Float';
205
- }
206
- toString() {
207
- return `Float${this.precision}`;
208
- }
209
- }
210
- export class Float16 extends Float {
211
- constructor() {
212
- super(Precision.HALF);
213
- }
214
- }
215
- export class Float32 extends Float {
216
- constructor() {
217
- super(Precision.SINGLE);
218
- }
219
- }
220
- export class Float64 extends Float {
221
- constructor() {
222
- super(Precision.DOUBLE);
223
- }
224
- }
225
- export class Binary extends DataType {
226
- constructor() {
227
- super();
228
- }
229
- get typeId() {
230
- return Type.Binary;
231
- }
232
- toString() {
233
- return 'Binary';
234
- }
235
- get [Symbol.toStringTag]() {
236
- return 'Binary';
237
- }
238
- }
239
- // STRINGS
240
- export class Utf8 extends DataType {
241
- get typeId() {
242
- return Type.Utf8;
243
- }
244
- // get ArrayType() {
245
- // return Uint8Array;
246
- // }
247
- get [Symbol.toStringTag]() {
248
- return 'Utf8';
249
- }
250
- toString() {
251
- return 'Utf8';
252
- }
253
- }
254
- // DATES, TIMES AND INTERVALS
255
- const DateUnit = {
256
- DAY: 0,
257
- MILLISECOND: 1
258
- };
259
- export class Date extends DataType {
260
- unit;
261
- constructor(unit) {
262
- super();
263
- this.unit = unit;
264
- }
265
- get typeId() {
266
- return Type.Date;
267
- }
268
- // get ArrayType() {
269
- // return Int32Array;
270
- // }
271
- get [Symbol.toStringTag]() {
272
- return 'Date';
273
- }
274
- toString() {
275
- return `Date${(this.unit + 1) * 32}<${DateUnit[this.unit]}>`;
276
- }
277
- }
278
- export class DateDay extends Date {
279
- constructor() {
280
- super(DateUnit.DAY);
281
- }
282
- }
283
- export class DateMillisecond extends Date {
284
- constructor() {
285
- super(DateUnit.MILLISECOND);
286
- }
287
- }
288
- const TimeUnit = {
289
- SECOND: 1,
290
- MILLISECOND: 1e3,
291
- MICROSECOND: 1e6,
292
- NANOSECOND: 1e9
293
- };
294
- export class Time extends DataType {
295
- unit;
296
- bitWidth;
297
- constructor(unit, bitWidth) {
298
- super();
299
- this.unit = unit;
300
- this.bitWidth = bitWidth;
301
- }
302
- get typeId() {
303
- return Type.Time;
304
- }
305
- toString() {
306
- return `Time${this.bitWidth}<${TimeUnit[this.unit]}>`;
307
- }
308
- get [Symbol.toStringTag]() {
309
- return 'Time';
310
- }
311
- }
312
- export class TimeSecond extends Time {
313
- constructor() {
314
- super(TimeUnit.SECOND, 32);
315
- }
316
- }
317
- export class TimeMillisecond extends Time {
318
- constructor() {
319
- super(TimeUnit.MILLISECOND, 32);
320
- }
321
- }
322
- // export class TimeMicrosecond extends Time { constructor() { super(TimeUnit.MICROSECOND, 64); } }
323
- // export class TimeNanosecond extends Time { constructor() { super(TimeUnit.NANOSECOND, 64); } }
324
- export class Timestamp extends DataType {
325
- unit;
326
- timezone;
327
- constructor(unit, timezone = null) {
328
- super();
329
- this.unit = unit;
330
- this.timezone = timezone;
331
- }
332
- get typeId() {
333
- return Type.Timestamp;
334
- }
335
- // get ArrayType() {
336
- // return Int32Array;
337
- // }
338
- get [Symbol.toStringTag]() {
339
- return 'Timestamp';
340
- }
341
- toString() {
342
- return `Timestamp<${TimeUnit[this.unit]}${this.timezone ? `, ${this.timezone}` : ''}>`;
343
- }
344
- }
345
- export class TimestampSecond extends Timestamp {
346
- constructor(timezone = null) {
347
- super(TimeUnit.SECOND, timezone);
348
- }
349
- }
350
- export class TimestampMillisecond extends Timestamp {
351
- constructor(timezone = null) {
352
- super(TimeUnit.MILLISECOND, timezone);
353
- }
354
- }
355
- export class TimestampMicrosecond extends Timestamp {
356
- constructor(timezone = null) {
357
- super(TimeUnit.MICROSECOND, timezone);
358
- }
359
- }
360
- export class TimestampNanosecond extends Timestamp {
361
- constructor(timezone = null) {
362
- super(TimeUnit.NANOSECOND, timezone);
363
- }
364
- }
365
- const IntervalUnit = {
366
- DAY_TIME: 0,
367
- YEAR_MONTH: 1
368
- };
369
- export class Interval extends DataType {
370
- unit;
371
- constructor(unit) {
372
- super();
373
- this.unit = unit;
374
- }
375
- get typeId() {
376
- return Type.Interval;
377
- }
378
- // get ArrayType() {
379
- // return Int32Array;
380
- // }
381
- get [Symbol.toStringTag]() {
382
- return 'Interval';
383
- }
384
- toString() {
385
- return `Interval<${IntervalUnit[this.unit]}>`;
386
- }
387
- }
388
- export class IntervalDayTime extends Interval {
389
- constructor() {
390
- super(IntervalUnit.DAY_TIME);
391
- }
392
- }
393
- export class IntervalYearMonth extends Interval {
394
- constructor() {
395
- super(IntervalUnit.YEAR_MONTH);
396
- }
397
- }
398
- export class FixedSizeList extends DataType {
399
- listSize;
400
- children;
401
- constructor(listSize, child) {
402
- super();
403
- this.listSize = listSize;
404
- this.children = [child];
405
- }
406
- get typeId() {
407
- return Type.FixedSizeList;
408
- }
409
- get valueType() {
410
- return this.children[0].type;
411
- }
412
- get valueField() {
413
- return this.children[0];
414
- }
415
- // get ArrayType() {
416
- // return this.valueType.ArrayType;
417
- // }
418
- get [Symbol.toStringTag]() {
419
- return 'FixedSizeList';
420
- }
421
- toString() {
422
- return `FixedSizeList[${this.listSize}]<${JSON.stringify(this.valueType)}>`;
423
- }
424
- }
425
- export class Struct extends DataType {
426
- children;
427
- constructor(children) {
428
- super();
429
- this.children = children;
430
- }
431
- get typeId() {
432
- return Type.Struct;
433
- }
434
- toString() {
435
- return `Struct<{${this.children
436
- .map((f) => `${f.name}:${JSON.stringify(f.type)}`)
437
- .join(', ')}}>`;
438
- }
439
- get [Symbol.toStringTag]() {
440
- return 'Struct';
441
- }
442
- }
@@ -1,92 +0,0 @@
1
- /**
2
- * Main data type enumeration.
3
- *
4
- * Data types in this library are all *logical*. They can be expressed as
5
- * either a primitive physical type (bytes or bits of some fixed size), a
6
- * nested type consisting of other data types, or another data type (e.g. a
7
- * timestamp encoded as an int64).
8
- *
9
- * **Note**: Only enum values 0-17 (NONE through Map) are written to an Arrow
10
- * IPC payload.
11
- *
12
- * The rest of the values are specified here so TypeScript can narrow the type
13
- * signatures further beyond the base Arrow Types. The Arrow DataTypes include
14
- * metadata like `bitWidth` that impact the type signatures of the values we
15
- * accept and return.
16
- *
17
- * For example, the `Int8Vector` reads 1-byte numbers from an `Int8Array`, an
18
- * `Int32Vector` reads a 4-byte number from an `Int32Array`, and an `Int64Vector`
19
- * reads a pair of 4-byte lo, hi 32-bit integers as a zero-copy slice from the
20
- * underlying `Int32Array`.
21
- *
22
- * Library consumers benefit by knowing the narrowest type, since we can ensure
23
- * the types across all public methods are propagated, and never bail to `any`.
24
- * These values are _never_ used at runtime, and they will _never_ be written
25
- * to the flatbuffers metadata of serialized Arrow IPC payloads.
26
- */
27
- export declare enum Type {
28
- /** The default placeholder type */
29
- NONE = 0,
30
- /** A NULL type having no physical storage */
31
- Null = 1,
32
- /** Signed or unsigned 8, 16, 32, or 64-bit little-endian integer */
33
- Int = 2,
34
- /** 2, 4, or 8-byte floating point value */
35
- Float = 3,
36
- /** Variable-length bytes (no guarantee of UTF8-ness) */
37
- Binary = 4,
38
- /** UTF8 variable-length string as List<Char> */
39
- Utf8 = 5,
40
- /** Boolean as 1 bit, LSB bit-packed ordering */
41
- Bool = 6,
42
- /** Precision-and-scale-based decimal type. Storage type depends on the parameters. */
43
- Decimal = 7,
44
- /** int32_t days or int64_t milliseconds since the UNIX epoch */
45
- Date = 8,
46
- /** Time as signed 32 or 64-bit integer, representing either seconds, milliseconds, microseconds, or nanoseconds since midnight since midnight */
47
- Time = 9,
48
- /** Exact timestamp encoded with int64 since UNIX epoch (Default unit millisecond) */
49
- Timestamp = 10,
50
- /** YEAR_MONTH or DAY_TIME interval in SQL style */
51
- Interval = 11,
52
- /** A list of some logical data type */
53
- List = 12,
54
- /** Struct of logical types */
55
- Struct = 13,
56
- /** Union of logical types */
57
- Union = 14,
58
- /** Fixed-size binary. Each value occupies the same number of bytes */
59
- FixedSizeBinary = 15,
60
- /** Fixed-size list. Each value occupies the same number of bytes */
61
- FixedSizeList = 16,
62
- /** Map of named logical types */
63
- Map = 17,
64
- /** Dictionary aka Category type */
65
- Dictionary = -1,
66
- Int8 = -2,
67
- Int16 = -3,
68
- Int32 = -4,
69
- Int64 = -5,
70
- Uint8 = -6,
71
- Uint16 = -7,
72
- Uint32 = -8,
73
- Uint64 = -9,
74
- Float16 = -10,
75
- Float32 = -11,
76
- Float64 = -12,
77
- DateDay = -13,
78
- DateMillisecond = -14,
79
- TimestampSecond = -15,
80
- TimestampMillisecond = -16,
81
- TimestampMicrosecond = -17,
82
- TimestampNanosecond = -18,
83
- TimeSecond = -19,
84
- TimeMillisecond = -20,
85
- TimeMicrosecond = -21,
86
- TimeNanosecond = -22,
87
- DenseUnion = -23,
88
- SparseUnion = -24,
89
- IntervalDayTime = -25,
90
- IntervalYearMonth = -26
91
- }
92
- //# sourceMappingURL=enum.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/enum.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,oBAAY,IAAI;IACd,mCAAmC;IACnC,IAAI,IAAI;IACR,6CAA6C;IAC7C,IAAI,IAAI;IACR,oEAAoE;IACpE,GAAG,IAAI;IACP,2CAA2C;IAC3C,KAAK,IAAI;IACT,wDAAwD;IACxD,MAAM,IAAI;IACV,gDAAgD;IAChD,IAAI,IAAI;IACR,gDAAgD;IAChD,IAAI,IAAI;IACR,sFAAsF;IACtF,OAAO,IAAI;IACX,gEAAgE;IAChE,IAAI,IAAI;IACR,iJAAiJ;IACjJ,IAAI,IAAI;IACR,qFAAqF;IACrF,SAAS,KAAK;IACd,mDAAmD;IACnD,QAAQ,KAAK;IACb,uCAAuC;IACvC,IAAI,KAAK;IACT,8BAA8B;IAC9B,MAAM,KAAK;IACX,6BAA6B;IAC7B,KAAK,KAAK;IACV,sEAAsE;IACtE,eAAe,KAAK;IACpB,oEAAoE;IACpE,aAAa,KAAK;IAClB,iCAAiC;IACjC,GAAG,KAAK;IAER,mCAAmC;IACnC,UAAU,KAAK;IACf,IAAI,KAAK;IACT,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;IACb,eAAe,MAAM;IACrB,eAAe,MAAM;IACrB,oBAAoB,MAAM;IAC1B,oBAAoB,MAAM;IAC1B,mBAAmB,MAAM;IACzB,UAAU,MAAM;IAChB,eAAe,MAAM;IACrB,eAAe,MAAM;IACrB,cAAc,MAAM;IACpB,UAAU,MAAM;IAChB,WAAW,MAAM;IACjB,eAAe,MAAM;IACrB,iBAAiB,MAAM;CACxB"}
@@ -1,97 +0,0 @@
1
- // loaders.gl
2
- // SPDX-License-Identifier: MIT
3
- // Copyright (c) vis.gl contributors
4
- // This code is adapted from ArrowJS https://github.com/apache/arrow
5
- // under Apache license http://www.apache.org/licenses/LICENSE-2.0
6
- /**
7
- * Main data type enumeration.
8
- *
9
- * Data types in this library are all *logical*. They can be expressed as
10
- * either a primitive physical type (bytes or bits of some fixed size), a
11
- * nested type consisting of other data types, or another data type (e.g. a
12
- * timestamp encoded as an int64).
13
- *
14
- * **Note**: Only enum values 0-17 (NONE through Map) are written to an Arrow
15
- * IPC payload.
16
- *
17
- * The rest of the values are specified here so TypeScript can narrow the type
18
- * signatures further beyond the base Arrow Types. The Arrow DataTypes include
19
- * metadata like `bitWidth` that impact the type signatures of the values we
20
- * accept and return.
21
- *
22
- * For example, the `Int8Vector` reads 1-byte numbers from an `Int8Array`, an
23
- * `Int32Vector` reads a 4-byte number from an `Int32Array`, and an `Int64Vector`
24
- * reads a pair of 4-byte lo, hi 32-bit integers as a zero-copy slice from the
25
- * underlying `Int32Array`.
26
- *
27
- * Library consumers benefit by knowing the narrowest type, since we can ensure
28
- * the types across all public methods are propagated, and never bail to `any`.
29
- * These values are _never_ used at runtime, and they will _never_ be written
30
- * to the flatbuffers metadata of serialized Arrow IPC payloads.
31
- */
32
- export var Type;
33
- (function (Type) {
34
- /** The default placeholder type */
35
- Type[Type["NONE"] = 0] = "NONE";
36
- /** A NULL type having no physical storage */
37
- Type[Type["Null"] = 1] = "Null";
38
- /** Signed or unsigned 8, 16, 32, or 64-bit little-endian integer */
39
- Type[Type["Int"] = 2] = "Int";
40
- /** 2, 4, or 8-byte floating point value */
41
- Type[Type["Float"] = 3] = "Float";
42
- /** Variable-length bytes (no guarantee of UTF8-ness) */
43
- Type[Type["Binary"] = 4] = "Binary";
44
- /** UTF8 variable-length string as List<Char> */
45
- Type[Type["Utf8"] = 5] = "Utf8";
46
- /** Boolean as 1 bit, LSB bit-packed ordering */
47
- Type[Type["Bool"] = 6] = "Bool";
48
- /** Precision-and-scale-based decimal type. Storage type depends on the parameters. */
49
- Type[Type["Decimal"] = 7] = "Decimal";
50
- /** int32_t days or int64_t milliseconds since the UNIX epoch */
51
- Type[Type["Date"] = 8] = "Date";
52
- /** Time as signed 32 or 64-bit integer, representing either seconds, milliseconds, microseconds, or nanoseconds since midnight since midnight */
53
- Type[Type["Time"] = 9] = "Time";
54
- /** Exact timestamp encoded with int64 since UNIX epoch (Default unit millisecond) */
55
- Type[Type["Timestamp"] = 10] = "Timestamp";
56
- /** YEAR_MONTH or DAY_TIME interval in SQL style */
57
- Type[Type["Interval"] = 11] = "Interval";
58
- /** A list of some logical data type */
59
- Type[Type["List"] = 12] = "List";
60
- /** Struct of logical types */
61
- Type[Type["Struct"] = 13] = "Struct";
62
- /** Union of logical types */
63
- Type[Type["Union"] = 14] = "Union";
64
- /** Fixed-size binary. Each value occupies the same number of bytes */
65
- Type[Type["FixedSizeBinary"] = 15] = "FixedSizeBinary";
66
- /** Fixed-size list. Each value occupies the same number of bytes */
67
- Type[Type["FixedSizeList"] = 16] = "FixedSizeList";
68
- /** Map of named logical types */
69
- Type[Type["Map"] = 17] = "Map";
70
- /** Dictionary aka Category type */
71
- Type[Type["Dictionary"] = -1] = "Dictionary";
72
- Type[Type["Int8"] = -2] = "Int8";
73
- Type[Type["Int16"] = -3] = "Int16";
74
- Type[Type["Int32"] = -4] = "Int32";
75
- Type[Type["Int64"] = -5] = "Int64";
76
- Type[Type["Uint8"] = -6] = "Uint8";
77
- Type[Type["Uint16"] = -7] = "Uint16";
78
- Type[Type["Uint32"] = -8] = "Uint32";
79
- Type[Type["Uint64"] = -9] = "Uint64";
80
- Type[Type["Float16"] = -10] = "Float16";
81
- Type[Type["Float32"] = -11] = "Float32";
82
- Type[Type["Float64"] = -12] = "Float64";
83
- Type[Type["DateDay"] = -13] = "DateDay";
84
- Type[Type["DateMillisecond"] = -14] = "DateMillisecond";
85
- Type[Type["TimestampSecond"] = -15] = "TimestampSecond";
86
- Type[Type["TimestampMillisecond"] = -16] = "TimestampMillisecond";
87
- Type[Type["TimestampMicrosecond"] = -17] = "TimestampMicrosecond";
88
- Type[Type["TimestampNanosecond"] = -18] = "TimestampNanosecond";
89
- Type[Type["TimeSecond"] = -19] = "TimeSecond";
90
- Type[Type["TimeMillisecond"] = -20] = "TimeMillisecond";
91
- Type[Type["TimeMicrosecond"] = -21] = "TimeMicrosecond";
92
- Type[Type["TimeNanosecond"] = -22] = "TimeNanosecond";
93
- Type[Type["DenseUnion"] = -23] = "DenseUnion";
94
- Type[Type["SparseUnion"] = -24] = "SparseUnion";
95
- Type[Type["IntervalDayTime"] = -25] = "IntervalDayTime";
96
- Type[Type["IntervalYearMonth"] = -26] = "IntervalYearMonth";
97
- })(Type || (Type = {}));
@@ -1,13 +0,0 @@
1
- import { Type } from "./arrow-like-type.js";
2
- /**
3
- * Gets type information from an Arrow type object or "mock" Arrow type object
4
- * @param arrowTypeLike Arrow Type or type object of similar shape
5
- */
6
- export declare function getTypeInfo(arrowTypeLike: any): {
7
- typeId: Type;
8
- ArrayType: ArrayLike<unknown>;
9
- typeName: string;
10
- typeEnumName?: string;
11
- precision?: number;
12
- };
13
- //# sourceMappingURL=get-type-info.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-type-info.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/get-type-info.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,IAAI,EAAC,6BAA0B;AAEvC;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,GAAG,GAAG;IAC/C,MAAM,EAAE,IAAI,CAAC;IACb,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAQA"}
@@ -1,27 +0,0 @@
1
- // loaders.gl
2
- // SPDX-License-Identifier: MIT
3
- // Copyright (c) vis.gl contributors
4
- import { Type } from "./arrow-like-type.js";
5
- /**
6
- * Gets type information from an Arrow type object or "mock" Arrow type object
7
- * @param arrowTypeLike Arrow Type or type object of similar shape
8
- */
9
- export function getTypeInfo(arrowTypeLike) {
10
- return {
11
- typeId: arrowTypeLike.typeId,
12
- ArrayType: arrowTypeLike.ArrayType,
13
- typeName: arrowTypeLike.toString(),
14
- typeEnumName: getTypeKey(arrowTypeLike.typeId),
15
- precision: arrowTypeLike.precision
16
- };
17
- }
18
- let ReverseType = null;
19
- function getTypeKey(typeKey) {
20
- if (!ReverseType) {
21
- ReverseType = {};
22
- for (const key in Type) {
23
- ReverseType[Type[key]] = key;
24
- }
25
- }
26
- return ReverseType[typeKey];
27
- }
@@ -1,5 +0,0 @@
1
- export { ArrowLikeField as Field } from "./arrow-like-field.js";
2
- export { ArrowLikeSchema as Schema } from "./arrow-like-schema.js";
3
- export { ArrowLikeTable as Table } from "./arrow-like-table.js";
4
- export * from "./arrow-like-type.js";
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,cAAc,IAAI,KAAK,EAAC,8BAA2B;AAC3D,OAAO,EAAC,eAAe,IAAI,MAAM,EAAC,+BAA4B;AAC9D,OAAO,EAAC,cAAc,IAAI,KAAK,EAAC,8BAA2B;AAC3D,qCAAkC"}
@@ -1,7 +0,0 @@
1
- // loaders.gl
2
- // SPDX-License-Identifier: MIT
3
- // Copyright (c) vis.gl contributors
4
- export { ArrowLikeField as Field } from "./arrow-like-field.js";
5
- export { ArrowLikeSchema as Schema } from "./arrow-like-schema.js";
6
- export { ArrowLikeTable as Table } from "./arrow-like-table.js";
7
- export * from "./arrow-like-type.js";