@synnaxlabs/x 0.14.2 → 0.15.0
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 +5 -5
- package/dist/telem/series.d.ts +34 -14
- package/dist/telem/telem.d.ts +1 -1
- package/dist/x.cjs +7 -7
- package/dist/x.cjs.map +1 -1
- package/dist/x.js +1091 -926
- package/dist/x.js.map +1 -1
- package/package.json +3 -3
- package/src/telem/series.spec.ts +148 -1
- package/src/telem/series.ts +256 -21
- package/src/telem/telem.ts +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @synnaxlabs/x@0.
|
|
2
|
+
> @synnaxlabs/x@0.15.0 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
|
|
@@ -10,8 +10,8 @@ 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[2m217.59 kB[22m[1m[22m[2m │ gzip: 50.60 kB[22m[2m │ map: 651.51 kB[22m
|
|
14
|
+
[32m[36m[vite:dts][32m Declaration files built in 3123ms.
|
|
15
15
|
[39m
|
|
16
|
-
[2mdist/[22m[36mx.cjs [39m[1m[
|
|
17
|
-
[32m✓ built in
|
|
16
|
+
[2mdist/[22m[36mx.cjs [39m[1m[2m143.43 kB[22m[1m[22m[2m │ gzip: 40.54 kB[22m[2m │ map: 630.60 kB[22m
|
|
17
|
+
[32m✓ built in 4.05s[39m
|
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,55 @@ 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(dataType: "string"): Series<string>;
|
|
136
|
+
as(dataType: "number"): Series<number>;
|
|
137
|
+
as(dataType: "bigint"): Series<bigint>;
|
|
138
|
+
as(dataType: "numeric"): Series<NumericTelemValue>;
|
|
135
139
|
get digest(): SeriesDigest;
|
|
136
140
|
get memInfo(): SeriesMemInfo;
|
|
137
141
|
get alignmentBounds(): bounds.Bounds;
|
|
138
142
|
private maybeGarbageCollectGLBuffer;
|
|
139
143
|
get glBuffer(): WebGLBuffer;
|
|
144
|
+
[Symbol.iterator](): Iterator<T>;
|
|
140
145
|
slice(start: number, end?: number): Series;
|
|
141
146
|
reAlign(alignment: number): Series;
|
|
142
147
|
}
|
|
143
|
-
export declare const addSamples: (a:
|
|
148
|
+
export declare const addSamples: (a: NumericTelemValue, b: NumericTelemValue) => NumericTelemValue;
|
|
149
|
+
export declare class MultiSeries<T extends TelemValue = TelemValue> implements Iterable<T> {
|
|
150
|
+
readonly series: Array<Series<T>>;
|
|
151
|
+
constructor(series: Array<Series<T>>);
|
|
152
|
+
as(dataType: "string"): MultiSeries<string>;
|
|
153
|
+
as(dataType: "number"): MultiSeries<number>;
|
|
154
|
+
as(dataType: "bigint"): MultiSeries<bigint>;
|
|
155
|
+
as(dataType: "numeric"): MultiSeries<NumericTelemValue>;
|
|
156
|
+
get dataType(): DataType;
|
|
157
|
+
get timeRange(): TimeRange;
|
|
158
|
+
push(series: Series<T>): void;
|
|
159
|
+
get length(): number;
|
|
160
|
+
at(index: number, required: true): T;
|
|
161
|
+
at(index: number, required?: false): T | undefined;
|
|
162
|
+
[Symbol.iterator](): Iterator<T>;
|
|
163
|
+
}
|
|
144
164
|
export {};
|
package/dist/telem/telem.d.ts
CHANGED
|
@@ -711,7 +711,7 @@ export interface CrudeTimeRange {
|
|
|
711
711
|
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
712
|
export type TypedArray = z.infer<typeof typedArrayZ>;
|
|
713
713
|
type TypedArrayConstructor = Uint8ArrayConstructor | Uint16ArrayConstructor | Uint32ArrayConstructor | BigUint64ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor | Int8ArrayConstructor | Int16ArrayConstructor | Int32ArrayConstructor | BigInt64ArrayConstructor;
|
|
714
|
-
type NumericTelemValue = number | bigint;
|
|
714
|
+
export type NumericTelemValue = number | bigint;
|
|
715
715
|
export type TelemValue = number | bigint | string | boolean | Date | TimeStamp | TimeSpan;
|
|
716
716
|
export declare const isTelemValue: (value: unknown) => value is TelemValue;
|
|
717
717
|
export declare const convertDataType: (source: DataType, target: DataType, value: NumericTelemValue, offset?: number | bigint) => NumericTelemValue;
|