@loaders.gl/schema 3.1.0-alpha.4 → 3.1.0-alpha.5

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 (73) hide show
  1. package/dist/bundle.d.ts +1 -0
  2. package/dist/category/common.d.ts +18 -0
  3. package/dist/category/gis.d.ts +50 -0
  4. package/dist/category/mesh/convert-mesh.d.ts +14 -0
  5. package/dist/category/mesh/deduce-mesh-schema.d.ts +23 -0
  6. package/dist/category/mesh/mesh-to-arrow-table.d.ts +10 -0
  7. package/dist/category/mesh/mesh-types.d.ts +49 -0
  8. package/dist/category/mesh/mesh-utils.d.ts +22 -0
  9. package/dist/category/table/deduce-table-schema.d.ts +8 -0
  10. package/dist/category/table/table-types.d.ts +75 -0
  11. package/dist/dist.min.js.map +1 -1
  12. package/dist/es5/bundle.js +1 -1
  13. package/dist/es5/bundle.js.map +1 -1
  14. package/dist/es5/category/mesh/convert-mesh.js +2 -10
  15. package/dist/es5/category/mesh/convert-mesh.js.map +1 -1
  16. package/dist/es5/category/mesh/deduce-mesh-schema.js +8 -8
  17. package/dist/es5/category/mesh/deduce-mesh-schema.js.map +1 -1
  18. package/dist/es5/category/mesh/mesh-to-arrow-table.js +18 -17
  19. package/dist/es5/category/mesh/mesh-to-arrow-table.js.map +1 -1
  20. package/dist/es5/category/mesh/mesh-utils.js +16 -16
  21. package/dist/es5/category/mesh/mesh-utils.js.map +1 -1
  22. package/dist/es5/category/table/deduce-table-schema.js +9 -9
  23. package/dist/es5/category/table/deduce-table-schema.js.map +1 -1
  24. package/dist/es5/index.js +52 -52
  25. package/dist/es5/lib/arrow/get-type-info.js +3 -3
  26. package/dist/es5/lib/arrow/get-type-info.js.map +1 -1
  27. package/dist/es5/lib/batches/base-table-batch-aggregator.js +42 -53
  28. package/dist/es5/lib/batches/base-table-batch-aggregator.js.map +1 -1
  29. package/dist/es5/lib/batches/columnar-table-batch-aggregator.js +71 -90
  30. package/dist/es5/lib/batches/columnar-table-batch-aggregator.js.map +1 -1
  31. package/dist/es5/lib/batches/row-table-batch-aggregator.js +59 -70
  32. package/dist/es5/lib/batches/row-table-batch-aggregator.js.map +1 -1
  33. package/dist/es5/lib/batches/table-batch-builder.js +113 -133
  34. package/dist/es5/lib/batches/table-batch-builder.js.map +1 -1
  35. package/dist/es5/lib/schema/impl/enum.js +1 -1
  36. package/dist/es5/lib/schema/impl/field.js +19 -32
  37. package/dist/es5/lib/schema/impl/field.js.map +1 -1
  38. package/dist/es5/lib/schema/impl/schema.js +54 -119
  39. package/dist/es5/lib/schema/impl/schema.js.map +1 -1
  40. package/dist/es5/lib/schema/impl/type.js +395 -728
  41. package/dist/es5/lib/schema/impl/type.js.map +1 -1
  42. package/dist/es5/lib/schema/index.js +37 -37
  43. package/dist/es5/lib/utils/async-queue.js +81 -164
  44. package/dist/es5/lib/utils/async-queue.js.map +1 -1
  45. package/dist/es5/lib/utils/row-utils.js +4 -4
  46. package/dist/es5/lib/utils/row-utils.js.map +1 -1
  47. package/dist/esm/category/mesh/convert-mesh.js +1 -1
  48. package/dist/esm/category/mesh/convert-mesh.js.map +1 -1
  49. package/dist/esm/lib/schema/impl/field.js +1 -1
  50. package/dist/esm/lib/schema/impl/field.js.map +1 -1
  51. package/dist/esm/lib/schema/impl/type.js +8 -8
  52. package/dist/esm/lib/schema/impl/type.js.map +1 -1
  53. package/dist/index.d.ts +22 -0
  54. package/dist/lib/arrow/arrow-like-type-utils.d.ts +3 -0
  55. package/dist/lib/arrow/arrow-type-utils.d.ts +5 -0
  56. package/dist/lib/arrow/get-type-info.d.ts +13 -0
  57. package/dist/lib/batches/base-table-batch-aggregator.d.ts +18 -0
  58. package/dist/lib/batches/columnar-table-batch-aggregator.d.ts +22 -0
  59. package/dist/lib/batches/row-table-batch-aggregator.d.ts +21 -0
  60. package/dist/lib/batches/table-batch-aggregator.d.ts +24 -0
  61. package/dist/lib/batches/table-batch-builder.d.ts +52 -0
  62. package/dist/lib/schema/impl/enum.d.ts +91 -0
  63. package/dist/lib/schema/impl/field.d.ts +18 -0
  64. package/dist/lib/schema/impl/schema.d.ts +15 -0
  65. package/dist/lib/schema/impl/type.d.ts +175 -0
  66. package/dist/lib/schema/index.d.ts +4 -0
  67. package/dist/lib/schema-utils/deduce-column-type.d.ts +2 -0
  68. package/dist/lib/utils/assert.d.ts +1 -0
  69. package/dist/lib/utils/async-queue.d.ts +17 -0
  70. package/dist/lib/utils/row-utils.d.ts +8 -0
  71. package/dist/types.d.ts +7 -0
  72. package/package.json +5 -5
  73. package/src/category/gis.ts +1 -0
