@synnaxlabs/x 0.11.0 → 0.13.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.
Files changed (80) hide show
  1. package/.turbo/turbo-build.log +6 -6
  2. package/dist/deep/difference.d.ts +3 -0
  3. package/dist/deep/external.d.ts +1 -0
  4. package/dist/index.d.ts +1 -0
  5. package/dist/invert.d.ts +1 -0
  6. package/dist/optional.d.ts +3 -0
  7. package/dist/spatial/{bounds.d.ts → bounds/bounds.d.ts} +1 -1
  8. package/dist/spatial/bounds/index.d.ts +1 -0
  9. package/dist/spatial/{box.d.ts → box/box.d.ts} +25 -8
  10. package/dist/spatial/box/index.d.ts +1 -0
  11. package/dist/spatial/{dimensions.d.ts → dimensions/dimensions.d.ts} +1 -1
  12. package/dist/spatial/dimensions/index.d.ts +1 -0
  13. package/dist/spatial/{direction.d.ts → direction/direction.d.ts} +1 -1
  14. package/dist/spatial/direction/index.d.ts +1 -0
  15. package/dist/spatial/external.d.ts +8 -7
  16. package/dist/spatial/location/index.d.ts +1 -0
  17. package/dist/spatial/{location.d.ts → location/location.d.ts} +12 -9
  18. package/dist/spatial/position/index.d.ts +1 -0
  19. package/dist/spatial/position/position.d.ts +20 -0
  20. package/dist/spatial/scale/index.d.ts +1 -0
  21. package/dist/spatial/{scale.d.ts → scale/scale.d.ts} +5 -5
  22. package/dist/spatial/scale/scale.spec.d.ts +1 -0
  23. package/dist/spatial/xy/index.d.ts +1 -0
  24. package/dist/spatial/{xy.d.ts → xy/xy.d.ts} +10 -9
  25. package/dist/spatial/xy/xy.spec.d.ts +1 -0
  26. package/dist/telem/series.d.ts +18 -8
  27. package/dist/telem/telem.d.ts +21 -1
  28. package/dist/{x.cjs.js → x.cjs} +401 -55
  29. package/dist/x.cjs.map +1 -0
  30. package/dist/{x.es.js → x.js} +401 -55
  31. package/dist/x.js.map +1 -0
  32. package/package.json +7 -6
  33. package/src/deep/difference.spec.ts +38 -0
  34. package/src/deep/difference.ts +47 -0
  35. package/src/deep/external.ts +1 -0
  36. package/src/deep/memo.ts +10 -1
  37. package/src/index.ts +1 -0
  38. package/src/invert.ts +1 -0
  39. package/src/optional.ts +5 -0
  40. package/src/shallowCopy.ts +10 -1
  41. package/src/spatial/{bounds.spec.ts → bounds/bounds.spec.ts} +150 -68
  42. package/src/spatial/{bounds.ts → bounds/bounds.ts} +0 -1
  43. package/src/spatial/bounds/index.ts +10 -0
  44. package/src/spatial/{box.spec.ts → box/box.spec.ts} +106 -3
  45. package/src/spatial/{box.ts → box/box.ts} +107 -22
  46. package/src/spatial/box/index.ts +10 -0
  47. package/src/spatial/{dimensions.spec.ts → dimensions/dimensions.spec.ts} +1 -1
  48. package/src/spatial/dimensions/index.ts +10 -0
  49. package/src/spatial/{direction.spec.ts → direction/direction.spec.ts} +1 -1
  50. package/src/spatial/direction/index.ts +10 -0
  51. package/src/spatial/external.ts +8 -7
  52. package/src/spatial/location/index.ts +10 -0
  53. package/src/spatial/{location.spec.ts → location/location.spec.ts} +1 -1
  54. package/src/spatial/{location.ts → location/location.ts} +67 -29
  55. package/src/spatial/position/index.ts +10 -0
  56. package/src/spatial/position/position.spec.ts +211 -0
  57. package/src/spatial/position/position.ts +174 -0
  58. package/src/spatial/scale/index.ts +10 -0
  59. package/src/spatial/{scale.spec.ts → scale/scale.spec.ts} +2 -2
  60. package/src/spatial/{scale.ts → scale/scale.ts} +6 -6
  61. package/src/spatial/xy/index.ts +10 -0
  62. package/src/spatial/{xy.spec.ts → xy/xy.spec.ts} +1 -1
  63. package/src/spatial/{xy.ts → xy/xy.ts} +19 -14
  64. package/src/telem/series.spec.ts +37 -19
  65. package/src/telem/series.ts +34 -22
  66. package/src/telem/telem.spec.ts +106 -24
  67. package/src/telem/telem.ts +73 -2
  68. package/dist/spatial/position.d.ts +0 -2
  69. package/dist/x.cjs.js.map +0 -1
  70. package/dist/x.es.js.map +0 -1
  71. package/src/spatial/position.ts +0 -26
  72. /package/dist/{spatial/bounds.spec.d.ts → deep/difference.spec.d.ts} +0 -0
  73. /package/dist/spatial/{box.spec.d.ts → bounds/bounds.spec.d.ts} +0 -0
  74. /package/dist/spatial/{dimensions.spec.d.ts → box/box.spec.d.ts} +0 -0
  75. /package/dist/spatial/{direction.spec.d.ts → dimensions/dimensions.spec.d.ts} +0 -0
  76. /package/dist/spatial/{location.spec.d.ts → direction/direction.spec.d.ts} +0 -0
  77. /package/dist/spatial/{scale.spec.d.ts → location/location.spec.d.ts} +0 -0
  78. /package/dist/spatial/{xy.spec.d.ts → position/position.spec.d.ts} +0 -0
  79. /package/src/spatial/{dimensions.ts → dimensions/dimensions.ts} +0 -0
  80. /package/src/spatial/{direction.ts → direction/direction.ts} +0 -0
