@kymoscope/sdk 0.0.0-stage → 0.1.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 (223) hide show
  1. package/LICENSE.md +69 -0
  2. package/README.md +138 -2
  3. package/dist/assets/duckdb-browser-eh.worker--3HUwN9R.js +14 -0
  4. package/dist/assets/duckdb-eh-D-nnNw7L.wasm.gz +0 -0
  5. package/dist/assets/h5wasmModule-BCQWU2Gw.js +24295 -0
  6. package/dist/assets/importer.worker-D4is7BLf.js +6 -0
  7. package/dist/assets/offscreenLineWorker-mShhnyXX.js +79 -0
  8. package/dist/assets/parseDataset.worker-PynRsPD8.js +5 -0
  9. package/dist/importers-DivmF3tx.js +5 -0
  10. package/dist/krc-CbE28CjD.js +9 -0
  11. package/dist/kymoscope-embed.js +633 -0
  12. package/dist/kymoscope-sdk.js +616 -0
  13. package/dist/react.js +2 -0
  14. package/dist/styles/charts.css +207 -0
  15. package/dist/styles/fonts/OFL.txt +93 -0
  16. package/dist/styles/fonts/plus-jakarta-sans-italic-latin-ext.woff2 +0 -0
  17. package/dist/styles/fonts/plus-jakarta-sans-italic-latin.woff2 +0 -0
  18. package/dist/styles/fonts/plus-jakarta-sans-latin-ext.woff2 +0 -0
  19. package/dist/styles/fonts/plus-jakarta-sans-latin.woff2 +0 -0
  20. package/dist/styles/tokens.css +218 -0
  21. package/dist/types/charts/AlarmOverlay.d.ts +11 -0
  22. package/dist/types/charts/AnnotationLayer.d.ts +29 -0
  23. package/dist/types/charts/ChartBody.d.ts +52 -0
  24. package/dist/types/charts/PerfHud.d.ts +20 -0
  25. package/dist/types/charts/beacon.d.ts +27 -0
  26. package/dist/types/charts/chartWindow.d.ts +31 -0
  27. package/dist/types/charts/liveOverlay.d.ts +16 -0
  28. package/dist/types/charts/runtime.d.ts +63 -0
  29. package/dist/types/charts/useWorksheetData.d.ts +159 -0
  30. package/dist/types/components/AreaChart.d.ts +21 -0
  31. package/dist/types/components/BarChart.d.ts +30 -0
  32. package/dist/types/components/BoxPlotChart.d.ts +16 -0
  33. package/dist/types/components/BubbleChart.d.ts +24 -0
  34. package/dist/types/components/CalibrationChart.d.ts +15 -0
  35. package/dist/types/components/CdfChart.d.ts +15 -0
  36. package/dist/types/components/ConfusionChart.d.ts +11 -0
  37. package/dist/types/components/ControlChart.d.ts +17 -0
  38. package/dist/types/components/DuckDbMultiBandPanel.d.ts +35 -0
  39. package/dist/types/components/EmbeddingChart.d.ts +25 -0
  40. package/dist/types/components/FlameGraphChart.d.ts +15 -0
  41. package/dist/types/components/GanttChart.d.ts +15 -0
  42. package/dist/types/components/GaugeChart.d.ts +27 -0
  43. package/dist/types/components/HeatmapChart.d.ts +41 -0
  44. package/dist/types/components/HistogramChart.d.ts +15 -0
  45. package/dist/types/components/LossCurveChart.d.ts +17 -0
  46. package/dist/types/components/MultiBandCanvasChart.d.ts +156 -0
  47. package/dist/types/components/ParallelCoordsChart.d.ts +21 -0
  48. package/dist/types/components/PolarChart.d.ts +17 -0
  49. package/dist/types/components/QQPlotChart.d.ts +16 -0
  50. package/dist/types/components/RadarChart.d.ts +17 -0
  51. package/dist/types/components/RocChart.d.ts +12 -0
  52. package/dist/types/components/SankeyChart.d.ts +15 -0
  53. package/dist/types/components/SpectrogramChart.d.ts +16 -0
  54. package/dist/types/components/SpectrogramWaterfall.d.ts +14 -0
  55. package/dist/types/components/SpectrumChart.d.ts +17 -0
  56. package/dist/types/components/TreemapChart.d.ts +14 -0
  57. package/dist/types/components/ViolinChart.d.ts +17 -0
  58. package/dist/types/components/XYScatterChart.d.ts +47 -0
  59. package/dist/types/components/XYZMeshChart.d.ts +68 -0
  60. package/dist/types/components/dashboardGridLayout.d.ts +50 -0
  61. package/dist/types/components/liveFollowEase.d.ts +10 -0
  62. package/dist/types/components/liveWindow.d.ts +63 -0
  63. package/dist/types/components/multiBandHover.d.ts +44 -0
  64. package/dist/types/embed/Attribution.d.ts +5 -0
  65. package/dist/types/embed/license.d.ts +29 -0
  66. package/dist/types/embed/standalone.d.ts +5 -0
  67. package/dist/types/engine/columns.d.ts +44 -0
  68. package/dist/types/engine/createEngine.d.ts +394 -0
  69. package/dist/types/engine/derive.d.ts +27 -0
  70. package/dist/types/engine/emitter.d.ts +6 -0
  71. package/dist/types/engine/errors.d.ts +7 -0
  72. package/dist/types/engine/history.d.ts +29 -0
  73. package/dist/types/engine/kinds.d.ts +9 -0
  74. package/dist/types/engine/liveController.d.ts +27 -0
  75. package/dist/types/engine/store.d.ts +8 -0
  76. package/dist/types/engine/types.d.ts +194 -0
  77. package/dist/types/index.d.ts +69 -0
  78. package/dist/types/lib/annotations.d.ts +37 -0
  79. package/dist/types/lib/beacon.d.ts +62 -0
  80. package/dist/types/lib/colorScheme.d.ts +5 -0
  81. package/dist/types/lib/colormap.d.ts +9 -0
  82. package/dist/types/lib/columnTable.d.ts +37 -0
  83. package/dist/types/lib/data/arrowDecimation.d.ts +11 -0
  84. package/dist/types/lib/data/binnedHeatmap.d.ts +27 -0
  85. package/dist/types/lib/data/columnCaches.d.ts +6 -0
  86. package/dist/types/lib/data/columnarDataSource.d.ts +34 -0
  87. package/dist/types/lib/data/createDataSource.d.ts +23 -0
  88. package/dist/types/lib/data/dataSource.d.ts +75 -0
  89. package/dist/types/lib/data/decimate.d.ts +25 -0
  90. package/dist/types/lib/data/duckDbDataSource.d.ts +42 -0
  91. package/dist/types/lib/data/envelope.d.ts +16 -0
  92. package/dist/types/lib/data/inMemoryDataSource.d.ts +25 -0
  93. package/dist/types/lib/data/liveDataSource.d.ts +77 -0
  94. package/dist/types/lib/data/lruCache.d.ts +11 -0
  95. package/dist/types/lib/data/openDataset.d.ts +24 -0
  96. package/dist/types/lib/data/opfsParquet.d.ts +4 -0
  97. package/dist/types/lib/data/pointColumns.d.ts +59 -0
  98. package/dist/types/lib/data/schemaColumns.d.ts +5 -0
  99. package/dist/types/lib/data/useSeriesPoints.d.ts +48 -0
  100. package/dist/types/lib/data/xyColumns.d.ts +77 -0
  101. package/dist/types/lib/dataBounds.d.ts +10 -0
  102. package/dist/types/lib/datasetColors.d.ts +19 -0
  103. package/dist/types/lib/datasetColumns.d.ts +3 -0
  104. package/dist/types/lib/datasetMerge.d.ts +8 -0
  105. package/dist/types/lib/duckdb/duckdbInstance.d.ts +7 -0
  106. package/dist/types/lib/duckdb/fileIdentity.d.ts +9 -0
  107. package/dist/types/lib/duckdb/sql.d.ts +124 -0
  108. package/dist/types/lib/fft.d.ts +15 -0
  109. package/dist/types/lib/folderTree.d.ts +29 -0
  110. package/dist/types/lib/gaugeColors.d.ts +32 -0
  111. package/dist/types/lib/importers/arrowSink.d.ts +35 -0
  112. package/dist/types/lib/importers/blobReader.d.ts +22 -0
  113. package/dist/types/lib/importers/bytes.d.ts +11 -0
  114. package/dist/types/lib/importers/combine.d.ts +30 -0
  115. package/dist/types/lib/importers/comtrade/format.d.ts +2 -0
  116. package/dist/types/lib/importers/comtrade/importer.d.ts +25 -0
  117. package/dist/types/lib/importers/dbc.d.ts +45 -0
  118. package/dist/types/lib/importers/edf/format.d.ts +2 -0
  119. package/dist/types/lib/importers/edf/importer.d.ts +7 -0
  120. package/dist/types/lib/importers/expr.d.ts +10 -0
  121. package/dist/types/lib/importers/formats.d.ts +23 -0
  122. package/dist/types/lib/importers/hdf5/format.d.ts +4 -0
  123. package/dist/types/lib/importers/hdf5/h5.d.ts +76 -0
  124. package/dist/types/lib/importers/hdf5/h5wasmModule.d.ts +1 -0
  125. package/dist/types/lib/importers/hdf5/importer.d.ts +2 -0
  126. package/dist/types/lib/importers/importer.worker.d.ts +5 -0
  127. package/dist/types/lib/importers/importers.d.ts +4 -0
  128. package/dist/types/lib/importers/limits.d.ts +28 -0
  129. package/dist/types/lib/importers/mat/format.d.ts +2 -0
  130. package/dist/types/lib/importers/mat/group.d.ts +19 -0
  131. package/dist/types/lib/importers/mat/importer.d.ts +2 -0
  132. package/dist/types/lib/importers/mat/v5.d.ts +24 -0
  133. package/dist/types/lib/importers/mat/v73.d.ts +13 -0
  134. package/dist/types/lib/importers/mdf/blocks3.d.ts +3 -0
  135. package/dist/types/lib/importers/mdf/blocks4.d.ts +7 -0
  136. package/dist/types/lib/importers/mdf/bus.d.ts +59 -0
  137. package/dist/types/lib/importers/mdf/conversion.d.ts +48 -0
  138. package/dist/types/lib/importers/mdf/decode.d.ts +15 -0
  139. package/dist/types/lib/importers/mdf/format.d.ts +2 -0
  140. package/dist/types/lib/importers/mdf/importer.d.ts +19 -0
  141. package/dist/types/lib/importers/mdf/model.d.ts +75 -0
  142. package/dist/types/lib/importers/mdf/records.d.ts +31 -0
  143. package/dist/types/lib/importers/mdf/stream.d.ts +42 -0
  144. package/dist/types/lib/importers/memorySink.d.ts +11 -0
  145. package/dist/types/lib/importers/names.d.ts +2 -0
  146. package/dist/types/lib/importers/openImport.d.ts +33 -0
  147. package/dist/types/lib/importers/registry.d.ts +24 -0
  148. package/dist/types/lib/importers/run.d.ts +35 -0
  149. package/dist/types/lib/importers/session.d.ts +28 -0
  150. package/dist/types/lib/importers/tdms/format.d.ts +2 -0
  151. package/dist/types/lib/importers/tdms/importer.d.ts +10 -0
  152. package/dist/types/lib/importers/types.d.ts +172 -0
  153. package/dist/types/lib/importers/workerCore.d.ts +44 -0
  154. package/dist/types/lib/importers/xdf/format.d.ts +2 -0
  155. package/dist/types/lib/importers/xdf/importer.d.ts +2 -0
  156. package/dist/types/lib/importers/zlib.d.ts +13 -0
  157. package/dist/types/lib/kde.d.ts +2 -0
  158. package/dist/types/lib/live/buffer.d.ts +265 -0
  159. package/dist/types/lib/live/columnsWire.d.ts +24 -0
  160. package/dist/types/lib/live/crypto.d.ts +157 -0
  161. package/dist/types/lib/live/liveMathChannels.d.ts +11 -0
  162. package/dist/types/lib/live/recorder.d.ts +32 -0
  163. package/dist/types/lib/live/stream.d.ts +33 -0
  164. package/dist/types/lib/live/timeBuckets.d.ts +71 -0
  165. package/dist/types/lib/live/types.d.ts +72 -0
  166. package/dist/types/lib/live/wire.d.ts +25 -0
  167. package/dist/types/lib/mathChannels/compile.d.ts +22 -0
  168. package/dist/types/lib/mathChannels/evaluator.d.ts +40 -0
  169. package/dist/types/lib/mathChannels/functions/conditional.d.ts +2 -0
  170. package/dist/types/lib/mathChannels/functions/filters.d.ts +7 -0
  171. package/dist/types/lib/mathChannels/functions/index.d.ts +3 -0
  172. package/dist/types/lib/mathChannels/functions/reference.d.ts +7 -0
  173. package/dist/types/lib/mathChannels/functions/windowOps.d.ts +11 -0
  174. package/dist/types/lib/mathChannels/index.d.ts +13 -0
  175. package/dist/types/lib/mathChannels/io.d.ts +18 -0
  176. package/dist/types/lib/mathChannels/mathjsSetup.d.ts +7 -0
  177. package/dist/types/lib/mathChannels/parseMath.d.ts +12 -0
  178. package/dist/types/lib/mathChannels/parser.d.ts +22 -0
  179. package/dist/types/lib/mathChannels/types.d.ts +34 -0
  180. package/dist/types/lib/mathChannels/usedChannels.d.ts +14 -0
  181. package/dist/types/lib/moduleWorker.d.ts +7 -0
  182. package/dist/types/lib/panelChartSettings.d.ts +438 -0
  183. package/dist/types/lib/parseDataset.d.ts +74 -0
  184. package/dist/types/lib/parseDataset.worker.d.ts +1 -0
  185. package/dist/types/lib/parseDatasetWorkerClient.d.ts +32 -0
  186. package/dist/types/lib/perfLog.d.ts +4 -0
  187. package/dist/types/lib/quantiles.d.ts +10 -0
  188. package/dist/types/lib/recordings/csvWriter.d.ts +10 -0
  189. package/dist/types/lib/recordings/export.d.ts +26 -0
  190. package/dist/types/lib/recordings/importer.d.ts +2 -0
  191. package/dist/types/lib/recordings/keys.d.ts +23 -0
  192. package/dist/types/lib/recordings/krc.d.ts +38 -0
  193. package/dist/types/lib/recordings/mf4Writer.d.ts +20 -0
  194. package/dist/types/lib/render/chartFonts.d.ts +10 -0
  195. package/dist/types/lib/render/colorBucket.d.ts +6 -0
  196. package/dist/types/lib/render/contours.d.ts +16 -0
  197. package/dist/types/lib/render/cssColor.d.ts +2 -0
  198. package/dist/types/lib/render/frames.d.ts +46 -0
  199. package/dist/types/lib/render/gl3d.d.ts +63 -0
  200. package/dist/types/lib/render/glLines.d.ts +62 -0
  201. package/dist/types/lib/render/glPlot.d.ts +36 -0
  202. package/dist/types/lib/render/glPoints.d.ts +37 -0
  203. package/dist/types/lib/render/glSeries.d.ts +67 -0
  204. package/dist/types/lib/render/heatGrid.d.ts +9 -0
  205. package/dist/types/lib/render/hitGrid.d.ts +16 -0
  206. package/dist/types/lib/render/liveZoomBus.d.ts +18 -0
  207. package/dist/types/lib/render/margins.d.ts +14 -0
  208. package/dist/types/lib/render/offscreenLineRenderer.d.ts +53 -0
  209. package/dist/types/lib/render/offscreenLineWorker.d.ts +1 -0
  210. package/dist/types/lib/render/plotFrame.d.ts +36 -0
  211. package/dist/types/lib/render/resample.d.ts +18 -0
  212. package/dist/types/lib/render/sharedGl.d.ts +38 -0
  213. package/dist/types/lib/render/useGlPlot.d.ts +7 -0
  214. package/dist/types/lib/savedLayout.d.ts +45 -0
  215. package/dist/types/lib/stft.d.ts +37 -0
  216. package/dist/types/lib/workspaces/encrypted.d.ts +50 -0
  217. package/dist/types/lib/workspaces/io.d.ts +120 -0
  218. package/dist/types/lib/xyFit.d.ts +14 -0
  219. package/dist/types/lib/yAxisTicks.d.ts +28 -0
  220. package/dist/types/react/index.d.ts +32 -0
  221. package/dist/types/types/loadedDataset.d.ts +42 -0
  222. package/dist/types/types/plotSeries.d.ts +27 -0
  223. package/package.json +63 -4