@@ -0,0 +1,175 @@
1
+ import { Type } from './enum';
2
+ import Field from './field';
3
+ export { Type } from './enum';
4
+ export declare type TypedIntArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Int32Array | Uint32Array | Uint8ClampedArray;
5
+ export declare type TypedFloatArray = Float32Array | Float64Array;
6
+ export declare type TypedArray = TypedIntArray | TypedFloatArray;
7
+ export declare type AnyArrayType = Array<any> | TypedIntArray | TypedFloatArray;
8
+ export declare class DataType {
9
+ static isNull(x: any): boolean;
10
+ static isInt(x: any): boolean;
11
+ static isFloat(x: any): boolean;
12
+ static isBinary(x: any): boolean;
13
+ static isUtf8(x: any): boolean;
14
+ static isBool(x: any): boolean;
15
+ static isDecimal(x: any): boolean;
16
+ static isDate(x: any): boolean;
17
+ static isTime(x: any): boolean;
18
+ static isTimestamp(x: any): boolean;
19
+ static isInterval(x: any): boolean;
20
+ static isList(x: any): boolean;
21
+ static isStruct(x: any): boolean;
22
+ static isUnion(x: any): boolean;
23
+ static isFixedSizeBinary(x: any): boolean;
24
+ static isFixedSizeList(x: any): boolean;
25
+ static isMap(x: any): boolean;
26
+ static isDictionary(x: any): boolean;
27
+ get typeId(): Type;
28
+ compareTo(other: DataType): boolean;
29
+ }
30
+ export declare class Null extends DataType {
31
+ get typeId(): Type;
32
+ get [Symbol.toStringTag](): string;
33
+ toString(): string;
34
+ }
35
+ export declare class Bool extends DataType {
36
+ get typeId(): Type;
37
+ get [Symbol.toStringTag](): string;
38
+ toString(): string;
39
+ }
40
+ export declare class Int extends DataType {
41
+ readonly isSigned: boolean;
42
+ readonly bitWidth: number;
43
+ constructor(isSigned: any, bitWidth: any);
44
+ get typeId(): Type;
45
+ get [Symbol.toStringTag](): string;
46
+ toString(): string;
47
+ }
48
+ export declare class Int8 extends Int {
49
+ constructor();
50
+ }
51
+ export declare class Int16 extends Int {
52
+ constructor();
53
+ }
54
+ export declare class Int32 extends Int {
55
+ constructor();
56
+ }
57
+ export declare class Int64 extends Int {
58
+ constructor();
59
+ }
60
+ export declare class Uint8 extends Int {
61
+ constructor();
62
+ }
63
+ export declare class Uint16 extends Int {
64
+ constructor();
65
+ }
66
+ export declare class Uint32 extends Int {
67
+ constructor();
68
+ }
69
+ export declare class Uint64 extends Int {
70
+ constructor();
71
+ }
72
+ export declare class Float extends DataType {
73
+ readonly precision: number;
74
+ constructor(precision: any);
75
+ get typeId(): Type;
76
+ get [Symbol.toStringTag](): string;
77
+ toString(): string;
78
+ }
79
+ export declare class Float16 extends Float {
80
+ constructor();
81
+ }
82
+ export declare class Float32 extends Float {
83
+ constructor();
84
+ }
85
+ export declare class Float64 extends Float {
86
+ constructor();
87
+ }
88
+ export declare class Binary extends DataType {
89
+ constructor();
90
+ get typeId(): Type;
91
+ toString(): string;
92
+ get [Symbol.toStringTag](): string;
93
+ }
94
+ export declare class Utf8 extends DataType {
95
+ get typeId(): Type;
96
+ get [Symbol.toStringTag](): string;
97
+ toString(): string;
98
+ }
99
+ export declare class Date extends DataType {
100
+ readonly unit: number;
101
+ constructor(unit: any);
102
+ get typeId(): Type;
103
+ get [Symbol.toStringTag](): string;
104
+ toString(): string;
105
+ }
106
+ export declare class DateDay extends Date {
107
+ constructor();
108
+ }
109
+ export declare class DateMillisecond extends Date {
110
+ constructor();
111
+ }
112
+ export declare class Time extends DataType {
113
+ readonly unit: number;
114
+ readonly bitWidth: number;
115
+ constructor(unit: any, bitWidth: any);
116
+ get typeId(): Type;
117
+ toString(): string;
118
+ get [Symbol.toStringTag](): string;
119
+ }
120
+ export declare class TimeSecond extends Time {
121
+ constructor();
122
+ }
123
+ export declare class TimeMillisecond extends Time {
124
+ constructor();
125
+ }
126
+ export declare class Timestamp extends DataType {
127
+ readonly unit: any;
128
+ readonly timezone: any;
129
+ constructor(unit: any, timezone?: null);
130
+ get typeId(): Type;
131
+ get [Symbol.toStringTag](): string;
132
+ toString(): string;
133
+ }
134
+ export declare class TimestampSecond extends Timestamp {
135
+ constructor(timezone?: null);
136
+ }
137
+ export declare class TimestampMillisecond extends Timestamp {
138
+ constructor(timezone?: null);
139
+ }
140
+ export declare class TimestampMicrosecond extends Timestamp {
141
+ constructor(timezone?: null);
142
+ }
143
+ export declare class TimestampNanosecond extends Timestamp {
144
+ constructor(timezone?: null);
145
+ }
146
+ export declare class Interval extends DataType {
147
+ readonly unit: number;
148
+ constructor(unit: number);
149
+ get typeId(): Type;
150
+ get [Symbol.toStringTag](): string;
151
+ toString(): string;
152
+ }
153
+ export declare class IntervalDayTime extends Interval {
154
+ constructor();
155
+ }
156
+ export declare class IntervalYearMonth extends Interval {
157
+ constructor();
158
+ }
159
+ export declare class FixedSizeList extends DataType {
160
+ readonly listSize: number;
161
+ readonly children: Field[];
162
+ constructor(listSize: number, child: Field);
163
+ get typeId(): Type;
164
+ get valueType(): DataType;
165
+ get valueField(): Field;
166
+ get [Symbol.toStringTag](): string;
167
+ toString(): string;
168
+ }
169
+ export declare class Struct extends DataType {
170
+ readonly children: Field[];
171
+ constructor(children: Field[]);
172
+ get typeId(): Type;
173
+ toString(): string;
174
+ get [Symbol.toStringTag](): string;
175
+ }
@@ -0,0 +1,4 @@
1
+ export { default as Schema } from './impl/schema';
2
+ export { default as Field } from './impl/field';
3
+ export { Type } from './impl/type';
4
+ export { DataType, Null, Bool, Int, Int8, Int16, Int32, Int64, Uint8, Uint16, Uint32, Uint64, Float, Float16, Float32, Float64, Binary, Utf8, Date, DateDay, DateMillisecond, Time, TimeSecond, TimeMillisecond, Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond, Interval, IntervalDayTime, IntervalYearMonth, FixedSizeList, Struct } from './impl/type';
@@ -0,0 +1,2 @@
1
+ export declare function deduceTypeFromColumn(value: any): Float32ArrayConstructor | DateConstructor | StringConstructor | null;
2
+ export declare function deduceTypeFromValue(value: any): Float32ArrayConstructor | DateConstructor | StringConstructor | null;
@@ -0,0 +1 @@
1
+ export declare function assert(condition: boolean, message?: string): void;
@@ -0,0 +1,17 @@
1
+ export default class AsyncQueue<T> {
2
+ private _values;
3
+ private _settlers;
4
+ private _closed;
5
+ constructor();
6
+ close(): void;
7
+ [Symbol.asyncIterator](): AsyncIterator<T>;
8
+ enqueue(value: T | Error): void;
9
+ /**
10
+ * @returns a Promise for an IteratorResult
11
+ */
12
+ next(): Promise<any>;
13
+ }
14
+ /**
15
+ * @returns a Promise for an Array with the elements in `asyncIterable`
16
+ */
17
+ export declare function takeAsync(asyncIterable: AsyncIterable<any>, count?: number): Promise<any[]>;
@@ -0,0 +1,8 @@
1
+ /** Convert an object row to an array row */
2
+ export declare function convertToObjectRow(arrayRow: any[], headers: string[]): {
3
+ [columnName: string]: any;
4
+ };
5
+ /** Convert an object row to an array row */
6
+ export declare function convertToArrayRow(objectRow: {
7
+ [columnName: string]: any;
8
+ }, headers: string[]): any[];
@@ -0,0 +1,7 @@
1
+ /** Any typed array */
2
+ export declare type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;
3
+ export declare type BigTypedArray = TypedArray | BigInt64Array | BigUint64Array;
4
+ /** Any numeric array: typed array or `number[]` */
5
+ export declare type NumberArray = number[] | TypedArray;
6
+ /** Any array: typed array or js array (`any[]`) */
7
+ export declare type AnyArray = any[] | TypedArray;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/schema",
3
- "version": "3.1.0-alpha.4",
3
+ "version": "3.1.0-alpha.5",
4
4
  "description": "Table format APIs for JSON, CSV, etc...",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -18,7 +18,7 @@
