@synnaxlabs/x 0.14.2 → 0.15.1
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.
- package/.turbo/turbo-build.log +6 -6
- package/dist/binary/encoder.d.ts +0 -6
- package/dist/telem/series.d.ts +32 -14
- package/dist/telem/telem.d.ts +4 -1
- package/dist/x.cjs +7 -7
- package/dist/x.cjs.map +1 -1
- package/dist/x.js +2232 -3126
- package/dist/x.js.map +1 -1
- package/package.json +3 -4
- package/src/binary/encoder.ts +1 -22
- package/src/telem/series.spec.ts +191 -1
- package/src/telem/series.ts +271 -21
- package/src/telem/telem.ts +13 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
> @synnaxlabs/x@0.
|
|
2
|
+
> @synnaxlabs/x@0.15.1 build /home/runner/work/synnax/synnax/x/ts
|
|
3
3
|
> tsc --noEmit && vite build
|
|
4
4
|
|
|
5
5
|
[36mvite v5.1.2 [32mbuilding for production...[36m[39m
|
|
6
6
|
transforming...
|
|
7
7
|
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "crypto" has been externalized for browser compatibility, imported by "/home/runner/work/synnax/synnax/node_modules/.pnpm/nanoid@3.0.0/node_modules/nanoid/index.js". See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
8
|
-
[32m✓[39m
|
|
8
|
+
[32m✓[39m 123 modules transformed.
|
|
9
9
|
rendering chunks...
|
|
10
10
|
[32m
|
|
11
11
|
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
12
12
|
computing gzip size...
|
|
13
|
-
[2mdist/[22m[36mx.js [39m[1m[
|
|
14
|
-
[32m[36m[vite:dts][32m Declaration files built in
|
|
13
|
+
[2mdist/[22m[36mx.js [39m[1m[2m179.61 kB[22m[1m[22m[2m │ gzip: 39.86 kB[22m[2m │ map: 522.06 kB[22m
|
|
14
|
+
[32m[36m[vite:dts][32m Declaration files built in 3292ms.
|
|
15
15
|
[39m
|
|
16
|
-
[2mdist/[22m[36mx.cjs [39m[1m[
|
|
17
|
-
[32m✓ built in
|
|
16
|
+
[2mdist/[22m[36mx.cjs [39m[1m[2m118.93 kB[22m[1m[22m[2m │ gzip: 31.59 kB[22m[2m │ map: 503.70 kB[22m
|
|
17
|
+
[32m✓ built in 4.12s[39m
|
package/dist/binary/encoder.d.ts
CHANGED
|
@@ -21,12 +21,6 @@ export interface EncoderDecoder {
|
|
|
21
21
|
*/
|
|
22
22
|
decode: <P>(data: Uint8Array | ArrayBuffer, schema?: ZodSchema<P>) => P;
|
|
23
23
|
}
|
|
24
|
-
/** MsgpackEncoderDecoder is a msgpack implementation of EncoderDecoder. */
|
|
25
|
-
export declare class MsgpackEncoderDecoder implements EncoderDecoder {
|
|
26
|
-
contentType: string;
|
|
27
|
-
encode(payload: unknown): ArrayBuffer;
|
|
28
|
-
decode<P extends z.ZodTypeAny>(data: Uint8Array | ArrayBuffer, schema?: P): z.output<P>;
|
|
29
|
-
}
|
|
30
24
|
/** JSONEncoderDecoder is a JSON implementation of EncoderDecoder. */
|
|
31
25
|
export declare class JSONEncoderDecoder implements EncoderDecoder {
|
|
32
26
|
contentType: string;
|
package/dist/telem/series.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { type z } from "zod";
|
|
2
2
|
import { bounds } from '../spatial';
|
|
3
3
|
import { type GLBufferController, type GLBufferUsage } from './gl';
|
|
4
|
-
import { DataType, type TypedArray, type Rate, Size, TimeRange, TimeStamp, type CrudeDataType, type TelemValue } from './telem';
|
|
5
|
-
export type SampleValue = number | bigint;
|
|
4
|
+
import { DataType, type TypedArray, type Rate, Size, TimeRange, TimeStamp, type CrudeDataType, type TelemValue, type NumericTelemValue } from './telem';
|
|
6
5
|
export interface SeriesDigest {
|
|
7
6
|
key: string;
|
|
8
7
|
dataType: string;
|
|
9
|
-
sampleOffset:
|
|
8
|
+
sampleOffset: NumericTelemValue;
|
|
10
9
|
alignment: bounds.Bounds;
|
|
11
10
|
timeRange?: string;
|
|
12
11
|
length: number;
|
|
@@ -15,7 +14,7 @@ export interface SeriesDigest {
|
|
|
15
14
|
interface BaseSeriesProps {
|
|
16
15
|
dataType?: CrudeDataType;
|
|
17
16
|
timeRange?: TimeRange;
|
|
18
|
-
sampleOffset?:
|
|
17
|
+
sampleOffset?: NumericTelemValue;
|
|
19
18
|
glBufferUsage?: GLBufferUsage;
|
|
20
19
|
alignment?: number;
|
|
21
20
|
key?: string;
|
|
@@ -39,7 +38,7 @@ export interface SeriesMemInfo {
|
|
|
39
38
|
* Series is a strongly typed array of telemetry samples backed by an underlying binary
|
|
40
39
|
* buffer.
|
|
41
40
|
*/
|
|
42
|
-
export declare class Series {
|
|
41
|
+
export declare class Series<T extends TelemValue = TelemValue> {
|
|
43
42
|
key: string;
|
|
44
43
|
/** The data type of the array */
|
|
45
44
|
readonly dataType: DataType;
|
|
@@ -48,7 +47,7 @@ export declare class Series {
|
|
|
48
47
|
* downwards. Typically used to convert arrays to lower precision while preserving
|
|
49
48
|
* the relative range of actual values.
|
|
50
49
|
*/
|
|
51
|
-
sampleOffset:
|
|
50
|
+
sampleOffset: NumericTelemValue;
|
|
52
51
|
/**
|
|
53
52
|
* Stores information about the buffer state of this array into a WebGL buffer.
|
|
54
53
|
*/
|
|
@@ -111,34 +110,53 @@ export declare class Series {
|
|
|
111
110
|
* WARNING: This method is expensive and copies the entire underlying array. There
|
|
112
111
|
* also may be untimely precision issues when converting between data types.
|
|
113
112
|
*/
|
|
114
|
-
convert(target: DataType, sampleOffset?:
|
|
113
|
+
convert(target: DataType, sampleOffset?: NumericTelemValue): Series;
|
|
115
114
|
private calcRawMax;
|
|
116
115
|
/** @returns the maximum value in the array */
|
|
117
|
-
get max():
|
|
116
|
+
get max(): NumericTelemValue;
|
|
118
117
|
private calcRawMin;
|
|
119
118
|
/** @returns the minimum value in the array */
|
|
120
|
-
get min():
|
|
119
|
+
get min(): NumericTelemValue;
|
|
121
120
|
/** @returns the bounds of this array. */
|
|
122
121
|
get bounds(): bounds.Bounds;
|
|
123
122
|
private maybeRecomputeMinMax;
|
|
124
123
|
enrich(): void;
|
|
125
|
-
get range():
|
|
126
|
-
at(index: number, required: true):
|
|
127
|
-
at(index: number, required?: false):
|
|
124
|
+
get range(): NumericTelemValue;
|
|
125
|
+
at(index: number, required: true): T;
|
|
126
|
+
at(index: number, required?: false): T | undefined;
|
|
127
|
+
private atVariable;
|
|
128
128
|
/**
|
|
129
129
|
* @returns the index of the first sample that is greater than or equal to the given value.
|
|
130
130
|
* The underlying array must be sorted. If it is not, the behavior of this method is undefined.
|
|
131
131
|
* @param value the value to search for.
|
|
132
132
|
*/
|
|
133
|
-
binarySearch(value:
|
|
133
|
+
binarySearch(value: NumericTelemValue): number;
|
|
134
134
|
updateGLBuffer(gl: GLBufferController): void;
|
|
135
|
+
as(jsType: "string"): Series<string>;
|
|
136
|
+
as(jsType: "number"): Series<number>;
|
|
137
|
+
as(jsType: "bigint"): Series<bigint>;
|
|
135
138
|
get digest(): SeriesDigest;
|
|
136
139
|
get memInfo(): SeriesMemInfo;
|
|
137
140
|
get alignmentBounds(): bounds.Bounds;
|
|
138
141
|
private maybeGarbageCollectGLBuffer;
|
|
139
142
|
get glBuffer(): WebGLBuffer;
|
|
143
|
+
[Symbol.iterator](): Iterator<T>;
|
|
140
144
|
slice(start: number, end?: number): Series;
|
|
141
145
|
reAlign(alignment: number): Series;
|
|
142
146
|
}
|
|
143
|
-
export declare const addSamples: (a:
|
|
147
|
+
export declare const addSamples: (a: NumericTelemValue, b: NumericTelemValue) => NumericTelemValue;
|
|
148
|
+
export declare class MultiSeries<T extends TelemValue = TelemValue> implements Iterable<T> {
|
|
149
|
+
readonly series: Array<Series<T>>;
|
|
150
|
+
constructor(series: Array<Series<T>>);
|
|
151
|
+
as(jsType: "string"): MultiSeries<string>;
|
|
152
|
+
as(jsType: "number"): MultiSeries<number>;
|
|
153
|
+
as(jsType: "bigint"): MultiSeries<bigint>;
|
|
154
|
+
get dataType(): DataType;
|
|
155
|
+
get timeRange(): TimeRange;
|
|
156
|
+
push(series: Series<T>): void;
|
|
157
|
+
get length(): number;
|
|
158
|
+
at(index: number, required: true): T;
|
|
159
|
+
at(index: number, required?: false): T | undefined;
|
|
160
|
+
[Symbol.iterator](): Iterator<T>;
|
|
161
|
+
}
|
|
144
162
|
export {};
|
package/dist/telem/telem.d.ts
CHANGED
|
@@ -570,6 +570,9 @@ export declare class DataType extends String implements Stringer {
|
|
|
570
570
|
/** @returns a string representation of the DataType. */
|
|
571
571
|
toString(): string;
|
|
572
572
|
get isVariable(): boolean;
|
|
573
|
+
get isNumeric(): boolean;
|
|
574
|
+
get isInteger(): boolean;
|
|
575
|
+
get isFloat(): boolean;
|
|
573
576
|
get density(): Density;
|
|
574
577
|
/**
|
|
575
578
|
* Checks whether the given TypedArray is of the same type as the DataType.
|
|
@@ -711,7 +714,7 @@ export interface CrudeTimeRange {
|
|
|
711
714
|
export declare const typedArrayZ: z.ZodUnion<[z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>, z.ZodType<Uint16Array, z.ZodTypeDef, Uint16Array>, z.ZodType<Uint32Array, z.ZodTypeDef, Uint32Array>, z.ZodType<BigUint64Array, z.ZodTypeDef, BigUint64Array>, z.ZodType<Float32Array, z.ZodTypeDef, Float32Array>, z.ZodType<Float64Array, z.ZodTypeDef, Float64Array>, z.ZodType<Int8Array, z.ZodTypeDef, Int8Array>, z.ZodType<Int16Array, z.ZodTypeDef, Int16Array>, z.ZodType<Int32Array, z.ZodTypeDef, Int32Array>, z.ZodType<BigInt64Array, z.ZodTypeDef, BigInt64Array>]>;
|
|
712
715
|
export type TypedArray = z.infer<typeof typedArrayZ>;
|
|
713
716
|
type TypedArrayConstructor = Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | BigUint64ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor | BigInt64ArrayConstructor;
|
|
714
|
-
type NumericTelemValue = number | bigint;
|
|
717
|
+
export type NumericTelemValue = number | bigint;
|
|
715
718
|
export type TelemValue = number | bigint | string | boolean | Date | TimeStamp | TimeSpan;
|
|
716
719
|
export declare const isTelemValue: (value: unknown) => value is TelemValue;
|
|
717
720
|
export declare const convertDataType: (source: DataType, target: DataType, value: NumericTelemValue, offset?: number | bigint) => NumericTelemValue;
|