@@ -1,17 +1,17 @@
1
1
 
2
- > @synnaxlabs/x@0.11.0 build /home/runner/work/synnax/synnax/x/ts
2
+ > @synnaxlabs/x@0.13.0 build /home/runner/work/synnax/synnax/x/ts
3
3
  > tsc --noEmit && vite build
4
4
 
5
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 "/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.
8
- ✓ 116 modules transformed.
8
+ ✓ 127 modules transformed.
9
9
  rendering chunks...
10
10
  
11
11
  [vite:dts] Start generate declaration files...
12
12
  computing gzip size...
13
- dist/x.es.js 289.25 kB │ gzip: 54.55 kB │ map: 594.27 kB
14
- [vite:dts] Declaration files built in 2781ms.
13
+ dist/x.js 299.72 kB │ gzip: 56.93 kB │ map: 617.77 kB
14
+ [vite:dts] Declaration files built in 2906ms.
15
15
  
16
- dist/x.cjs.js 290.12 kB │ gzip: 54.70 kB │ map: 594.39 kB
17
- ✓ built in 3.62s
16
+ dist/x.cjs 300.61 kB │ gzip: 57.08 kB │ map: 617.89 kB
17
+ ✓ built in 3.78s
@@ -0,0 +1,3 @@
1
+ type PathValueTuple = [any, any];
2
+ export declare const difference: (obj1: Record<string, any>, obj2: Record<string, any>, path?: string) => Record<string, PathValueTuple>;
3
+ export {};
@@ -5,3 +5,4 @@ export * from './merge';
5
5
  export * from './partial';
6
6
  export * from './equal';
7
7
  export * from './memo';
8
+ export * from './difference';
package/dist/index.d.ts CHANGED
@@ -24,3 +24,4 @@ export * from './binary';
24
24
  export * from './observe';
25
25
  export * from './change';
26
26
  export * from './shallowCopy';
27
+ export * from './invert';
@@ -0,0 +1 @@
1
+ export declare const invert: (condition: boolean) => -1 | 1;
@@ -1 +1,4 @@
1
1
  export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