18
18
  "point cloud",
19
19
  "PLY"
20
20
  ],
21
- "types": "src/index.ts",
21
+ "types": "dist/index.d.ts",
22
22
  "main": "dist/es5/index.js",
23
23
  "module": "dist/esm/index.js",
24
24
  "sideEffects": false,
@@ -29,12 +29,12 @@
29
29
  ],
30
30
  "scripts": {
31
31
  "pre-build": "npm run build-bundle",
32
+ "post-build": "tsc",
32
33
  "build-bundle": "webpack --display=minimal --config ../../scripts/webpack/bundle.js"
33
34
  },
34
35
  "dependencies": {
35
36
  "@types/geojson": "^7946.0.7",
36
- "apache-arrow": "^4.0.0",
37
- "d3-dsv": "^1.2.0"
37
+ "apache-arrow": "^4.0.0"
38
38
  },
39
- "gitHead": "e309784af37ef9f3640c7733c7851124c72e1fa3"
39
+ "gitHead": "352241dd910a8c6307a235dadbe154ca915b885b"
40
40
  }
@@ -55,6 +55,7 @@ export type BinaryPolygonFeatures = BinaryPolygonGeometry & BinaryProperties;
55
55
  * Represent a collection of Features, similar to a GeoJSON FeatureCollection
56
56
  */
57
57
  export type BinaryFeatures = {
58
+ type?: BinaryGeometryType;
58
59
  points?: BinaryPointFeatures;
59
60
  lines?: BinaryLineFeatures;
60
61
  polygons?: BinaryPolygonFeatures;