@@ -0,0 +1,438 @@
1
+ import type { XYZViewMode } from '../components/XYZMeshChart';
2
+ import type { AlarmLine, PlotSeries } from '../types/plotSeries';
3
+ import { type ChartAnnotation } from './annotations';
4
+ import type { GaugeColorMode, GaugeColorStop } from './gaugeColors';
5
+ export interface XyAxisScaleSettings {
6
+ scaleMin: string;
7
+ scaleMax: string;
8
+ majorStep: string;
9
+ minorStep: string;
10
+ alarm: AlarmLine | null;
11
+ }
12
+ export declare function defaultXyAxisScaleSettings(): XyAxisScaleSettings;
13
+ export type XyFitDegree = 1 | 2 | 3;
14
+ export interface XyFitSettings {
15
+ degree: XyFitDegree;
16
+ color: string;
17
+ lineStyle: 'solid' | 'dashed' | 'dotted';
18
+ width: number;
19
+ }
20
+ export type AxisLineStyleStr = 'none' | 'solid' | 'dashed' | 'dotted';
21
+ export interface AxisLineStyle {
22
+ style: AxisLineStyleStr;
23
+ /** Stroke width in CSS pixels (0.5–4). */
24
+ width: number;
25
+ /** Hex color, or null = use the chart's theme default. */
26
+ color: string | null;
27
+ }
28
+ export declare const DEFAULT_AXIS_LINE: AxisLineStyle;
29
+ export declare const DEFAULT_GRID_LINE: AxisLineStyle;
30
+ export interface MultibandPanelChartSettings {
31
+ kind: 'multiband';
32
+ series: PlotSeries[];
33
+ addColumn: string;
34
+ /** 'overlay' = bands set by bandFromPct/bandToPct; 'parallel' = equal bands auto-computed from series order. */
35
+ layout: 'overlay' | 'parallel';
36
+ xAxisLine: AxisLineStyle;
37
+ yAxisLine: AxisLineStyle;
38
+ gridLine: AxisLineStyle;
39
+ /** Data trace thickness in CSS px (0.5–6). */
40
+ lineWidth: number;
41
+ /** Beacon: while live, show only the current cycle (X starting over — a lap,
42
+ * a battery cycle…) against reference data. Unset = off. */
43
+ beacon?: BeaconSettings;
44
+ /** With several datasets or laps plotted: shade each series' min–max envelope across them. */
45
+ envelope?: boolean;
46
+ }
47
+ /** What sits behind the current cycle when the beacon is on. */
48
+ export type BeaconReference = 'dataset' | 'previous' | 'none';
49
+ export interface BeaconSettings {
50
+ enabled: boolean;
51
+ reference: BeaconReference;
52
+ /** Dataset (or lap) id for `reference: 'dataset'`. */
53
+ datasetId: string | null;
54
+ datasetColor: string;
55
+ previousColor: string;
56
+ }
57
+ export declare const DEFAULT_BEACON: BeaconSettings;
58
+ export type XyDrawMode = 'points' | 'lines' | 'both';
59
+ export interface XyPanelChartSettings {
60
+ kind: 'xyscatter';
61
+ xyXCol: string;
62
+ xyYCol: string;
63
+ /** Optional 3rd column used to color points by value (colormap). Null = solid color. */
64
+ xyColorCol: string | null;
65
+ xyColor: string;
66
+ xyPointRadius: number;
67
+ /** Points, a line through them in data order, or both (absent: points). */
68
+ xyDrawMode?: XyDrawMode;
69
+ /** Line width in CSS px when drawn as a line (absent: 1). */
70
+ xyLineWidth?: number;
71
+ xyXAxisLine: AxisLineStyle;
72
+ xyYAxisLine: AxisLineStyle;
73
+ xyGridLine: AxisLineStyle;
74
+ xyFit: XyFitSettings | null;
75
+ xyXScale: XyAxisScaleSettings;
76
+ xyYScale: XyAxisScaleSettings;
77
+ }
78
+ export interface XyzPanelChartSettings {
79
+ kind: 'xyzmesh';
80
+ xyzXCol: string;
81
+ xyzYCol: string;
82
+ xyzZCol: string;
83
+ xyzViewMode: XYZViewMode;
84
+ xyzXScale: XyAxisScaleSettings;
85
+ xyzYScale: XyAxisScaleSettings;
86
+ xyzZScale: XyAxisScaleSettings;
87
+ xyzPointRadius: number;
88
+ /** Show Delaunay surface mesh over the scatter. Default false. */
89
+ showMesh: boolean;
90
+ /** How to draw the mesh. Default 'filled'. */
91
+ meshStyle: 'filled' | 'wireframe' | 'both';
92
+ /** Fill opacity for triangles (0–1). Default 0.85. */
93
+ meshOpacity: number;
94
+ /**
95
+ * points (default): one point per row at (X, Y, Z). matrix: a surface over a
96
+ * uniform grid, the rows along X, the `xyzColumns` along Y, each value a height.
97
+ */
98
+ xyzMode?: 'points' | 'matrix';
99
+ xyzColumns?: string[];
100
+ }
101
+ export interface HistogramPanelChartSettings {
102
+ /** Alarm line on the X axis (a value); null or missing: none. */
103
+ histAlarm?: AlarmLine | null;
104
+ kind: 'histogram';
105
+ histColumn: string;
106
+ histBins: number;
107
+ histColor: string;
108
+ histNormal: boolean;
109
+ histLogY: boolean;
110
+ }
111
+ export interface PolarPanelChartSettings {
112
+ kind: 'polar';
113
+ polarAngleCol: string;
114
+ polarRadiusCol: string;
115
+ polarColor: string;
116
+ polarMode: 'waveform' | 'rose';
117
+ polarRadiusMin: string;
118
+ polarRadiusMax: string;
119
+ }
120
+ export interface SpectrumPanelChartSettings {
121
+ /** Alarm line on the Y axis (amplitude, in the Y mode's unit); null or missing: none. */
122
+ specAlarm?: AlarmLine | null;
123
+ kind: 'spectrum';
124
+ specSignalCol: string;
125
+ specTimeCol: string;
126
+ specSampleRate: string;
127
+ specXMode: 'hz' | 'order';
128
+ specYMode: 'amplitude' | 'db';
129
+ specWindow: 'hann' | 'rectangular';
130
+ specColor: string;
131
+ specLogX: boolean;
132
+ }
133
+ export interface BoxPlotPanelChartSettings {
134
+ /** Alarm line on the value axis; null or missing: none. */
135
+ boxAlarm?: AlarmLine | null;
136
+ kind: 'boxplot';
137
+ boxValueCol: string;
138
+ boxGroupCol: string;
139
+ boxColor: string;
140
+ boxWhiskers: '1.5iqr' | 'minmax';
141
+ }
142
+ export interface SpectrogramPanelChartSettings {
143
+ kind: 'spectrogram';
144
+ sgSignalCol: string;
145
+ sgTimeCol: string;
146
+ sgSampleRate: string;
147
+ sgWindowSize: number;
148
+ sgOverlap: number;
149
+ sgWinFunc: 'hann' | 'rectangular';
150
+ sgYMode: 'amplitude' | 'db';
151
+ sgLogFreq: boolean;
152
+ /** '2d': a time × frequency colour map; 'waterfall': the same in 3-D, level as height. Missing: '2d'. */
153
+ sgView?: '2d' | 'waterfall';
154
+ }
155
+ export interface HeatmapPanelChartSettings {
156
+ kind: 'heatmap';
157
+ /** matrix: the rows along X, the `hmColumns` along Y, each cell a value (a uniform grid). */
158
+ hmMode: 'correlation' | 'raw' | 'binned' | 'count' | 'matrix';
159
+ hmColumns: string[];
160
+ hmXCol: string;
161
+ hmYCol: string;
162
+ hmValueCol: string;
163
+ hmXBins: number;
164
+ hmYBins: number;
165
+ hmXMin: string;
166
+ hmXMax: string;
167
+ hmYMin: string;
168
+ hmYMax: string;
169
+ hmShowValues: boolean;
170
+ /** Fixed colour range ('' or absent: from the data). */
171
+ hmRange?: {
172
+ scaleMin: string;
173
+ scaleMax: string;
174
+ };
175
+ hmColorScheme: 'diverging' | 'plasma' | 'viridis';
176
+ /**
177
+ * 'values' (matrix and raw modes): cells sized by their positions instead of
178
+ * evenly, for breakpoint tables such as engine maps. Matrix: X from the
179
+ * worksheet's X values, Y from the numbers in the column names; raw: from the
180
+ * X and Y values. Rows then run with the larger value at the top. Missing: 'uniform'.
181
+ */
182
+ hmSpacing?: 'uniform' | 'values';
183
+ /** Isolines at this many evenly spaced levels across the colour range (0 or missing: none). */
184
+ hmContours?: number;
185
+ }
186
+ export interface ViolinPanelChartSettings {
187
+ /** Alarm line on the value axis (follows the orientation); null or missing: none. */
188
+ vlAlarm?: AlarmLine | null;
189
+ kind: 'violin';
190
+ vlValueCol: string;
191
+ vlGroupCol: string;
192
+ vlColor: string;
193
+ vlShowBox: boolean;
194
+ vlBandwidth: string;
195
+ vlOrientation: 'vertical' | 'horizontal';
196
+ }
197
+ export interface ConfusionPanelChartSettings {
198
+ kind: 'confusion';
199
+ cfActualCol: string;
200
+ cfPredictedCol: string;
201
+ cfNormalize: boolean;
202
+ }
203
+ export interface RocPanelChartSettings {
204
+ kind: 'roc';
205
+ rocScoreCol: string;
206
+ rocLabelCol: string;
207
+ rocMode: 'roc' | 'pr';
208
+ rocColor: string;
209
+ }
210
+ export interface LossCurvePanelChartSettings {
211
+ /** Alarm line on the left Y axis; null or missing: none. */
212
+ lcAlarm?: AlarmLine | null;
213
+ kind: 'losscurve';
214
+ lcXCol: string;
215
+ lcLeftCols: {
216
+ column: string;
217
+ color: string;
218
+ }[];
219
+ lcRightCols: {
220
+ column: string;
221
+ color: string;
222
+ }[];
223
+ }
224
+ export interface ControlChartPanelChartSettings {
225
+ kind: 'controlchart';
226
+ ccValueCol: string;
227
+ ccSubgroupCol: string;
228
+ ccSigmaLevel: number;
229
+ ccColor: string;
230
+ }
231
+ export interface ParallelCoordsPanelChartSettings {
232
+ kind: 'parallelcoords';
233
+ pcColumns: string[];
234
+ pcColorByCol: string;
235
+ pcColor: string;
236
+ }
237
+ export interface EmbeddingPanelChartSettings {
238
+ kind: 'embedding';
239
+ emXCol: string;
240
+ emYCol: string;
241
+ emColorCol: string;
242
+ emColorMode: 'numeric' | 'categorical';
243
+ emLabelCol: string;
244
+ emPointSize: number;
245
+ emColor: string;
246
+ }
247
+ export interface FlameGraphPanelChartSettings {
248
+ kind: 'flamegraph';
249
+ fgNameCol: string;
250
+ fgParentCol: string;
251
+ fgValueCol: string;
252
+ fgDirection: 'topdown' | 'bottomup';
253
+ }
254
+ export interface BarChartPanelChartSettings {
255
+ /** Alarm line on the value axis (follows the orientation); null or missing: none. */
256
+ bcAlarm?: AlarmLine | null;
257
+ kind: 'barchart';
258
+ bcCategoryCol: string;
259
+ bcValueCols: string[];
260
+ bcMode: 'grouped' | 'stacked';
261
+ bcHorizontal: boolean;
262
+ /** Fixed value range ('' or absent: from the data). */
263
+ bcValueScale?: {
264
+ scaleMin: string;
265
+ scaleMax: string;
266
+ };
267
+ }
268
+ export interface RadarPanelChartSettings {
269
+ kind: 'radar';
270
+ rdAxesCols: string[];
271
+ rdGroupCol: string;
272
+ rdColor: string;
273
+ rdFill: boolean;
274
+ }
275
+ export interface AreaChartPanelChartSettings {
276
+ /** Alarm line on the Y axis; null or missing: none. */
277
+ acAlarm?: AlarmLine | null;
278
+ kind: 'areachart';
279
+ acXCol: string;
280
+ acYCols: string[];
281
+ acStacked: boolean;
282
+ /** Fixed Y range ('' or absent: from the data). */
283
+ acYScale?: {
284
+ scaleMin: string;
285
+ scaleMax: string;
286
+ };
287
+ }
288
+ export interface CdfChartPanelChartSettings {
289
+ /** Alarm line on the X axis (a value); null or missing: none. */
290
+ cdAlarm?: AlarmLine | null;
291
+ kind: 'cdfchart';
292
+ cdValueCols: string[];
293
+ cdComplement: boolean;
294
+ cdLogX: boolean;
295
+ }
296
+ export interface BubbleChartPanelChartSettings {
297
+ /** Alarm line on the Y axis; null or missing: none. */
298
+ bbAlarm?: AlarmLine | null;
299
+ kind: 'bubblechart';
300
+ bbXCol: string;
301
+ bbYCol: string;
302
+ bbSizeCol: string;
303
+ bbColorCol: string;
304
+ bbColorMode: 'numeric' | 'categorical';
305
+ bbColor: string;
306
+ bbMaxRadius: number;
307
+ }
308
+ export interface TreemapPanelChartSettings {
309
+ kind: 'treemap';
310
+ tmNameCol: string;
311
+ tmParentCol: string;
312
+ tmValueCol: string;
313
+ }
314
+ export interface SankeyPanelChartSettings {
315
+ kind: 'sankey';
316
+ skSourceCol: string;
317
+ skTargetCol: string;
318
+ skValueCol: string;
319
+ }
320
+ /** One gauge: a channel and how it is shown. */
321
+ export interface GaugeItem {
322
+ id: string;
323
+ column: string;
324
+ color: string;
325
+ /** What it shows of its column: the latest value (follows a live stream), or the mean, minimum or maximum. */
326
+ value: 'last' | 'mean' | 'min' | 'max';
327
+ style: 'arc' | 'linear';
328
+ /** Scale ends ('' = from the column's data, rounded). */
329
+ min: string;
330
+ max: string;
331
+ /** Marked on the scale; past it the gauge takes its colour. Null or missing: none. */
332
+ alarm?: AlarmLine | null;
333
+ /**
334
+ * 'solid' (missing): `color`. 'gradient': blended through `stops`; 'zones':
335
+ * each stop's colour from its value to the next stop's. The whole scale shows
336
+ * the colours faintly; the filled part and the value take them.
337
+ */
338
+ colorMode?: GaugeColorMode;
339
+ /** Colour stops at values of the channel (gradient and zones). */
340
+ stops?: GaugeColorStop[];
341
+ }
342
+ export interface GaugePanelChartSettings {
343
+ kind: 'gauge';
344
+ /** The gauges, in order. */
345
+ ggGauges: GaugeItem[];
346
+ }
347
+ /** A new gauge for a column: the next colour of the list, its latest value on an arc. */
348
+ export declare function newGaugeItem(column: string, index: number): GaugeItem;
349
+ export interface CalibrationPanelChartSettings {
350
+ kind: 'calibration';
351
+ cbScoreCol: string;
352
+ cbLabelCol: string;
353
+ cbBins: number;
354
+ cbColor: string;
355
+ }
356
+ export interface QQPlotPanelChartSettings {
357
+ kind: 'qqplot';
358
+ qqValueCol: string;
359
+ qqMode: 'normal' | 'column';
360
+ qqRefCol: string;
361
+ qqColor: string;
362
+ }
363
+ export interface GanttPanelChartSettings {
364
+ /** Alarm line on the time (X) axis; null or missing: none. */
365
+ gtAlarm?: AlarmLine | null;
366
+ kind: 'gantt';
367
+ gtLabelCol: string;
368
+ gtStartCol: string;
369
+ gtEndCol: string;
370
+ gtGroupCol: string;
371
+ }
372
+ /** Settings every chart kind has besides its own. */
373
+ export interface CommonPanelChartSettings {
374
+ /** Marks drawn over the chart (text, brush, arrows, boxes, lines). */
375
+ annotations?: ChartAnnotation[];
376
+ }
377
+ export type PanelChartSettings = CommonPanelChartSettings & (MultibandPanelChartSettings | XyPanelChartSettings | XyzPanelChartSettings | HistogramPanelChartSettings | PolarPanelChartSettings | SpectrumPanelChartSettings | BoxPlotPanelChartSettings | SpectrogramPanelChartSettings | HeatmapPanelChartSettings | ViolinPanelChartSettings | ConfusionPanelChartSettings | RocPanelChartSettings | LossCurvePanelChartSettings | ControlChartPanelChartSettings | ParallelCoordsPanelChartSettings | EmbeddingPanelChartSettings | FlameGraphPanelChartSettings | BarChartPanelChartSettings | RadarPanelChartSettings | AreaChartPanelChartSettings | CdfChartPanelChartSettings | BubbleChartPanelChartSettings | TreemapPanelChartSettings | SankeyPanelChartSettings | CalibrationPanelChartSettings | GaugePanelChartSettings | QQPlotPanelChartSettings | GanttPanelChartSettings);
378
+ /** Parse optional axis range from min/max strings (same rules as App useMemo). */
379
+ export declare function parseOptionalAxisRange(minStr: string, maxStr: string): [number, number] | undefined;
380
+ /** Keep in sync with `savedLayout.ts` defaults. */
381
+ export declare const DEFAULT_XY_POINT_RADIUS = 1.8;
382
+ export declare const DEFAULT_XYZ_POINT_RADIUS = 4;
383
+ export declare const DEFAULT_TRACE_WIDTH = 1;
384
+ export declare function defaultMultibandPanelSettings(): MultibandPanelChartSettings;
385
+ export declare function defaultXyPanelSettings(xyColorFallback: string): XyPanelChartSettings;
386
+ export declare function defaultXyzPanelSettings(xyzPointRadiusFallback?: number): XyzPanelChartSettings;
387
+ export declare function defaultHistogramPanelSettings(): HistogramPanelChartSettings;
388
+ export declare function defaultPolarPanelSettings(): PolarPanelChartSettings;
389
+ export declare function defaultSpectrumPanelSettings(): SpectrumPanelChartSettings;
390
+ export declare function defaultBoxPlotPanelSettings(): BoxPlotPanelChartSettings;
391
+ export declare function defaultSpectrogramPanelSettings(): SpectrogramPanelChartSettings;
392
+ export declare function defaultHeatmapPanelSettings(): HeatmapPanelChartSettings;
393
+ export declare function defaultViolinPanelSettings(): ViolinPanelChartSettings;
394
+ export declare function defaultConfusionPanelSettings(): ConfusionPanelChartSettings;
395
+ export declare function defaultRocPanelSettings(): RocPanelChartSettings;
396
+ export declare function defaultLossCurvePanelSettings(): LossCurvePanelChartSettings;
397
+ export declare function defaultControlChartPanelSettings(): ControlChartPanelChartSettings;
398
+ export declare function defaultParallelCoordsPanelSettings(): ParallelCoordsPanelChartSettings;
399
+ export declare function defaultEmbeddingPanelSettings(): EmbeddingPanelChartSettings;
400
+ export declare function defaultFlameGraphPanelSettings(): FlameGraphPanelChartSettings;
401
+ export declare function defaultBarChartPanelSettings(): BarChartPanelChartSettings;
402
+ export declare function defaultRadarPanelSettings(): RadarPanelChartSettings;
403
+ export declare function defaultAreaChartPanelSettings(): AreaChartPanelChartSettings;
404
+ export declare function defaultCdfChartPanelSettings(): CdfChartPanelChartSettings;
405
+ export declare function defaultBubbleChartPanelSettings(): BubbleChartPanelChartSettings;
406
+ export declare function defaultTreemapPanelSettings(): TreemapPanelChartSettings;
407
+ export declare function defaultSankeyPanelSettings(): SankeyPanelChartSettings;
408
+ export declare function defaultGaugePanelSettings(): GaugePanelChartSettings;
409
+ export declare function defaultCalibrationPanelSettings(): CalibrationPanelChartSettings;
410
+ export declare function defaultQQPlotPanelSettings(): QQPlotPanelChartSettings;
411
+ export declare function defaultGanttPanelSettings(): GanttPanelChartSettings;
412
+ /** An alarm line from untrusted input, or null. */
413
+ export declare function coerceAlarmLine(v: unknown): AlarmLine | null;
414
+ /** The setting holding the alarm line of the chart kinds whose frame draws it. */
415
+ export declare const CHART_ALARM_FIELDS: {
416
+ readonly histogram: "histAlarm";
417
+ readonly spectrum: "specAlarm";
418
+ readonly areachart: "acAlarm";
419
+ readonly losscurve: "lcAlarm";
420
+ readonly cdfchart: "cdAlarm";
421
+ readonly bubblechart: "bbAlarm";
422
+ readonly boxplot: "boxAlarm";
423
+ readonly violin: "vlAlarm";
424
+ readonly barchart: "bcAlarm";
425
+ readonly gantt: "gtAlarm";
426
+ };
427
+ /** A chart's alarm line and the axis it sits on (null: none, or a kind that draws its own). */
428
+ export declare function chartAlarm(s: PanelChartSettings | undefined): {
429
+ alarm: AlarmLine;
430
+ axis: 'x' | 'y';
431
+ } | null;
432
+ /** Validate and clamp radii; drop invalid entries. */
433
+ export declare function parsePanelChartSettingsMap(raw: unknown, _defaultXyColor: string, _defaultXyzRadius: number): Record<string, PanelChartSettings>;
434
+ /** Ensure every xyscatter / xyzmesh panel has an entry (fill from defaults). */
435
+ export declare function ensurePanelSettingsForPanels(panels: {
436
+ id: string;
437
+ kind: string;
438
+ }[], current: Record<string, PanelChartSettings>, defaultXyColor: string, defaultXyzRadius: number): Record<string, PanelChartSettings>;
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Tabular data parser. Accepts .dat files (header + units + tab-separated
3
+ * data, optionally with a meta header line) and CSV/TSV with comma,
4
+ * semicolon, or tab delimiters and an optional units row.
5
+ */
6
+ import { type ColumnTable } from './columnTable';
7
+ export type DatasetRow = Record<string, number | string | null>;
8
+ export interface Dataset {
9
+ meta: string;
10
+ columnNames: string[];
11
+ units: string[];
12
+ rows: DatasetRow[];
13
+ }
14
+ /** Indices (0-based) into the non-empty lines array returned by getRawNonEmptyLines. */
15
+ export interface DatasetParseConfig {
16
+ headerRow: number;
17
+ unitsRow: number | null;
18
+ dataStartRow: number;
19
+ }
20
+ type Delimiter = '\t' | ',' | ';';
21
+ /**
22
+ * Whether the data uses a comma as the decimal separator (European locale).
23
+ * Only possible when the field delimiter is not itself a comma. Decided by
24
+ * comparing how many cells look like "12,5" vs "12.5" across a sample.
25
+ */
26
+ export declare function detectDecimalComma(lines: string[], delim: '\t' | ',' | ';'): boolean;
27
+ export declare function detectDelimiter(headerLine: string): Delimiter;
28
+ /**
29
+ * Parse .dat or CSV/TSV content. Supports an optional free-form meta line,
30
+ * an auto-detected delimiter (tab, comma, or semicolon), and an optional
31
+ * units row.
32
+ */
33
+ export declare function parseDataset(text: string): Dataset;
34
+ /** Returns the non-empty lines used internally by the parser (BOM stripped, trimEnd). */
35
+ export declare function getRawNonEmptyLines(text: string): string[];
36
+ /** True when two parse configs select the same header / units / data rows. */
37
+ export declare function parseConfigsEqual(a: DatasetParseConfig, b: DatasetParseConfig): boolean;
38
+ /** Auto-detect the header / units / data-start row indices for a file. */
39
+ export declare function inferParseConfig(text: string): DatasetParseConfig;
40
+ /**
41
+ * Column names for a header row, derived from a single line of the already-split
42
+ * non-empty lines. Lets callers that only need the column list (e.g. the config
43
+ * preview) skip parsing every data row.
44
+ */
45
+ export declare function parseColumnNames(nonEmptyLines: string[], headerRow: number): string[];
46
+ /** Parse using explicit row indices instead of auto-detection. */
47
+ export declare function parseDatasetWithConfig(text: string, config: DatasetParseConfig): Dataset;
48
+ /** Header part of a dataset plus its cells stored by column (see `ColumnTable`). */
49
+ export interface ParsedTable {
50
+ meta: string;
51
+ columnNames: string[];
52
+ units: string[];
53
+ table: ColumnTable;
54
+ }
55
+ /**
56
+ * `parseDatasetWithConfig`, with the cells stored by column instead of as row
57
+ * objects. Data lines are read in place (no array of lines, no array of cells):
58
+ * a 214 MB file allocated a string per line and per cell. A line with quotes,
59
+ * a BOM, trailing whitespace or a lone `\r` goes through the reference
60
+ * (`parseDatasetTableByLines`) code for that line, so the result is identical.
61
+ */
62
+ export declare function parseDatasetTable(text: string, config: DatasetParseConfig): ParsedTable;
63
+ /** Reference parser behind `parseDatasetTable`: splits the text into lines, then cells. */
64
+ export declare function parseDatasetTableByLines(text: string, config: DatasetParseConfig): ParsedTable;
65
+ /**
66
+ * True if `col` holds numbers. Looks at up to 5000 values spread over ALL the
67
+ * rows, never just the first ones: merged data (several datasets, or imported
68
+ * data plus a live stream) puts one source after another, so a column only a
69
+ * later source has would otherwise read as empty. A column the spread sample
70
+ * misses entirely (only a few rows have it) is searched for row by row.
71
+ */
72
+ export declare function columnIsNumeric(rows: DatasetRow[], col: string): boolean;
73
+ export declare function subsampleIndices(length: number, maxPoints: number): number[];
74
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ import { type Dataset, type DatasetParseConfig, type ParsedTable } from './parseDataset';
2
+ /** Request sent to the dataset parse worker: the text, or a file the worker reads itself. */
3
+ export type ParseRequest = {
4
+ rawText: string;
5
+ config: DatasetParseConfig;
6
+ } | {
7
+ file: Blob;
8
+ config: DatasetParseConfig;
9
+ };
10
+ /** Response posted back from the dataset parse worker. */
11
+ export type ParseResponse = {
12
+ ok: true;
13
+ data: ParsedTable;
14
+ } | {
15
+ ok: false;
16
+ error: string;
17
+ };
18
+ /** Minimal slice of the Worker API used here — keeps the client testable. */
19
+ export interface WorkerLike {
20
+ postMessage(msg: ParseRequest): void;
21
+ terminate(): void;
22
+ onmessage: ((e: MessageEvent<ParseResponse>) => void) | null;
23
+ onerror: ((e: unknown) => void) | null;
24
+ }
25
+ /**
26
+ * Parse a dataset off the main thread. Spins up a worker per call, resolves with
27
+ * the parsed Dataset (or rejects on a parse/worker error), and always terminates
28
+ * the worker afterwards. `createWorker` is injectable for tests.
29
+ */
30
+ export declare function parseDatasetInWorker(req: ParseRequest, createWorker?: () => WorkerLike, signal?: AbortSignal): Promise<Dataset>;
31
+ /** Parse in a worker where there are workers, else here (tests, server-side): column-backed rows either way. */
32
+ export declare function parseDatasetAnywhere(req: ParseRequest, signal?: AbortSignal): Promise<Dataset>;
@@ -0,0 +1,4 @@
1
+ /** Time an async operation; logs `[perf] <label> #<n> <ms>` when enabled. */
2
+ export declare function perfTime<T>(label: string, fn: () => Promise<T>): Promise<T>;
3
+ /** Time a synchronous operation; logs `[perf] <label> #<n> <ms>` when enabled. */
4
+ export declare function perfSync<T>(label: string, fn: () => T): T;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Order statistics without sorting: quickselect puts the value of rank `k` at
3
+ * a[k], smaller ones before it and larger ones after (expected O(n)).
4
+ */
5
+ export declare function selectInPlace(a: Float64Array, k: number, lo?: number, hi?: number): number;
6
+ /**
7
+ * Percentiles `ps` (0..100, ascending) of `a`, interpolated between ranks as
8
+ * numpy's default (linear). `a` is reordered.
9
+ */
10
+ export declare function percentilesInPlace(a: Float64Array, ps: number[]): number[];
@@ -0,0 +1,10 @@
1
+ import type { Chunk } from '../importers/combine';
2
+ import type { OutColumn } from '../importers/run';
3
+ /** Combined chunks as CSV parts: a header row, a units row, one row per sample (NaN empty), like LiveRecorder. */
4
+ export declare class CsvWriter {
5
+ #private;
6
+ constructor(columns: OutColumn[]);
7
+ head(): string;
8
+ append(c: Chunk): string;
9
+ end(): void;
10
+ }
@@ -0,0 +1,26 @@
1
+ import { type WorkerLike } from '../importers/session';
2
+ import type { RecordingKey } from './keys';
3
+ export interface RecordingSource {
4
+ name: string;
5
+ chunks: Blob[];
6
+ keys: RecordingKey[];
7
+ }
8
+ /** A piece of the exported file, in order. */
9
+ export type ExportPart = string | Uint8Array<ArrayBuffer>;
10
+ export interface ExportOptions {
11
+ signal?: AbortSignal;
12
+ onProgress?: (fraction: number) => void;
13
+ createWorker?: () => WorkerLike;
14
+ }
15
+ export declare const EXPORT_TYPES: {
16
+ readonly csv: "text/csv";
17
+ readonly mf4: "application/octet-stream";
18
+ };
19
+ /**
20
+ * A recording as a CSV or MF4 file, built in the browser from its encrypted chunks and handed to `write` piece by
21
+ * piece, in order (awaited: back-pressure). Any size: nothing holds the whole file, so a file sink or a streamed
22
+ * download keeps memory flat.
23
+ */
24
+ export declare function exportRecordingTo(src: RecordingSource, format: 'csv' | 'mf4', write: (part: ExportPart) => void | Promise<void>, o?: ExportOptions): Promise<void>;
25
+ /** The same as one Blob of the parts (small exports, tests). Large ones: exportRecordingTo a file or a stream. */
26
+ export declare function exportRecording(src: RecordingSource, format: 'csv' | 'mf4', o?: ExportOptions): Promise<Blob>;
@@ -0,0 +1,2 @@
1
+ import type { Importer } from '../importers/types';
2
+ export declare const krcImporter: Importer;
@@ -0,0 +1,23 @@
1
+ export interface RecordingKey {
2
+ /** The project key epoch & 0xff of a project stream's key; null: a password stream's key. */
3
+ keyId: number | null;
4
+ /** Non-extractable AES-256-GCM (importStreamKey). */
5
+ key: CryptoKey;
6
+ }
7
+ /** A recording key re-sealed under a later project key epoch. */
8
+ export declare const recordingKeyAad: (recordingKeyId: string, projectId: string, epoch: number) => string;
9
+ /** The aad of a recording key's row at `epoch`: the sender's own seal at its first epoch (copied by the server),
10
+ * a re-seal at any later one (plan Decision 14). */
11
+ export declare const recordingKeySealAad: (k: {
12
+ id: string;
13
+ stream_epoch: number;
14
+ stream_id: string;
15
+ }, projectId: string, epoch: number) => string;
16
+ /**
17
+ * Opens recorded wire messages (views, never copied) with the keys of their key id, the last one that worked
18
+ * first. Null: malformed, or no key opens it.
19
+ */
20
+ export declare function messageOpener(keys: RecordingKey[]): (m: Uint8Array) => Promise<{
21
+ kind: number;
22
+ plaintext: Uint8Array;
23
+ } | null>;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * KRC1: one chunk of a cloud recording, written by the relay (workers/live-relay/src/krc.ts, byte-identical):
3
+ * the wire messages it forwarded, exactly as forwarded, with their relay receive times. Little-endian:
4
+ *
5
+ * 0 'KRC1' 24 u32 seq
6
+ * 4 u16 version (1) 28 u32 messages M
7
+ * 6 u16 header bytes 32 u32 chunk bytes (header + records)
8
+ * 8 recording id (16) 36 u32 reserved (0)
9
+ * 40 f64 t0, 48 f64 t1: relay time of the first / last message (ms since epoch)
10
+ * 56 M × { f64 relay ms, u32 length L, L bytes }
11
+ *
12
+ * The chunk length makes a concatenation of chunks walkable header to header. Pinned vector:
13
+ * tests/vectors/krc1-v1.json.
14
+ */
15
+ export declare const KRC_HEADER_BYTES = 56;
16
+ export interface KrcHeader {
17
+ recordingId: string;
18
+ seq: number;
19
+ count: number;
20
+ bytes: number;
21
+ headerBytes: number;
22
+ t0: number;
23
+ t1: number;
24
+ }
25
+ export interface KrcMessage {
26
+ at: number;
27
+ bytes: Uint8Array;
28
+ }
29
+ export declare function uuidBytes(id: string): Uint8Array;
30
+ /** A chunk (tests, the bench, local tools; the relay has its own copy that never copies the messages). */
31
+ export declare function encodeKrc(recordingId: string, seq: number, messages: KrcMessage[]): Uint8Array<ArrayBuffer>;
32
+ export declare function parseKrcHeader(b: Uint8Array): KrcHeader;
33
+ /** Every record of one chunk (views into `b`); `truncated` when it ends early (the records before the cut are kept). */
34
+ export declare function parseKrc(b: Uint8Array): {
35
+ header: KrcHeader;
36
+ messages: KrcMessage[];
37
+ truncated: boolean;
38
+ };