2
+ export type Required<T> = {
3
+ [P in keyof T]-?: T[P];
4
+ };
@@ -1,4 +1,4 @@
1
- import { type Bounds, bounds, type CrudeBounds } from './base';
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;
@@ -0,0 +1 @@
1
+ export * as bounds from './bounds';
@@ -1,9 +1,9 @@
1
1
  import { z } from "zod";
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';
2
+ import type * as bounds from '../bounds/bounds';
3
+ import type * as dimensions from '../dimensions/dimensions';
4
+ import * as direction from '../direction/direction';
5
+ import * as location from '../location/location';
6
+ import * as xy from '../xy/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]>;
@@ -97,7 +97,7 @@ export declare const box: z.ZodObject<{
97
97
  export type Box = z.infer<typeof box>;
98
98
  export type CSS = z.infer<typeof cssBox>;
99
99
  export type DOMRect = z.infer<typeof domRect>;
100
- type Crude = DOMRect | Box | {
100
+ export type Crude = DOMRect | Box | {
101
101
  getBoundingClientRect: () => DOMRect;
102
102
  };
103
103
  /** A box centered at (0,0) with a width and height of 0. */
@@ -147,7 +147,20 @@ export declare const copy: (b: Box, root?: location.CornerXY) => Box;
147
147
  export declare const construct: (first: number | DOMRect | xy.XY | Box | {
148
148
  getBoundingClientRect: () => DOMRect;
149
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;
150
+ export interface Resize {
151
+ /**
152
+ * Sets the dimensions of the box to the given dimensions.
153
+ * @example resize(b, { width: 10, height: 10 }) // Sets the box to a 10x10 box.
154
+ */
155
+ (b: Crude, dims: dimensions.Dimensions | dimensions.Signed): Box;
156
+ /**
157
+ * Sets the dimension along the given direction to the given amount.
158
+ * @example resize(b, "x", 10) // Sets the width of the box to 10.
159
+ * @example resize(b, "y", 10) // Sets the height of the box to 10.
160
+ */
161
+ (b: Crude, direction: direction.Direction, amount: number): Box;
162
+ }
163
+ export declare const resize: Resize;
151
164
  /**
152
165
  * Checks if a box contains a point or another box.
153
166
  *
@@ -236,5 +249,9 @@ export declare const isBox: (value: unknown) => value is {
236
249
  };
237
250
  };
238
251
  export declare const aspect: (b: Box) => number;
239
- export declare const translate: (b: Box, t: xy.XY) => Box;
252
+ export declare const translate: (b: Crude, t: xy.XY | direction.Direction, amount?: number) => Box;
253
+ export declare const intersect: (a: Box, b: Box) => Box;
254
+ export declare const area: (b: Box) => number;
255
+ export declare const truncate: (b: Box, precision?: number) => Box;
256
+ export declare const constructWithAlternateRoot: (x: number, y: number, width: number, height: number, currRoot: location.XY, newRoot: location.CornerXY) => Box;
240
257
  export {};
@@ -0,0 +1 @@
1
+ export * as box from './box';
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { dimensions, type Dimensions } from './base';
2
+ import { dimensions, type Dimensions } from '../base';
3
3
  export { dimensions, type Dimensions };
4
4
  export declare const signed: z.ZodObject<{
5
5
  signedWidth: z.ZodNumber;
@@ -0,0 +1 @@
1
+ export * as dimensions from './dimensions';
@@ -1,4 +1,4 @@
1
- import { type Dimension, type Direction, type Location, type direction, type SignedDimension, type CrudeDirection } from './base';
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;
@@ -0,0 +1 @@
1
+ export * as direction from './direction';
@@ -1,8 +1,9 @@
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';
1
+ export * from './bounds';
2
+ export { box } from './box';
3
+ export * from './dimensions';
4
+ export * from './direction';
5
+ export * from './location';
6
+ export * from './xy';
7
+ export * from './scale';
8
+ export * from './position';
8
9
  export * as spatial from './spatial';
@@ -0,0 +1 @@
1
+ export * as location from './location';
@@ -1,11 +1,12 @@
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 './base';
2
+ import { location, type Location, X_LOCATIONS, Y_LOCATIONS, CENTER_LOCATIONS, type XLocation, type OuterLocation, type YLocation, outerLocation, type Direction, type CrudeLocation, type CenterLocation } 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"]>;
6
6
  export type X = XLocation;
7
7
  export type Y = YLocation;
8
8
  export type Outer = OuterLocation;
9
+ export type Center = CenterLocation;
9
10
  export declare const crude: z.ZodUnion<[z.ZodEnum<["x", "y"]>, z.ZodEnum<["top", "right", "bottom", "left", "center"]>, z.ZodType<String, z.ZodTypeDef, String>]>;
10
11
  export type Crude = CrudeLocation;
11
12
  export declare const construct: (cl: Crude) => Location;
@@ -13,14 +14,14 @@ export declare const swap: (cl: Crude) => Location;
13
14
  export declare const rotate90: (cl: Crude) => Location;
14
15
  export declare const direction: (cl: Crude) => Direction;
15
16
  export declare const xy: z.ZodObject<{
16
- x: z.ZodEnum<["top", "right", "bottom", "left", "center"]>;
17
- y: z.ZodEnum<["top", "right", "bottom", "left", "center"]>;
17
+ x: z.ZodUnion<[z.ZodEnum<["left", "right"]>, z.ZodEnum<["center"]>]>;
18
+ y: z.ZodUnion<[z.ZodEnum<["top", "bottom"]>, z.ZodEnum<["center"]>]>;
18
19
  }, "strip", z.ZodTypeAny, {
19
- x: "center" | "top" | "right" | "bottom" | "left";
20
- y: "center" | "top" | "right" | "bottom" | "left";
20
+ x: "center" | "right" | "left";
21
+ y: "center" | "top" | "bottom";
21
22
  }, {
22
- x: "center" | "top" | "right" | "bottom" | "left";
23
- y: "center" | "top" | "right" | "bottom" | "left";
23
+ x: "center" | "right" | "left";
24
+ y: "center" | "top" | "bottom";
24
25
  }>;
25
26
  export declare const corner: z.ZodObject<{
26
27
  x: z.ZodEnum<["left", "right"]>;
@@ -44,9 +45,11 @@ export declare const TOP_CENTER: XY;
44
45
  export declare const BOTTOM_CENTER: XY;
45
46
  export declare const RIGHT_CENTER: XY;
46
47
  export declare const LEFT_CENTER: XY;
48
+ export declare const XY_LOCATIONS: readonly XY[];
47
49
  export declare const xyEquals: (a: XY, b: XY) => boolean;
50
+ export declare const xyMatches: (a: XY, l: Partial<XY> | Location) => boolean;
48
51
  export declare const xyCouple: (a: XY) => [Location, Location];
49
- export declare const isX: (a: Crude) => boolean;
50
- export declare const isY: (a: Crude) => boolean;
52
+ export declare const isX: (a: Crude) => a is "center" | "right" | "left";
53
+ export declare const isY: (a: Crude) => a is "top" | "bottom";
51
54
  export declare const xyToString: (a: XY) => string;
52
55
  export declare const constructXY: (x: Crude | XY, y?: Crude) => XY;
@@ -0,0 +1 @@
1
+ export * as position from './position';
@@ -0,0 +1,20 @@
1
+ import { type Alignment } from '../base';
2
+ import { box } from '../box';
3
+ import { location } from '../location';
4
+ import { xy } from '../xy';
5
+ export declare const posititonSoVisible: (target: HTMLElement, p: xy.XY) => [xy.XY, boolean];
6
+ export interface DialogProps {
7
+ container: box.Crude;
8
+ target: box.Crude;
9
+ dialog: box.Crude;
10
+ alignments?: Alignment[];
11
+ initial?: location.Outer | Partial<location.XY> | location.XY;
12
+ prefer?: Array<location.Outer | Partial<location.XY> | location.XY>;
13
+ disable?: Array<location.Location | Partial<location.XY>>;
14
+ }
15
+ export interface DialogReturn {
16
+ location: location.XY;
17
+ adjustedDialog: box.Box;
18
+ }
19
+ export declare const dialog: ({ container: containerCrude, target: targetCrude, dialog: dialogCrude, initial, prefer, alignments, disable, }: DialogProps) => DialogReturn;
20
+ export declare const getRoot: (option: location.XY, alignment: Alignment) => location.XY;
@@ -0,0 +1 @@
1
+ export * as scale from './scale';
@@ -1,9 +1,9 @@
1
1
  import { z } from "zod";
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';
2
+ import * as bounds from '../bounds/bounds';
3
+ import { type Box } from '../box/box';
4
+ import type * as dims from '../dimensions/dimensions';
5
+ import * as location from '../location/location';
6
+ import * as xy from '../xy/xy';
7
7
  export declare const crudeXYTransform: z.ZodObject<{
8
8
  offset: z.ZodUnion<[z.ZodNumber, z.ZodObject<{
9
9
  x: z.ZodNumber;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * as xy from './xy';
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { clientXY, xy, type ClientXY, type XY, type Direction } from './base';
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<{
@@ -49,7 +49,7 @@ export type Crude = z.infer<typeof crudeZ>;
49
49
  * @param y - If x is a number, the y coordinate. If x is a number and this argument is
50
50
  * not given, the y coordinate is assumed to be the same as the x coordinate.
51
51
  */
52
- export declare const construct: (x: Crude, y?: number) => XY;
52
+ export declare const construct: (x: Crude | Direction, y?: number) => XY;
53
53
  /** An x and y coordinate of zero */
54
54
  export declare const ZERO: {
55
55
  x: number;
@@ -83,13 +83,13 @@ export declare const scale: (c: Crude, x: number, y?: number) => XY;
83
83
  export declare const translateX: (c: Crude, x: number) => XY;
84
84
  /** @returns the given coordinate translated in the Y direction by the given amount. */
85
85
  export declare const translateY: (c: Crude, y: number) => XY;
86
- type TranslateOverloadOne = (a: Crude, b: Crude, ...cb: Crude[]) => XY;
87
- type TranslateOverloadTwo = (a: Crude, direction: Direction, value: number) => XY;
88
- /**
89
- * @returns the given coordinate translated by an arbitrary number of translation
90
- * coordinates.
91
- */
92
- export declare const translate: TranslateOverloadOne & TranslateOverloadTwo;
86
+ interface Translate {
87
+ /** @returns the sum of the given coordinates. */
88
+ (a: Crude, b: Crude, ...cb: Crude[]): XY;
89
+ /** @returns the coordinates translated in the given direction by the given value. */
90
+ (a: Crude, direction: Direction, value: number): XY;
91
+ }
92
+ export declare const translate: Translate;
93
93
  /**
94
94
  * @returns the given coordinate the given direction set to the given value.
95
95
  * @example set({ x: 1, y: 2 }, "x", 3) // { x: 3, y: 2 }
@@ -117,3 +117,4 @@ export declare const css: (a: Crude) => {
117
117
  left: number;
118
118
  top: number;
119
119
  };
120
+ export declare const truncate: (a: Crude, precision?: number) => XY;
@@ -0,0 +1 @@
1
+ export {};
@@ -10,6 +10,7 @@ export interface SeriesDigest {
10
10
  alignment: bounds.Bounds;
11
11
  timeRange?: string;
12
12
  length: number;
13
+ capacity: number;
13
14
  }
14
15
  interface BaseSeriesProps {
15
16
  dataType?: CrudeDataType;
@@ -23,7 +24,7 @@ export interface SeriesProps extends BaseSeriesProps {
23
24
  data: ArrayBuffer | NativeTypedArray;
24
25
  }
25
26
  export interface SeriesAllocProps extends BaseSeriesProps {
26
- length: number;
27
+ capacity: number;
27
28
  dataType: CrudeDataType;
28
29
  }
29
30
  export interface SeriesMemInfo {
@@ -62,7 +63,7 @@ export declare class Series {
62
63
  private writePos;
63
64
  /** Tracks the number of entities currently using this array. */
64
65
  private _refCount;
65
- static alloc({ length, dataType, ...props }: SeriesAllocProps): Series;
66
+ static alloc({ capacity: length, dataType, ...props }: SeriesAllocProps): Series;
66
67
  static generateTimestamps(length: number, rate: Rate, start: TimeStamp): Series;
67
68
  get refCount(): number;
68
69
  static fromStrings(data: string[], timeRange?: TimeRange): Series;
@@ -70,6 +71,14 @@ export declare class Series {
70
71
  constructor({ data, dataType, timeRange, sampleOffset, glBufferUsage, alignment, key, }: SeriesProps);
71
72
  acquire(gl?: GLBufferController): void;
72
73
  release(): void;
74
+ /**
75
+ * Writes the given series to this series. If the series being written exceeds the
76
+ * remaining of series being written to, only the portion that fits will be written.
77
+ * @param other the series to write to this series. The data type of the series written
78
+ * must be the same as the data type of the series being written to.
79
+ * @returns the number of samples written. If the entire series fits, this value is
80
+ * equal to the length of the series being written.
81
+ */
73
82
  write(other: Series): number;
74
83
  /** @returns the underlying buffer backing this array. */
75
84
  get buffer(): ArrayBufferLike;
@@ -81,11 +90,11 @@ export declare class Series {
81
90
  parseJSON<Z extends z.ZodTypeAny>(schema: Z): Array<z.output<Z>>;
82
91
  /** @returns the time range of this array. */
83
92
  get timeRange(): TimeRange;
84
- /** @returns the capacity of the underlying buffer in bytes. */
85
- get byteCap(): Size;
86
- /** @returns the capacity of the underlying buffer in samples. */
87
- get cap(): number;
88
- /** @returns the length of the underlying buffer in samples. */
93
+ /** @returns the capacity of the series in bytes. */
94
+ get byteCapacity(): Size;
95
+ /** @returns the capacity of the series in samples. */
96
+ get capacity(): number;
97
+ /** @returns the length of the series in bytes. */
89
98
  get byteLength(): Size;
90
99
  /** @returns the number of samples in this array. */
91
100
  get length(): number;
@@ -110,7 +119,8 @@ export declare class Series {
110
119
  private maybeRecomputeMinMax;
111
120
  enrich(): void;
112
121
  get range(): SampleValue;
113
- at(index: number): SampleValue;
122
+ at(index: number, required: true): SampleValue;
123
+ at(index: number, required?: false): SampleValue | undefined;
114
124
  /**
115
125
  * @returns the index of the first sample that is greater than or equal to the given value.
116
126
  * The underlying array must be sorted. If it is not, the behavior of this method is undefined.
@@ -153,6 +153,7 @@ export declare class TimeStamp extends Number implements Stringer {
153
153
  /** @returns true if the day portion TimeStamp is today, false otherwise. */
154
154
  get isToday(): boolean;
155
155
  truncate(span: TimeSpan | TimeStamp): TimeStamp;
156
+ get bigInt(): bigint;
156
157
  /**
157
158
  * @returns A new TimeStamp representing the current time in UTC. It's important to
158
159
  * note that this TimeStamp is only accurate to the millisecond level (that's the best
@@ -198,6 +199,10 @@ export declare class TimeStamp extends Number implements Stringer {
198
199
  /** TimeSpan represents a nanosecond precision duration. */
199
200
  export declare class TimeSpan extends Number implements Stringer {
200
201
  constructor(value: CrudeTimeSpan);
202
+ lessThan(other: CrudeTimeSpan): boolean;
203
+ greaterThan(other: CrudeTimeSpan): boolean;
204
+ lessThanOrEqual(other: CrudeTimeSpan): boolean;
205
+ greaterThanOrEqual(other: CrudeTimeSpan): boolean;
201
206
  remainder(divisor: TimeSpan): TimeSpan;
202
207
  truncate(span: TimeSpan): TimeSpan;
203
208
  multiply(factor: number): TimeSpan;
@@ -465,6 +470,14 @@ export declare class TimeRange implements Stringer {
465
470
  equals(other: TimeRange): boolean;
466
471
  toString(): string;
467
472
  toPrettyString(): string;
473
+ /**
474
+ * Checks if if the two time ranges overlap. If the two time ranges are equal, returns
475
+ * true. If the start of one range is equal to the end of the other, returns false.
476
+ * Just follow the rule [start, end) i.e. start is inclusive and end is exclusive.
477
+ *
478
+ * @param other - The other TimeRange to compare to.
479
+ * @returns True if the two TimeRanges overlap, false otherwise.
480
+ */
468
481
  overlapsWith(other: TimeRange): boolean;
469
482
  contains(other: TimeRange): boolean;
470
483
  contains(ts: CrudeTimeStamp): boolean;
@@ -562,6 +575,13 @@ export declare class Size extends Number implements Stringer {
562
575
  smallerThan(other: CrudeSize): boolean;
563
576
  add(other: CrudeSize): Size;
564
577
  sub(other: CrudeSize): Size;
578
+ truncate(span: CrudeSize): Size;
579
+ remainder(span: CrudeSize): Size;
580
+ get gigabytes(): number;
581
+ get megabytes(): number;
582
+ get kilobytes(): number;
583
+ get terabytes(): number;
584
+ toString(): string;
565
585
  /**
566
586
  * Creates a Size from the given number of bytes.
567
587
  *
@@ -611,7 +631,7 @@ export declare class Size extends Number implements Stringer {
611
631
  static readonly ZERO: Size;
612
632
  /** A zod schema for a Size. */
613
633
  static readonly z: z.ZodUnion<[z.ZodEffects<z.ZodNumber, Size, number>, z.ZodType<Size, z.ZodTypeDef, Size>]>;
614
- isZero(): boolean;
634
+ get isZero(): boolean;
615
635
  }
616
636
  export type CrudeTimeStamp = TimeStamp | TimeSpan | number | Date | string | DateComponents | Number;
617
637
  export type TimeStampT = number;