@synnaxlabs/x 0.7.0 → 0.9.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 +8 -7
- package/dist/binary/index.d.ts +1 -1
- package/dist/change/change.d.ts +4 -2
- package/dist/change/index.d.ts +1 -1
- package/dist/compare/index.d.ts +1 -1
- package/dist/deep/delete.d.ts +1 -1
- package/dist/deep/external.d.ts +7 -7
- package/dist/deep/index.d.ts +1 -1
- package/dist/deep/merge.d.ts +1 -1
- package/dist/deep/path.d.ts +37 -0
- package/dist/deep/path.spec.d.ts +1 -0
- package/dist/destructor.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/kv/index.d.ts +1 -1
- package/dist/mock/index.d.ts +1 -1
- package/dist/observe/index.d.ts +1 -1
- package/dist/observe/observe.d.ts +1 -1
- package/dist/runtime/external.d.ts +2 -2
- package/dist/runtime/index.d.ts +1 -1
- package/dist/shallowCopy.d.ts +1 -0
- package/dist/spatial/bounds.d.ts +48 -9
- package/dist/spatial/box.d.ts +9 -35
- package/dist/spatial/dimensions.d.ts +1 -1
- package/dist/spatial/direction.d.ts +1 -1
- package/dist/spatial/external.d.ts +8 -8
- package/dist/spatial/index.d.ts +1 -1
- package/dist/spatial/location.d.ts +1 -1
- package/dist/spatial/position.d.ts +1 -1
- package/dist/spatial/scale.d.ts +5 -5
- package/dist/spatial/spatial.d.ts +1 -1
- package/dist/spatial/xy.d.ts +5 -2
- package/dist/telem/generate.d.ts +1 -1
- package/dist/telem/index.d.ts +3 -3
- package/dist/telem/series.d.ts +31 -5
- package/dist/telem/telem.d.ts +3 -0
- package/dist/toArray.d.ts +1 -0
- package/dist/x.cjs.js +289 -60
- package/dist/x.cjs.js.map +1 -1
- package/dist/x.es.js +289 -60
- package/dist/x.es.js.map +1 -1
- package/package.json +6 -6
- package/src/change/change.ts +13 -11
- package/src/deep/delete.ts +1 -1
- package/src/deep/external.ts +2 -1
- package/src/deep/memo.ts +15 -0
- package/src/deep/path.spec.ts +82 -0
- package/src/deep/path.ts +95 -0
- package/src/destructor.ts +2 -0
- package/src/index.ts +1 -0
- package/src/observe/observe.ts +2 -2
- package/src/shallowCopy.ts +6 -0
- package/src/spatial/bounds.spec.ts +218 -0
- package/src/spatial/bounds.ts +155 -19
- package/src/spatial/box.ts +7 -0
- package/src/spatial/dimensions.ts +5 -0
- package/src/spatial/direction.ts +8 -8
- package/src/spatial/location.ts +11 -0
- package/src/spatial/xy.spec.ts +8 -0
- package/src/spatial/xy.ts +32 -9
- package/src/telem/series.spec.ts +54 -46
- package/src/telem/series.ts +110 -57
- package/src/telem/telem.spec.ts +17 -1
- package/src/telem/telem.ts +33 -0
- package/src/toArray.ts +3 -0
- package/dist/deep/key.d.ts +0 -30
- package/src/deep/key.ts +0 -46
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
> @synnaxlabs/x@0.
|
|
2
|
+
> @synnaxlabs/x@0.9.0 build /Users/emilianobonilla/Desktop/synnaxlabs/synnax/x/ts
|
|
3
3
|
> vite build
|
|
4
4
|
|
|
5
|
-
vite v5.
|
|
5
|
+
vite v5.1.2 building for production...
|
|
6
6
|
transforming...
|
|
7
|
-
|
|
7
|
+
[plugin:vite:resolve] Module "crypto" has been externalized for browser compatibility, imported by "/Users/emilianobonilla/Desktop/synnaxlabs/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.
|
|
8
|
+
✓ 116 modules transformed.
|
|
8
9
|
rendering chunks...
|
|
9
10
|
|
|
10
11
|
[vite:dts] Start generate declaration files...
|
|
11
12
|
computing gzip size...
|
|
12
|
-
dist/x.es.js
|
|
13
|
-
[vite:dts] Declaration files built in
|
|
13
|
+
dist/x.es.js 288.78 kB │ gzip: 54.26 kB │ map: 594.40 kB
|
|
14
|
+
[vite:dts] Declaration files built in 1131ms.
|
|
14
15
|
|
|
15
|
-
dist/x.cjs.js
|
|
16
|
-
✓ built in 1.
|
|
16
|
+
dist/x.cjs.js 289.65 kB │ gzip: 54.40 kB │ map: 594.52 kB
|
|
17
|
+
✓ built in 1.54s
|
package/dist/binary/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as binary from '
|
|
1
|
+
export * as binary from './encoder';
|
package/dist/change/change.d.ts
CHANGED
|
@@ -21,12 +21,14 @@ export declare const Z: <V extends z.ZodTypeAny>(value: V) => z.ZodObject<{
|
|
|
21
21
|
key: z.ZodString;
|
|
22
22
|
value: V;
|
|
23
23
|
}>[k_2]; }>;
|
|
24
|
-
export type
|
|
24
|
+
export type Set<K, V> = {
|
|
25
25
|
variant: "set";
|
|
26
26
|
key: K;
|
|
27
27
|
value: V;
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
|
+
export type Delete<K, V> = {
|
|
29
30
|
variant: "delete";
|
|
30
31
|
key: K;
|
|
31
32
|
value?: V;
|
|
32
33
|
};
|
|
34
|
+
export type Change<K, V> = Set<K, V> | Delete<K, V>;
|
package/dist/change/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as change from '
|
|
1
|
+
export * as change from './change';
|
package/dist/compare/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as compare from '
|
|
1
|
+
export * as compare from './compare';
|
package/dist/deep/delete.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type Key } from '
|
|
1
|
+
import { type Key } from './path';
|
|
2
2
|
export declare const deleteD: <T extends Partial<Record<keyof T, unknown>>, D extends number = 5>(target: T, ...keys: Key<T, D>[]) => T;
|
package/dist/deep/external.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
1
|
+
export * from './copy';
|
|
2
|
+
export * from './delete';
|
|
3
|
+
export * from './path';
|
|
4
|
+
export * from './merge';
|
|
5
|
+
export * from './partial';
|
|
6
|
+
export * from './equal';
|
|
7
|
+
export * from './memo';
|
package/dist/deep/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as deep from '
|
|
1
|
+
export * as deep from './external';
|
package/dist/deep/merge.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type Partial } from '
|
|
1
|
+
import { type Partial } from './partial';
|
|
2
2
|
export declare const merge: <T extends globalThis.Partial<Record<keyof T, unknown>>>(base: T, ...objects: Partial<T>[]) => T;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Join } from '../join';
|
|
2
|
+
import { UnknownRecord } from "..";
|
|
3
|
+
type Prev = [
|
|
4
|
+
never,
|
|
5
|
+
0,
|
|
6
|
+
1,
|
|
7
|
+
2,
|
|
8
|
+
3,
|
|
9
|
+
4,
|
|
10
|
+
5,
|
|
11
|
+
6,
|
|
12
|
+
7,
|
|
13
|
+
8,
|
|
14
|
+
9,
|
|
15
|
+
10,
|
|
16
|
+
11,
|
|
17
|
+
12,
|
|
18
|
+
13,
|
|
19
|
+
14,
|
|
20
|
+
15,
|
|
21
|
+
16,
|
|
22
|
+
17,
|
|
23
|
+
18,
|
|
24
|
+
19,
|
|
25
|
+
20,
|
|
26
|
+
...Array<0>
|
|
27
|
+
];
|
|
28
|
+
export type Key<T, D extends number = 5> = [D] extends [never] ? never : T extends object ? {
|
|
29
|
+
[K in keyof T]-?: K extends string | number ? `${K}` | Join<K, Key<T[K], Prev[D]>> : never;
|
|
30
|
+
}[keyof T] : "";
|
|
31
|
+
export type Get<V extends UnknownRecord = UnknownRecord> = ((obj: V, path: string, allowNull: true) => unknown | null) & ((obj: V, path: string, allowNull: boolean) => unknown);
|
|
32
|
+
export declare const get: Get;
|
|
33
|
+
export declare const set: (obj: UnknownRecord, path: string, value: unknown) => void;
|
|
34
|
+
export declare const element: (path: string, index: number) => string;
|
|
35
|
+
export declare const join: (path: string[]) => string;
|
|
36
|
+
export declare const has: (obj: UnknownRecord, path: string) => boolean;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/destructor.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/kv/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as kv from '
|
|
1
|
+
export * as kv from './types';
|
package/dist/mock/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from './MockGLBufferController';
|
package/dist/observe/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as observe from '
|
|
1
|
+
export * as observe from './observe';
|
|
@@ -5,7 +5,7 @@ export interface Observable<T> {
|
|
|
5
5
|
}
|
|
6
6
|
export declare class Observer<T> implements Observable<T> {
|
|
7
7
|
private readonly handlers;
|
|
8
|
-
constructor();
|
|
8
|
+
constructor(handlers?: Map<Handler<T>, null>);
|
|
9
9
|
onChange(handler: Handler<T>): Destructor;
|
|
10
10
|
notify(value: T): void;
|
|
11
11
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
1
|
+
export * from './detect';
|
|
2
|
+
export * from './os';
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as runtime from '
|
|
1
|
+
export * as runtime from './external';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const shallowCopy: <T extends unknown>(obj: T) => T;
|
package/dist/spatial/bounds.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Bounds, bounds, type CrudeBounds } from '
|
|
1
|
+
import { type Bounds, bounds, type CrudeBounds } from './base';
|
|
2
2
|
export { type Bounds, bounds };
|
|
3
3
|
export type Crude = CrudeBounds;
|
|
4
4
|
export declare const construct: (lower: number | Crude, upper?: number) => Bounds;
|
|
@@ -18,14 +18,53 @@ export declare const CLIP: {
|
|
|
18
18
|
lower: number;
|
|
19
19
|
upper: number;
|
|
20
20
|
};
|
|
21
|
-
export declare const equals: (
|
|
21
|
+
export declare const equals: (_a?: Bounds, _b?: Bounds) => boolean;
|
|
22
22
|
export declare const makeValid: (a: Bounds) => Bounds;
|
|
23
|
-
export declare const clamp: (bounds:
|
|
24
|
-
export declare const contains: (bounds:
|
|
25
|
-
export declare const overlapsWith: (a:
|
|
26
|
-
export declare const span: (a:
|
|
27
|
-
export declare const isZero: (a:
|
|
28
|
-
export declare const spanIsZero: (a:
|
|
29
|
-
export declare const isFinite: (a:
|
|
23
|
+
export declare const clamp: (bounds: Crude, target: number) => number;
|
|
24
|
+
export declare const contains: (bounds: Crude, target: number | CrudeBounds) => boolean;
|
|
25
|
+
export declare const overlapsWith: (a: Crude, b: Crude) => boolean;
|
|
26
|
+
export declare const span: (a: Crude) => number;
|
|
27
|
+
export declare const isZero: (a: Crude) => boolean;
|
|
28
|
+
export declare const spanIsZero: (a: Crude) => boolean;
|
|
29
|
+
export declare const isFinite: (a: Crude) => boolean;
|
|
30
30
|
export declare const max: (bounds: Crude[]) => Bounds;
|
|
31
31
|
export declare const min: (bounds: Crude[]) => Bounds;
|
|
32
|
+
export declare const constructArray: (bounds: Crude) => number[];
|
|
33
|
+
export declare const findInsertPosition: (bounds: Crude[], target: number) => {
|
|
34
|
+
index: number;
|
|
35
|
+
position: number;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* A plan for inserting a new bound into an ordered array of bounds.
|
|
39
|
+
*/
|
|
40
|
+
export interface InsertionPlan {
|
|
41
|
+
/** How much to increase the lower bound of the new bound or decrease the upper bound
|
|
42
|
+
* of the previous bound. */
|
|
43
|
+
removeBefore: number;
|
|
44
|
+
/** How much to decrease the upper bound of the new bound or increase the lower bound
|
|
45
|
+
* of the next bound. */
|
|
46
|
+
removeAfter: number;
|
|
47
|
+
/** The index at which to insert the new bound. */
|
|
48
|
+
insertInto: number;
|
|
49
|
+
/** The number of bounds to remove from the array. */
|
|
50
|
+
deleteInBetween: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Build a plan for inserting a new bound into an ordered array of bounds. This function
|
|
54
|
+
* is particularly useful for inserting a new array into a sorted array of array of arrays
|
|
55
|
+
* that may overlap. The plan is used to determine how to splice the new array into the
|
|
56
|
+
* existing array. The following are important constraints:
|
|
57
|
+
*
|
|
58
|
+
*
|
|
59
|
+
* 1. If the new bound is entirely contained within an existing bound, the new bound
|
|
60
|
+
* is not inserted and the plan is null.
|
|
61
|
+
*
|
|
62
|
+
* @param bounds - An ordered array of bounds, where each bound is valid (i.e., lower <= upper)
|
|
63
|
+
* and the lower bound of each bound is less than the upper bound of the next bound.
|
|
64
|
+
* @param value - The new bound to insert.
|
|
65
|
+
* @returns A plan for inserting the new bound into the array of bounds, or null if the
|
|
66
|
+
* new bound is entirely contained within an existing bound. See the {@link InsertionPlan}
|
|
67
|
+
* type for more details.
|
|
68
|
+
*/
|
|
69
|
+
export declare const buildInsertionPlan: (bounds: Crude[], value: Crude) => InsertionPlan | null;
|
|
70
|
+
export declare const insert: (bounds: Crude[], value: Crude) => Crude[];
|
package/dist/spatial/box.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type * as bounds from '
|
|
3
|
-
import type * as dimensions from '
|
|
4
|
-
import * as direction from '
|
|
5
|
-
import * as location from '
|
|
6
|
-
import * as xy from '
|
|
2
|
+
import type * as bounds from './bounds';
|
|
3
|
+
import type * as dimensions from './dimensions';
|
|
4
|
+
import * as direction from './direction';
|
|
5
|
+
import * as location from './location';
|
|
6
|
+
import * as xy from './xy';
|
|
7
7
|
declare const cssBox: z.ZodObject<{
|
|
8
8
|
top: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
9
9
|
left: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
|
|
@@ -103,29 +103,11 @@ type Crude = DOMRect | Box | {
|
|
|
103
103
|
/** A box centered at (0,0) with a width and height of 0. */
|
|
104
104
|
export declare const ZERO: {
|
|
105
105
|
one: {
|
|
106
|
-
x: number;
|
|
107
|
-
* Box represents a general box in 2D space. It typically represents a bounding box
|
|
108
|
-
* for a DOM element, but can also represent a box in clip space or decimal space.
|
|
109
|
-
*
|
|
110
|
-
* It'simportant to note that the behavior of a Box varies depending on its coordinate
|
|
111
|
-
* system.Make sure you're aware of which coordinate system you're using.
|
|
112
|
-
*
|
|
113
|
-
* Many of the properties and methods on a Box access the same semantic value. The
|
|
114
|
-
* different accessors are there for ease of use and semantics.
|
|
115
|
-
*/
|
|
106
|
+
x: number;
|
|
116
107
|
y: number;
|
|
117
108
|
};
|
|
118
109
|
two: {
|
|
119
|
-
x: number;
|
|
120
|
-
* Box represents a general box in 2D space. It typically represents a bounding box
|
|
121
|
-
* for a DOM element, but can also represent a box in clip space or decimal space.
|
|
122
|
-
*
|
|
123
|
-
* It'simportant to note that the behavior of a Box varies depending on its coordinate
|
|
124
|
-
* system.Make sure you're aware of which coordinate system you're using.
|
|
125
|
-
*
|
|
126
|
-
* Many of the properties and methods on a Box access the same semantic value. The
|
|
127
|
-
* different accessors are there for ease of use and semantics.
|
|
128
|
-
*/
|
|
110
|
+
x: number;
|
|
129
111
|
y: number;
|
|
130
112
|
};
|
|
131
113
|
root: {
|
|
@@ -139,16 +121,7 @@ export declare const ZERO: {
|
|
|
139
121
|
*/
|
|
140
122
|
export declare const DECIMAL: {
|
|
141
123
|
one: {
|
|
142
|
-
x: number;
|
|
143
|
-
* Box represents a general box in 2D space. It typically represents a bounding box
|
|
144
|
-
* for a DOM element, but can also represent a box in clip space or decimal space.
|
|
145
|
-
*
|
|
146
|
-
* It'simportant to note that the behavior of a Box varies depending on its coordinate
|
|
147
|
-
* system.Make sure you're aware of which coordinate system you're using.
|
|
148
|
-
*
|
|
149
|
-
* Many of the properties and methods on a Box access the same semantic value. The
|
|
150
|
-
* different accessors are there for ease of use and semantics.
|
|
151
|
-
*/
|
|
124
|
+
x: number;
|
|
152
125
|
y: number;
|
|
153
126
|
};
|
|
154
127
|
two: {
|
|
@@ -174,6 +147,7 @@ export declare const copy: (b: Box, root?: location.CornerXY) => Box;
|
|
|
174
147
|
export declare const construct: (first: number | DOMRect | xy.XY | Box | {
|
|
175
148
|
getBoundingClientRect: () => DOMRect;
|
|
176
149
|
}, second?: number | xy.XY | dimensions.Dimensions | dimensions.Signed, width?: number, height?: number, coordinateRoot?: location.CornerXY) => Box;
|
|
150
|
+
export declare const resize: (b: Box, dims: dimensions.Dimensions) => Box;
|
|
177
151
|
/**
|
|
178
152
|
* Checks if a box contains a point or another box.
|
|
179
153
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Dimension, type Direction, type Location, type direction, type SignedDimension, type CrudeDirection } from '
|
|
1
|
+
import { type Dimension, type Direction, type Location, type direction, type SignedDimension, type CrudeDirection } from './base';
|
|
2
2
|
export type { Direction, direction };
|
|
3
3
|
export declare const crude: import("zod").ZodUnion<[import("zod").ZodEnum<["x", "y"]>, import("zod").ZodEnum<["top", "right", "bottom", "left", "center"]>]>;
|
|
4
4
|
export type Crude = CrudeDirection;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * as bounds from '
|
|
2
|
-
export * as box from '
|
|
3
|
-
export * as dimensions from '
|
|
4
|
-
export * as direction from '
|
|
5
|
-
export * as location from '
|
|
6
|
-
export * as xy from '
|
|
7
|
-
export * as scale from '
|
|
8
|
-
export * as spatial from '
|
|
1
|
+
export * as bounds from './bounds';
|
|
2
|
+
export * as box from './box';
|
|
3
|
+
export * as dimensions from './dimensions';
|
|
4
|
+
export * as direction from './direction';
|
|
5
|
+
export * as location from './location';
|
|
6
|
+
export * as xy from './xy';
|
|
7
|
+
export * as scale from './scale';
|
|
8
|
+
export * as spatial from './spatial';
|
package/dist/spatial/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from './external';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { location, type Location, X_LOCATIONS, Y_LOCATIONS, CENTER_LOCATIONS, type XLocation, type OuterLocation, type YLocation, outerLocation, type Direction, type CrudeLocation } from '
|
|
2
|
+
import { location, type Location, X_LOCATIONS, Y_LOCATIONS, CENTER_LOCATIONS, type XLocation, type OuterLocation, type YLocation, outerLocation, type Direction, type CrudeLocation } from './base';
|
|
3
3
|
export { location, type Location, X_LOCATIONS, Y_LOCATIONS, CENTER_LOCATIONS, outerLocation as outer, };
|
|
4
4
|
export declare const x: z.ZodEnum<["left", "right"]>;
|
|
5
5
|
export declare const y: z.ZodEnum<["top", "bottom"]>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as xy from '
|
|
1
|
+
import * as xy from './xy';
|
|
2
2
|
export declare const posititonSoVisible: (target: HTMLElement, p: xy.XY) => [xy.XY, boolean];
|
package/dist/spatial/scale.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import * as bounds from '
|
|
3
|
-
import { type Box } from '
|
|
4
|
-
import type * as dims from '
|
|
5
|
-
import * as location from '
|
|
6
|
-
import * as xy from '
|
|
2
|
+
import * as bounds from './bounds';
|
|
3
|
+
import { type Box } from './box';
|
|
4
|
+
import type * as dims from './dimensions';
|
|
5
|
+
import * as location from './location';
|
|
6
|
+
import * as xy from './xy';
|
|
7
7
|
export declare const crudeXYTransform: z.ZodObject<{
|
|
8
8
|
offset: z.ZodUnion<[z.ZodNumber, z.ZodObject<{
|
|
9
9
|
x: z.ZodNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ALIGNMENTS, alignment, type Alignment, ORDERS, order, type Order, } from '
|
|
1
|
+
export { ALIGNMENTS, alignment, type Alignment, ORDERS, order, type Order, } from './base';
|
package/dist/spatial/xy.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { clientXY, xy, type ClientXY, type XY, type Direction } from '
|
|
2
|
+
import { clientXY, xy, type ClientXY, type XY, type Direction } from './base';
|
|
3
3
|
export { clientXY, xy, type ClientXY as Client, type XY };
|
|
4
4
|
/** A crude representation of a {@link XY} coordinate as a zod schema. */
|
|
5
5
|
export declare const crudeZ: z.ZodUnion<[z.ZodNumber, z.ZodObject<{
|
|
@@ -44,7 +44,8 @@ export type Crude = z.infer<typeof crudeZ>;
|
|
|
44
44
|
/**
|
|
45
45
|
* @constructs XY
|
|
46
46
|
* @param x - A crude representation of the XY coordinate as a number, number couple,
|
|
47
|
-
* dimensions, signed dimensions, or
|
|
47
|
+
* dimensions, signed dimensions, or mouse event. If it's a mouse event, the clientX and
|
|
48
|
+
* clientY coordinates are preferred over the x and y coordinates.
|
|
48
49
|
* @param y - If x is a number, the y coordinate. If x is a number and this argument is
|
|
49
50
|
* not given, the y coordinate is assumed to be the same as the x coordinate.
|
|
50
51
|
*/
|
|
@@ -107,6 +108,8 @@ export declare const yDistance: (ca: Crude, cb: Crude) => number;
|
|
|
107
108
|
export declare const translation: (ca: Crude, cb: Crude) => XY;
|
|
108
109
|
/** @returns true if both the x and y coordinates of the given coordinate are NaN. */
|
|
109
110
|
export declare const isNan: (a: Crude) => boolean;
|
|
111
|
+
/** @returns true if both the x and y coordinates of the given coordinate are finite. */
|
|
112
|
+
export declare const isFinite: (a: Crude) => boolean;
|
|
110
113
|
/** @returns the coordinate represented as a couple of the form [x, y]. */
|
|
111
114
|
export declare const couple: (a: Crude) => [number, number];
|
|
112
115
|
/** @returns the coordinate represented as css properties in the form { left, top }. */
|
package/dist/telem/generate.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DataTypeT, NativeTypedArray } from '
|
|
1
|
+
import { DataTypeT, NativeTypedArray } from './telem';
|
|
2
2
|
export declare const randomSeries: (length: number, dataType: DataTypeT) => NativeTypedArray;
|
package/dist/telem/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export type { GLBufferController } from '
|
|
1
|
+
export * from './series';
|
|
2
|
+
export * from './telem';
|
|
3
|
+
export type { GLBufferController } from './gl';
|
package/dist/telem/series.d.ts
CHANGED
|
@@ -1,20 +1,43 @@
|
|
|
1
1
|
import { type z } from "zod";
|
|
2
2
|
import { bounds } from '../spatial';
|
|
3
|
-
import { type GLBufferController, type GLBufferUsage } from '
|
|
4
|
-
import { DataType, type NativeTypedArray, type Rate, Size, TimeRange, type TimeStamp, type CrudeDataType } from '
|
|
3
|
+
import { type GLBufferController, type GLBufferUsage } from './gl';
|
|
4
|
+
import { DataType, type NativeTypedArray, type Rate, Size, TimeRange, type TimeStamp, type CrudeDataType } from './telem';
|
|
5
5
|
export type SampleValue = number | bigint;
|
|
6
6
|
export interface SeriesDigest {
|
|
7
|
+
key: string;
|
|
7
8
|
dataType: string;
|
|
8
9
|
sampleOffset: SampleValue;
|
|
9
|
-
alignment:
|
|
10
|
+
alignment: bounds.Bounds;
|
|
10
11
|
timeRange?: string;
|
|
11
12
|
length: number;
|
|
12
13
|
}
|
|
14
|
+
interface BaseSeriesProps {
|
|
15
|
+
dataType?: CrudeDataType;
|
|
16
|
+
timeRange?: TimeRange;
|
|
17
|
+
sampleOffset?: SampleValue;
|
|
18
|
+
glBufferUsage?: GLBufferUsage;
|
|
19
|
+
alignment?: number;
|
|
20
|
+
key?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SeriesProps extends BaseSeriesProps {
|
|
23
|
+
data: ArrayBuffer | NativeTypedArray;
|
|
24
|
+
}
|
|
25
|
+
export interface SeriesAllocProps extends BaseSeriesProps {
|
|
26
|
+
length: number;
|
|
27
|
+
dataType: CrudeDataType;
|
|
28
|
+
}
|
|
29
|
+
export interface SeriesMemInfo {
|
|
30
|
+
key: string;
|
|
31
|
+
length: number;
|
|
32
|
+
byteLength: Size;
|
|
33
|
+
glBuffer: boolean;
|
|
34
|
+
}
|
|
13
35
|
/**
|
|
14
36
|
* Series is a strongly typed array of telemetry samples backed by an underlying binary
|
|
15
37
|
* buffer.
|
|
16
38
|
*/
|
|
17
39
|
export declare class Series {
|
|
40
|
+
key: string;
|
|
18
41
|
/** The data type of the array */
|
|
19
42
|
readonly dataType: DataType;
|
|
20
43
|
/**
|
|
@@ -39,12 +62,12 @@ export declare class Series {
|
|
|
39
62
|
private writePos;
|
|
40
63
|
/** Tracks the number of entities currently using this array. */
|
|
41
64
|
private _refCount;
|
|
42
|
-
static alloc(length
|
|
65
|
+
static alloc({ length, dataType, ...props }: SeriesAllocProps): Series;
|
|
43
66
|
static generateTimestamps(length: number, rate: Rate, start: TimeStamp): Series;
|
|
44
67
|
get refCount(): number;
|
|
45
68
|
static fromStrings(data: string[], timeRange?: TimeRange): Series;
|
|
46
69
|
static fromJSON<T>(data: T[], timeRange?: TimeRange): Series;
|
|
47
|
-
constructor(data
|
|
70
|
+
constructor({ data, dataType, timeRange, sampleOffset, glBufferUsage, alignment, key, }: SeriesProps);
|
|
48
71
|
acquire(gl?: GLBufferController): void;
|
|
49
72
|
release(): void;
|
|
50
73
|
write(other: Series): number;
|
|
@@ -96,9 +119,12 @@ export declare class Series {
|
|
|
96
119
|
binarySearch(value: SampleValue): number;
|
|
97
120
|
updateGLBuffer(gl: GLBufferController): void;
|
|
98
121
|
get digest(): SeriesDigest;
|
|
122
|
+
get memInfo(): SeriesMemInfo;
|
|
123
|
+
get alignmentBounds(): bounds.Bounds;
|
|
99
124
|
private maybeGarbageCollectGLBuffer;
|
|
100
125
|
get glBuffer(): WebGLBuffer;
|
|
101
126
|
slice(start: number, end?: number): Series;
|
|
102
127
|
reAlign(alignment: number): Series;
|
|
103
128
|
}
|
|
104
129
|
export declare const addSamples: (a: SampleValue, b: SampleValue) => SampleValue;
|
|
130
|
+
export {};
|
package/dist/telem/telem.d.ts
CHANGED
|
@@ -467,6 +467,7 @@ export declare class TimeRange implements Stringer {
|
|
|
467
467
|
overlapsWith(other: TimeRange): boolean;
|
|
468
468
|
contains(other: TimeRange): boolean;
|
|
469
469
|
contains(ts: CrudeTimeStamp): boolean;
|
|
470
|
+
boundBy(other: TimeRange): TimeRange;
|
|
470
471
|
/** The maximum possible time range. */
|
|
471
472
|
static readonly MAX: TimeRange;
|
|
472
473
|
/** The minimum possible time range. */
|
|
@@ -543,6 +544,8 @@ export declare class DataType extends String implements Stringer {
|
|
|
543
544
|
static readonly ARRAY_CONSTRUCTORS: Map<string, NativeTypedArrayConstructor>;
|
|
544
545
|
static readonly ARRAY_CONSTRUCTOR_DATA_TYPES: Map<string, DataType>;
|
|
545
546
|
static readonly DENSITIES: Map<string, Density>;
|
|
547
|
+
/** All the data types. */
|
|
548
|
+
static readonly ALL: DataType[];
|
|
546
549
|
static readonly BIG_INT_TYPES: DataType[];
|
|
547
550
|
/** A zod schema for a DataType. */
|
|
548
551
|
static readonly z: z.ZodUnion<[z.ZodEffects<z.ZodString, DataType, string>, z.ZodType<DataType, z.ZodTypeDef, DataType>]>;
|
package/dist/toArray.d.ts
CHANGED