@synnaxlabs/x 0.9.0 → 0.11.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 +12 -12
- package/dist/case.d.ts +2 -2
- package/dist/deep/copy.d.ts +1 -1
- package/dist/deep/delete.d.ts +1 -1
- package/dist/deep/equal.d.ts +2 -8
- package/dist/deep/merge.d.ts +1 -1
- package/dist/deep/path.d.ts +3 -4
- package/dist/identity.d.ts +2 -1
- package/dist/record.d.ts +5 -6
- package/dist/search.d.ts +3 -3
- package/dist/spatial/box.d.ts +1 -0
- package/dist/telem/telem.d.ts +3 -2
- package/dist/x.cjs.js +26 -9
- package/dist/x.cjs.js.map +1 -1
- package/dist/x.es.js +26 -9
- package/dist/x.es.js.map +1 -1
- package/package.json +4 -3
- package/src/case.ts +2 -6
- package/src/deep/copy.ts +1 -3
- package/src/deep/delete.ts +1 -2
- package/src/deep/equal.ts +6 -7
- package/src/deep/merge.ts +1 -3
- package/src/deep/path.spec.ts +16 -3
- package/src/deep/path.ts +15 -14
- package/src/record.ts +2 -19
- package/src/search.ts +3 -3
- package/src/spatial/box.ts +12 -1
- package/src/telem/encode.ts +6 -6
- package/src/telem/generate.ts +3 -3
- package/src/telem/series.spec.ts +132 -78
- package/src/telem/series.ts +2 -3
- package/src/telem/telem.ts +7 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
> @synnaxlabs/x@0.
|
|
3
|
-
> vite build
|
|
2
|
+
> @synnaxlabs/x@0.11.0 build /home/runner/work/synnax/synnax/x/ts
|
|
3
|
+
> tsc --noEmit && vite build
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[36mvite v5.1.2 [32mbuilding for production...[36m[39m
|
|
6
6
|
transforming...
|
|
7
|
-
[plugin:vite:resolve]
|
|
8
|
-
|
|
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 116 modules transformed.
|
|
9
9
|
rendering chunks...
|
|
10
|
-
|
|
11
|
-
[vite:dts] Start generate declaration files
|
|
10
|
+
[32m
|
|
11
|
+
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
12
12
|
computing gzip size...
|
|
13
|
-
|
|
14
|
-
[vite:dts] Declaration files built in
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
✓ built in
|
|
13
|
+
[2mdist/[22m[36mx.es.js [39m[1m[2m289.25 kB[22m[1m[22m[2m │ gzip: 54.55 kB[22m[2m │ map: 594.27 kB[22m
|
|
14
|
+
[32m[36m[vite:dts][32m Declaration files built in 2781ms.
|
|
15
|
+
[39m
|
|
16
|
+
[2mdist/[22m[36mx.cjs.js [39m[1m[2m290.12 kB[22m[1m[22m[2m │ gzip: 54.70 kB[22m[2m │ map: 594.39 kB[22m
|
|
17
|
+
[32m✓ built in 3.62s[39m
|
package/dist/case.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare namespace Case {
|
|
2
|
-
const toSnake: <T>(entity: T) =>
|
|
3
|
-
const toCamel: <T
|
|
2
|
+
const toSnake: <T>(entity: T) => T;
|
|
3
|
+
const toCamel: <T>(entity: T) => T;
|
|
4
4
|
const capitalize: (str: string) => string;
|
|
5
5
|
}
|
package/dist/deep/copy.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const copy: <T
|
|
1
|
+
export declare const copy: <T>(obj: T) => T;
|
package/dist/deep/delete.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type Key } from './path';
|
|
2
|
-
export declare const deleteD: <T extends
|
|
2
|
+
export declare const deleteD: <T extends unknown, D extends number = 5>(target: T, ...keys: Key<T, D>[]) => T;
|
package/dist/deep/equal.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
type DeepEqualBaseRecord = UnknownRecord | {
|
|
4
|
-
equals?: (other: any) => boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare const equal: <T extends DeepEqualBaseRecord | DeepEqualBaseRecord[] | Primitive[]>(a: T, b: T) => boolean;
|
|
7
|
-
export declare const partialEqual: <T extends Partial<Record<keyof T, unknown>>>(base: T, partial: Partial<T>) => boolean;
|
|
8
|
-
export {};
|
|
1
|
+
export declare const equal: <T extends unknown>(a: T, b: T) => boolean;
|
|
2
|
+
export declare const partialEqual: <T extends unknown>(base: T, partial: Partial<T>) => boolean;
|
package/dist/deep/merge.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type Partial } from './partial';
|
|
2
|
-
export declare const merge: <T
|
|
2
|
+
export declare const merge: <T>(base: T, ...objects: Partial<T>[]) => T;
|
package/dist/deep/path.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type Join } from '../join';
|
|
2
|
-
import { UnknownRecord } from "..";
|
|
3
2
|
type Prev = [
|
|
4
3
|
never,
|
|
5
4
|
0,
|
|
@@ -28,10 +27,10 @@ type Prev = [
|
|
|
28
27
|
export type Key<T, D extends number = 5> = [D] extends [never] ? never : T extends object ? {
|
|
29
28
|
[K in keyof T]-?: K extends string | number ? `${K}` | Join<K, Key<T[K], Prev[D]>> : never;
|
|
30
29
|
}[keyof T] : "";
|
|
31
|
-
export type Get
|
|
30
|
+
export type Get = (<T>(obj: T, path: string, allowNull: true) => unknown | null) & (<T>(obj: T, path: string, allowNull?: boolean) => unknown);
|
|
32
31
|
export declare const get: Get;
|
|
33
|
-
export declare const set: (obj:
|
|
32
|
+
export declare const set: <V>(obj: V, path: string, value: unknown) => void;
|
|
34
33
|
export declare const element: (path: string, index: number) => string;
|
|
35
34
|
export declare const join: (path: string[]) => string;
|
|
36
|
-
export declare const has: (obj:
|
|
35
|
+
export declare const has: <V>(obj: V, path: string) => boolean;
|
|
37
36
|
export {};
|
package/dist/identity.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { type UnknownRecord } from './record';
|
|
2
|
+
export declare const isObject: <T extends UnknownRecord = UnknownRecord>(item?: unknown) => item is T;
|
package/dist/record.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type RenderableValue } from './renderable';
|
|
3
2
|
export type Key = string | number | symbol;
|
|
4
|
-
export type
|
|
3
|
+
export type UnknownRecord = {
|
|
4
|
+
[key: Key]: unknown;
|
|
5
|
+
};
|
|
6
|
+
export type Keyed<K extends Key> = {
|
|
5
7
|
key: K;
|
|
6
|
-
}
|
|
7
|
-
export type UnknownRecord<E extends Record<Key, unknown> = Record<Key, unknown>> = Partial<Record<keyof E, unknown>>;
|
|
8
|
-
export type RenderableRecord<E extends Record<string, RenderableValue> = Record<string, RenderableValue>> = E;
|
|
9
|
-
export type KeyedRenderableRecord<K extends Key = Key, E extends Record<string, RenderableValue> = Record<string, RenderableValue>> = KeyedRecord<K, E> & Omit<RenderableRecord<E>, "key">;
|
|
8
|
+
};
|
|
10
9
|
export declare const unknownRecordZ: z.ZodRecord<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodSymbol]>, z.ZodUnknown>;
|
|
11
10
|
export type Entries<T> = {
|
|
12
11
|
[K in keyof T]: [K, T[K]];
|
package/dist/search.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { type CompareF } from './compare/compare';
|
|
2
|
-
import { type Key, type
|
|
2
|
+
import { type Key, type Keyed } from './record';
|
|
3
3
|
export declare const Search: {
|
|
4
4
|
binary: <T>(arr: T[], target: T, compare: CompareF<T>) => number;
|
|
5
5
|
};
|
|
6
|
-
export interface TermSearcher<T, K extends Key, E extends
|
|
6
|
+
export interface TermSearcher<T, K extends Key, E extends Keyed<K>> {
|
|
7
7
|
search: (term: T) => E[];
|
|
8
8
|
retrieve: (keys: K[]) => E[];
|
|
9
9
|
page: (offset: number, limit: number) => E[];
|
|
10
10
|
}
|
|
11
|
-
export interface AsyncTermSearcher<T, K extends Key, E extends
|
|
11
|
+
export interface AsyncTermSearcher<T, K extends Key, E extends Keyed<K>> {
|
|
12
12
|
search: (term: T) => Promise<E[]>;
|
|
13
13
|
retrieve: (keys: K[]) => Promise<E[]>;
|
|
14
14
|
page: (offset: number, limit: number) => Promise<E[]>;
|
package/dist/spatial/box.d.ts
CHANGED
package/dist/telem/telem.d.ts
CHANGED
|
@@ -200,6 +200,7 @@ export declare class TimeSpan extends Number implements Stringer {
|
|
|
200
200
|
constructor(value: CrudeTimeSpan);
|
|
201
201
|
remainder(divisor: TimeSpan): TimeSpan;
|
|
202
202
|
truncate(span: TimeSpan): TimeSpan;
|
|
203
|
+
multiply(factor: number): TimeSpan;
|
|
203
204
|
toString(): string;
|
|
204
205
|
/** @returns the decimal number of days in the timespan */
|
|
205
206
|
get days(): number;
|
|
@@ -625,8 +626,8 @@ export type DataTypeT = string;
|
|
|
625
626
|
export type CrudeSize = Size | number | Number;
|
|
626
627
|
export type SizeT = number;
|
|
627
628
|
export interface CrudeTimeRange {
|
|
628
|
-
start:
|
|
629
|
-
end:
|
|
629
|
+
start: CrudeTimeStamp;
|
|
630
|
+
end: CrudeTimeStamp;
|
|
630
631
|
}
|
|
631
632
|
export declare const nativeTypedArray: 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>]>;
|
|
632
633
|
export type NativeTypedArray = z.infer<typeof nativeTypedArray>;
|
package/dist/x.cjs.js
CHANGED
|
@@ -4740,7 +4740,7 @@ const translateY = (c, y2) => {
|
|
|
4740
4740
|
const p = construct$2(c);
|
|
4741
4741
|
return { x: p.x, y: p.y + y2 };
|
|
4742
4742
|
};
|
|
4743
|
-
const translate = (a, b, v, ...cb) => {
|
|
4743
|
+
const translate$1 = (a, b, v, ...cb) => {
|
|
4744
4744
|
if (typeof b === "string" && typeof v === "number") {
|
|
4745
4745
|
if (b === "x")
|
|
4746
4746
|
return translateX(a, v);
|
|
@@ -4811,7 +4811,7 @@ const xy = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
4811
4811
|
isZero: isZero$1,
|
|
4812
4812
|
scale: scale$2,
|
|
4813
4813
|
set: set$1,
|
|
4814
|
-
translate,
|
|
4814
|
+
translate: translate$1,
|
|
4815
4815
|
translateX,
|
|
4816
4816
|
translateY,
|
|
4817
4817
|
translation,
|
|
@@ -4950,7 +4950,7 @@ const right = (b) => loc(b, "right");
|
|
|
4950
4950
|
const bottom = (b) => loc(b, "bottom");
|
|
4951
4951
|
const left = (b) => loc(b, "left");
|
|
4952
4952
|
const top = (b) => loc(b, "top");
|
|
4953
|
-
const center = (b) => translate(topLeft(b), {
|
|
4953
|
+
const center = (b) => translate$1(topLeft(b), {
|
|
4954
4954
|
x: signedWidth(b) / 2,
|
|
4955
4955
|
y: signedHeight(b) / 2
|
|
4956
4956
|
});
|
|
@@ -4997,6 +4997,16 @@ const isBox = (value) => {
|
|
|
4997
4997
|
return "one" in value && "two" in value && "root" in value;
|
|
4998
4998
|
};
|
|
4999
4999
|
const aspect = (b) => width(b) / height(b);
|
|
5000
|
+
const translate = (b, t) => {
|
|
5001
|
+
const b_ = construct$1(b);
|
|
5002
|
+
return construct$1(
|
|
5003
|
+
translate$1(b_.one, t),
|
|
5004
|
+
translate$1(b_.two, t),
|
|
5005
|
+
void 0,
|
|
5006
|
+
void 0,
|
|
5007
|
+
b_.root
|
|
5008
|
+
);
|
|
5009
|
+
};
|
|
5000
5010
|
const box$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5001
5011
|
__proto__: null,
|
|
5002
5012
|
DECIMAL: DECIMAL$1,
|
|
@@ -5032,6 +5042,7 @@ const box$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
5032
5042
|
top,
|
|
5033
5043
|
topLeft,
|
|
5034
5044
|
topRight,
|
|
5045
|
+
translate,
|
|
5035
5046
|
width,
|
|
5036
5047
|
x,
|
|
5037
5048
|
xBounds,
|
|
@@ -5709,6 +5720,9 @@ const _TimeSpan = class _TimeSpan extends Number {
|
|
|
5709
5720
|
truncate(span2) {
|
|
5710
5721
|
return new _TimeSpan(Math.trunc(this.valueOf() / span2.valueOf()) * span2.valueOf());
|
|
5711
5722
|
}
|
|
5723
|
+
multiply(factor) {
|
|
5724
|
+
return new _TimeSpan(this.valueOf() * factor);
|
|
5725
|
+
}
|
|
5712
5726
|
toString() {
|
|
5713
5727
|
const totalDays = this.truncate(_TimeSpan.DAY);
|
|
5714
5728
|
const totalHours = this.truncate(_TimeSpan.HOUR);
|
|
@@ -6697,9 +6711,8 @@ class Series {
|
|
|
6697
6711
|
if (!this.dataType.equals(DataType.FLOAT32))
|
|
6698
6712
|
throw new Error("Only FLOAT32 arrays can be used in WebGL");
|
|
6699
6713
|
const { buffer, bufferUsage, prevBuffer } = this.gl;
|
|
6700
|
-
if (buffer == null)
|
|
6714
|
+
if (buffer == null)
|
|
6701
6715
|
this.gl.buffer = gl.createBuffer();
|
|
6702
|
-
}
|
|
6703
6716
|
if (this.writePos === prevBuffer)
|
|
6704
6717
|
return;
|
|
6705
6718
|
gl.bindBuffer(gl.ARRAY_BUFFER, this.gl.buffer);
|
|
@@ -6748,6 +6761,7 @@ class Series {
|
|
|
6748
6761
|
gl.deleteBuffer(this.gl.buffer);
|
|
6749
6762
|
this.gl.buffer = null;
|
|
6750
6763
|
this.gl.prevBuffer = 0;
|
|
6764
|
+
this.gl.control = null;
|
|
6751
6765
|
}
|
|
6752
6766
|
get glBuffer() {
|
|
6753
6767
|
if (this.gl.buffer == null)
|
|
@@ -6857,8 +6871,10 @@ const deleteD = (target2, ...keys) => {
|
|
|
6857
6871
|
});
|
|
6858
6872
|
return target2;
|
|
6859
6873
|
};
|
|
6860
|
-
const get = (obj, path, allowNull) => {
|
|
6874
|
+
const get = (obj, path, allowNull = false) => {
|
|
6861
6875
|
const parts = path.split(".");
|
|
6876
|
+
if (parts.length === 1 && parts[0] === "")
|
|
6877
|
+
return obj;
|
|
6862
6878
|
let result = obj;
|
|
6863
6879
|
for (const part of parts) {
|
|
6864
6880
|
const v = result[part];
|
|
@@ -6932,13 +6948,12 @@ const equal = (a, b) => {
|
|
|
6932
6948
|
const bArr = b;
|
|
6933
6949
|
if (aArr.length !== bArr.length)
|
|
6934
6950
|
return false;
|
|
6935
|
-
for (let i = 0; i < aArr.length; i++)
|
|
6951
|
+
for (let i = 0; i < aArr.length; i++)
|
|
6936
6952
|
if (!equal(aArr[i], bArr[i]))
|
|
6937
6953
|
return false;
|
|
6938
|
-
}
|
|
6939
6954
|
return true;
|
|
6940
6955
|
}
|
|
6941
|
-
if (typeof a !== "object" || typeof b !== "object")
|
|
6956
|
+
if (a == null || b == null || typeof a !== "object" || typeof b !== "object")
|
|
6942
6957
|
return a === b;
|
|
6943
6958
|
if ("equals" in a)
|
|
6944
6959
|
return a.equals(b);
|
|
@@ -6958,6 +6973,8 @@ const equal = (a, b) => {
|
|
|
6958
6973
|
return true;
|
|
6959
6974
|
};
|
|
6960
6975
|
const partialEqual = (base, partial) => {
|
|
6976
|
+
if (typeof base !== "object" || base == null)
|
|
6977
|
+
return base === partial;
|
|
6961
6978
|
const baseKeys = Object.keys(base);
|
|
6962
6979
|
const partialKeys = Object.keys(partial);
|
|
6963
6980
|
if (partialKeys.length > baseKeys.length)
|