@kymoscope/sdk 0.0.0-stage → 0.1.1
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/LICENSE.md +69 -0
- package/README.md +138 -2
- package/dist/assets/duckdb-browser-eh.worker--3HUwN9R.js +14 -0
- package/dist/assets/duckdb-eh-D-nnNw7L.wasm.gz +0 -0
- package/dist/assets/h5wasmModule-BCQWU2Gw.js +24295 -0
- package/dist/assets/importer.worker-D4is7BLf.js +6 -0
- package/dist/assets/offscreenLineWorker-mShhnyXX.js +79 -0
- package/dist/assets/parseDataset.worker-PynRsPD8.js +5 -0
- package/dist/importers-DivmF3tx.js +5 -0
- package/dist/krc-CbE28CjD.js +9 -0
- package/dist/kymoscope-embed.js +633 -0
- package/dist/kymoscope-sdk.js +616 -0
- package/dist/react.js +2 -0
- package/dist/styles/charts.css +207 -0
- package/dist/styles/fonts/OFL.txt +93 -0
- package/dist/styles/fonts/plus-jakarta-sans-italic-latin-ext.woff2 +0 -0
- package/dist/styles/fonts/plus-jakarta-sans-italic-latin.woff2 +0 -0
- package/dist/styles/fonts/plus-jakarta-sans-latin-ext.woff2 +0 -0
- package/dist/styles/fonts/plus-jakarta-sans-latin.woff2 +0 -0
- package/dist/styles/tokens.css +218 -0
- package/dist/types/charts/AlarmOverlay.d.ts +11 -0
- package/dist/types/charts/AnnotationLayer.d.ts +29 -0
- package/dist/types/charts/ChartBody.d.ts +52 -0
- package/dist/types/charts/PerfHud.d.ts +20 -0
- package/dist/types/charts/beacon.d.ts +27 -0
- package/dist/types/charts/chartWindow.d.ts +31 -0
- package/dist/types/charts/liveOverlay.d.ts +16 -0
- package/dist/types/charts/runtime.d.ts +63 -0
- package/dist/types/charts/useWorksheetData.d.ts +159 -0
- package/dist/types/components/AreaChart.d.ts +21 -0
- package/dist/types/components/BarChart.d.ts +30 -0
- package/dist/types/components/BoxPlotChart.d.ts +16 -0
- package/dist/types/components/BubbleChart.d.ts +24 -0
- package/dist/types/components/CalibrationChart.d.ts +15 -0
- package/dist/types/components/CdfChart.d.ts +15 -0
- package/dist/types/components/ConfusionChart.d.ts +11 -0
- package/dist/types/components/ControlChart.d.ts +17 -0
- package/dist/types/components/DuckDbMultiBandPanel.d.ts +35 -0
- package/dist/types/components/EmbeddingChart.d.ts +25 -0
- package/dist/types/components/FlameGraphChart.d.ts +15 -0
- package/dist/types/components/GanttChart.d.ts +15 -0
- package/dist/types/components/GaugeChart.d.ts +27 -0
- package/dist/types/components/HeatmapChart.d.ts +41 -0
- package/dist/types/components/HistogramChart.d.ts +15 -0
- package/dist/types/components/LossCurveChart.d.ts +17 -0
- package/dist/types/components/MultiBandCanvasChart.d.ts +156 -0
- package/dist/types/components/ParallelCoordsChart.d.ts +21 -0
- package/dist/types/components/PolarChart.d.ts +17 -0
- package/dist/types/components/QQPlotChart.d.ts +16 -0
- package/dist/types/components/RadarChart.d.ts +17 -0
- package/dist/types/components/RocChart.d.ts +12 -0
- package/dist/types/components/SankeyChart.d.ts +15 -0
- package/dist/types/components/SpectrogramChart.d.ts +16 -0
- package/dist/types/components/SpectrogramWaterfall.d.ts +14 -0
- package/dist/types/components/SpectrumChart.d.ts +17 -0
- package/dist/types/components/TreemapChart.d.ts +14 -0
- package/dist/types/components/ViolinChart.d.ts +17 -0
- package/dist/types/components/XYScatterChart.d.ts +47 -0
- package/dist/types/components/XYZMeshChart.d.ts +68 -0
- package/dist/types/components/dashboardGridLayout.d.ts +50 -0
- package/dist/types/components/liveFollowEase.d.ts +10 -0
- package/dist/types/components/liveWindow.d.ts +63 -0
- package/dist/types/components/multiBandHover.d.ts +44 -0
- package/dist/types/embed/Attribution.d.ts +5 -0
- package/dist/types/embed/license.d.ts +29 -0
- package/dist/types/embed/standalone.d.ts +5 -0
- package/dist/types/engine/columns.d.ts +44 -0
- package/dist/types/engine/createEngine.d.ts +394 -0
- package/dist/types/engine/derive.d.ts +27 -0
- package/dist/types/engine/emitter.d.ts +6 -0
- package/dist/types/engine/errors.d.ts +7 -0
- package/dist/types/engine/history.d.ts +29 -0
- package/dist/types/engine/kinds.d.ts +9 -0
- package/dist/types/engine/liveController.d.ts +27 -0
- package/dist/types/engine/store.d.ts +8 -0
- package/dist/types/engine/types.d.ts +194 -0
- package/dist/types/index.d.ts +69 -0
- package/dist/types/lib/annotations.d.ts +37 -0
- package/dist/types/lib/beacon.d.ts +62 -0
- package/dist/types/lib/colorScheme.d.ts +5 -0
- package/dist/types/lib/colormap.d.ts +9 -0
- package/dist/types/lib/columnTable.d.ts +37 -0
- package/dist/types/lib/data/arrowDecimation.d.ts +11 -0
- package/dist/types/lib/data/binnedHeatmap.d.ts +27 -0
- package/dist/types/lib/data/columnCaches.d.ts +6 -0
- package/dist/types/lib/data/columnarDataSource.d.ts +34 -0
- package/dist/types/lib/data/createDataSource.d.ts +23 -0
- package/dist/types/lib/data/dataSource.d.ts +75 -0
- package/dist/types/lib/data/decimate.d.ts +25 -0
- package/dist/types/lib/data/duckDbDataSource.d.ts +42 -0
- package/dist/types/lib/data/envelope.d.ts +16 -0
- package/dist/types/lib/data/inMemoryDataSource.d.ts +25 -0
- package/dist/types/lib/data/liveDataSource.d.ts +77 -0
- package/dist/types/lib/data/lruCache.d.ts +11 -0
- package/dist/types/lib/data/openDataset.d.ts +24 -0
- package/dist/types/lib/data/opfsParquet.d.ts +4 -0
- package/dist/types/lib/data/pointColumns.d.ts +59 -0
- package/dist/types/lib/data/schemaColumns.d.ts +5 -0
- package/dist/types/lib/data/useSeriesPoints.d.ts +48 -0
- package/dist/types/lib/data/xyColumns.d.ts +77 -0
- package/dist/types/lib/dataBounds.d.ts +10 -0
- package/dist/types/lib/datasetColors.d.ts +19 -0
- package/dist/types/lib/datasetColumns.d.ts +3 -0
- package/dist/types/lib/datasetMerge.d.ts +8 -0
- package/dist/types/lib/duckdb/duckdbInstance.d.ts +7 -0
- package/dist/types/lib/duckdb/fileIdentity.d.ts +9 -0
- package/dist/types/lib/duckdb/sql.d.ts +124 -0
- package/dist/types/lib/fft.d.ts +15 -0
- package/dist/types/lib/folderTree.d.ts +29 -0
- package/dist/types/lib/gaugeColors.d.ts +32 -0
- package/dist/types/lib/importers/arrowSink.d.ts +35 -0
- package/dist/types/lib/importers/blobReader.d.ts +22 -0
- package/dist/types/lib/importers/bytes.d.ts +11 -0
- package/dist/types/lib/importers/combine.d.ts +30 -0
- package/dist/types/lib/importers/comtrade/format.d.ts +2 -0
- package/dist/types/lib/importers/comtrade/importer.d.ts +25 -0
- package/dist/types/lib/importers/dbc.d.ts +45 -0
- package/dist/types/lib/importers/edf/format.d.ts +2 -0
- package/dist/types/lib/importers/edf/importer.d.ts +7 -0
- package/dist/types/lib/importers/expr.d.ts +10 -0
- package/dist/types/lib/importers/formats.d.ts +23 -0
- package/dist/types/lib/importers/hdf5/format.d.ts +4 -0
- package/dist/types/lib/importers/hdf5/h5.d.ts +76 -0
- package/dist/types/lib/importers/hdf5/h5wasmModule.d.ts +1 -0
- package/dist/types/lib/importers/hdf5/importer.d.ts +2 -0
- package/dist/types/lib/importers/importer.worker.d.ts +5 -0
- package/dist/types/lib/importers/importers.d.ts +4 -0
- package/dist/types/lib/importers/limits.d.ts +28 -0
- package/dist/types/lib/importers/mat/format.d.ts +2 -0
- package/dist/types/lib/importers/mat/group.d.ts +19 -0
- package/dist/types/lib/importers/mat/importer.d.ts +2 -0
- package/dist/types/lib/importers/mat/v5.d.ts +24 -0
- package/dist/types/lib/importers/mat/v73.d.ts +13 -0
- package/dist/types/lib/importers/mdf/blocks3.d.ts +3 -0
- package/dist/types/lib/importers/mdf/blocks4.d.ts +7 -0
- package/dist/types/lib/importers/mdf/bus.d.ts +59 -0
- package/dist/types/lib/importers/mdf/conversion.d.ts +48 -0
- package/dist/types/lib/importers/mdf/decode.d.ts +15 -0
- package/dist/types/lib/importers/mdf/format.d.ts +2 -0
- package/dist/types/lib/importers/mdf/importer.d.ts +19 -0
- package/dist/types/lib/importers/mdf/model.d.ts +75 -0
- package/dist/types/lib/importers/mdf/records.d.ts +31 -0
- package/dist/types/lib/importers/mdf/stream.d.ts +42 -0
- package/dist/types/lib/importers/memorySink.d.ts +11 -0
- package/dist/types/lib/importers/names.d.ts +2 -0
- package/dist/types/lib/importers/openImport.d.ts +33 -0
- package/dist/types/lib/importers/registry.d.ts +24 -0
- package/dist/types/lib/importers/run.d.ts +35 -0
- package/dist/types/lib/importers/session.d.ts +28 -0
- package/dist/types/lib/importers/tdms/format.d.ts +2 -0
- package/dist/types/lib/importers/tdms/importer.d.ts +10 -0
- package/dist/types/lib/importers/types.d.ts +172 -0
- package/dist/types/lib/importers/workerCore.d.ts +44 -0
- package/dist/types/lib/importers/xdf/format.d.ts +2 -0
- package/dist/types/lib/importers/xdf/importer.d.ts +2 -0
- package/dist/types/lib/importers/zlib.d.ts +13 -0
- package/dist/types/lib/kde.d.ts +2 -0
- package/dist/types/lib/live/buffer.d.ts +265 -0
- package/dist/types/lib/live/columnsWire.d.ts +24 -0
- package/dist/types/lib/live/crypto.d.ts +157 -0
- package/dist/types/lib/live/liveMathChannels.d.ts +11 -0
- package/dist/types/lib/live/recorder.d.ts +32 -0
- package/dist/types/lib/live/stream.d.ts +33 -0
- package/dist/types/lib/live/timeBuckets.d.ts +71 -0
- package/dist/types/lib/live/types.d.ts +72 -0
- package/dist/types/lib/live/wire.d.ts +25 -0
- package/dist/types/lib/mathChannels/compile.d.ts +22 -0
- package/dist/types/lib/mathChannels/evaluator.d.ts +40 -0
- package/dist/types/lib/mathChannels/functions/conditional.d.ts +2 -0
- package/dist/types/lib/mathChannels/functions/filters.d.ts +7 -0
- package/dist/types/lib/mathChannels/functions/index.d.ts +3 -0
- package/dist/types/lib/mathChannels/functions/reference.d.ts +7 -0
- package/dist/types/lib/mathChannels/functions/windowOps.d.ts +11 -0
- package/dist/types/lib/mathChannels/index.d.ts +13 -0
- package/dist/types/lib/mathChannels/io.d.ts +18 -0
- package/dist/types/lib/mathChannels/mathjsSetup.d.ts +7 -0
- package/dist/types/lib/mathChannels/parseMath.d.ts +12 -0
- package/dist/types/lib/mathChannels/parser.d.ts +22 -0
- package/dist/types/lib/mathChannels/types.d.ts +34 -0
- package/dist/types/lib/mathChannels/usedChannels.d.ts +14 -0
- package/dist/types/lib/moduleWorker.d.ts +7 -0
- package/dist/types/lib/panelChartSettings.d.ts +438 -0
- package/dist/types/lib/parseDataset.d.ts +74 -0
- package/dist/types/lib/parseDataset.worker.d.ts +1 -0
- package/dist/types/lib/parseDatasetWorkerClient.d.ts +32 -0
- package/dist/types/lib/perfLog.d.ts +4 -0
- package/dist/types/lib/quantiles.d.ts +10 -0
- package/dist/types/lib/recordings/csvWriter.d.ts +10 -0
- package/dist/types/lib/recordings/export.d.ts +26 -0
- package/dist/types/lib/recordings/importer.d.ts +2 -0
- package/dist/types/lib/recordings/keys.d.ts +23 -0
- package/dist/types/lib/recordings/krc.d.ts +38 -0
- package/dist/types/lib/recordings/mf4Writer.d.ts +20 -0
- package/dist/types/lib/render/chartFonts.d.ts +10 -0
- package/dist/types/lib/render/colorBucket.d.ts +6 -0
- package/dist/types/lib/render/contours.d.ts +16 -0
- package/dist/types/lib/render/cssColor.d.ts +2 -0
- package/dist/types/lib/render/frames.d.ts +46 -0
- package/dist/types/lib/render/gl3d.d.ts +63 -0
- package/dist/types/lib/render/glLines.d.ts +62 -0
- package/dist/types/lib/render/glPlot.d.ts +36 -0
- package/dist/types/lib/render/glPoints.d.ts +37 -0
- package/dist/types/lib/render/glSeries.d.ts +67 -0
- package/dist/types/lib/render/heatGrid.d.ts +9 -0
- package/dist/types/lib/render/hitGrid.d.ts +16 -0
- package/dist/types/lib/render/liveZoomBus.d.ts +18 -0
- package/dist/types/lib/render/margins.d.ts +14 -0
- package/dist/types/lib/render/offscreenLineRenderer.d.ts +53 -0
- package/dist/types/lib/render/offscreenLineWorker.d.ts +1 -0
- package/dist/types/lib/render/plotFrame.d.ts +36 -0
- package/dist/types/lib/render/resample.d.ts +18 -0
- package/dist/types/lib/render/sharedGl.d.ts +38 -0
- package/dist/types/lib/render/useGlPlot.d.ts +7 -0
- package/dist/types/lib/savedLayout.d.ts +45 -0
- package/dist/types/lib/stft.d.ts +37 -0
- package/dist/types/lib/workspaces/encrypted.d.ts +50 -0
- package/dist/types/lib/workspaces/io.d.ts +120 -0
- package/dist/types/lib/xyFit.d.ts +14 -0
- package/dist/types/lib/yAxisTicks.d.ts +28 -0
- package/dist/types/react/index.d.ts +32 -0
- package/dist/types/types/loadedDataset.d.ts +42 -0
- package/dist/types/types/plotSeries.d.ts +27 -0
- package/package.json +63 -4
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Colours of a gauge by value: one colour ('solid'), a gradient through colour
|
|
3
|
+
* stops ('gradient': each stop's colour exactly at its value, blended between),
|
|
4
|
+
* or zones ('zones': each stop's colour from its value up to the next stop's;
|
|
5
|
+
* below the first, the first). Stop values are in the channel's units.
|
|
6
|
+
*/
|
|
7
|
+
export type GaugeColorMode = 'solid' | 'gradient' | 'zones';
|
|
8
|
+
export interface GaugeColorStop {
|
|
9
|
+
at: number;
|
|
10
|
+
color: string;
|
|
11
|
+
}
|
|
12
|
+
/** A run of the scale (fractions 0..1) and its colour. */
|
|
13
|
+
export interface ColorInterval {
|
|
14
|
+
f0: number;
|
|
15
|
+
f1: number;
|
|
16
|
+
color: string;
|
|
17
|
+
}
|
|
18
|
+
/** The colour at a value. */
|
|
19
|
+
export declare function colorAt(mode: GaugeColorMode | undefined, stops: GaugeColorStop[] | undefined, solid: string, v: number): string;
|
|
20
|
+
/**
|
|
21
|
+
* The scale [min, max] as coloured runs: zones exactly at their limits, a
|
|
22
|
+
* gradient in `steps` short runs.
|
|
23
|
+
*/
|
|
24
|
+
export declare function colorIntervals(mode: GaugeColorMode | undefined, stops: GaugeColorStop[] | undefined, solid: string, min: number, max: number, steps?: number): ColorInterval[];
|
|
25
|
+
export type GaugePreset = 'green-red' | 'red-green' | 'traffic';
|
|
26
|
+
/** Ready-made stops over a scale: green to red (higher is worse), red to green, or green · amber · red zones. */
|
|
27
|
+
export declare function presetStops(p: GaugePreset, min: number, max: number): {
|
|
28
|
+
mode: GaugeColorMode;
|
|
29
|
+
stops: GaugeColorStop[];
|
|
30
|
+
};
|
|
31
|
+
/** A CSS background previewing the colours across the stops' own range. */
|
|
32
|
+
export declare function colorsCss(mode: GaugeColorMode | undefined, stops: GaugeColorStop[] | undefined, solid: string): string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Table, type Vector } from 'apache-arrow';
|
|
2
|
+
import type { Chunk } from './combine';
|
|
3
|
+
/** The part of a DuckDB connection the sink uses. */
|
|
4
|
+
export interface ArrowConnection {
|
|
5
|
+
insertArrowTable(table: Table, options: {
|
|
6
|
+
name: string;
|
|
7
|
+
create?: boolean;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A Float64 vector over `v` without copying it. NaN becomes null: DuckDB sorts
|
|
12
|
+
* NaN above every number, so max() (axis bounds, the resolution pyramid) would
|
|
13
|
+
* return NaN, while nulls are skipped like the empty cells of a CSV.
|
|
14
|
+
*/
|
|
15
|
+
export declare function f64Vector(v: Float64Array): Vector;
|
|
16
|
+
/** DuckDB's row group size: an insert of fewer rows costs about as much as a whole group. */
|
|
17
|
+
export declare const ROW_GROUP = 122880;
|
|
18
|
+
/**
|
|
19
|
+
* Combined chunks into a DuckDB table as Arrow record batches (the out-of-core
|
|
20
|
+
* path). Chunks wait until a row group's worth is buffered, then go in one
|
|
21
|
+
* insert (one record batch each, no copy): an MF4 chunk is 8k rows, and 50
|
|
22
|
+
* one-chunk inserts took 2 s for 400k rows (row-group inserts: 0.6 s).
|
|
23
|
+
*/
|
|
24
|
+
export declare class ArrowSink {
|
|
25
|
+
#private;
|
|
26
|
+
rows: number;
|
|
27
|
+
constructor(conn: ArrowConnection, table: string, columns: {
|
|
28
|
+
name: string;
|
|
29
|
+
text: boolean;
|
|
30
|
+
}[], rowsPerInsert?: number);
|
|
31
|
+
/** Buffers the chunk; inserts once a row group's worth is waiting. */
|
|
32
|
+
append(chunk: Chunk): Promise<void>;
|
|
33
|
+
/** Inserts the buffered rows (call once after the last chunk). */
|
|
34
|
+
flush(): Promise<void>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Sequential data window: large enough to amortise each slice, small enough to never hold the file. */
|
|
2
|
+
export declare const WINDOW: number;
|
|
3
|
+
/**
|
|
4
|
+
* Reads a File/Blob in pieces, never whole. `read` serves scattered header
|
|
5
|
+
* reads through 1 MiB cached pages (MF4 and TDMS metadata is spread over the
|
|
6
|
+
* file); `slice` and `windows` read data uncached. Returned bytes are views:
|
|
7
|
+
* do not write to them.
|
|
8
|
+
*/
|
|
9
|
+
export declare class BlobReader {
|
|
10
|
+
#private;
|
|
11
|
+
readonly size: number;
|
|
12
|
+
/** Bytes read from the blob so far (progress). */
|
|
13
|
+
bytesRead: number;
|
|
14
|
+
constructor(blob: Blob);
|
|
15
|
+
read(offset: number, length: number): Promise<Uint8Array>;
|
|
16
|
+
/** Exactly [offset, offset + length), clipped to the file, uncached. */
|
|
17
|
+
slice(offset: number, length: number): Promise<Uint8Array>;
|
|
18
|
+
windows(offset: number, length: number, size?: number): AsyncGenerator<{
|
|
19
|
+
offset: number;
|
|
20
|
+
bytes: Uint8Array;
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Header helpers. Decoders read DataViews directly; nothing here runs per sample. */
|
|
2
|
+
export declare const view: (b: Uint8Array) => DataView;
|
|
3
|
+
/** Unsigned 64-bit integer as a Number (exact below 2^53, which counts and offsets are). */
|
|
4
|
+
export declare function u64(v: DataView, o: number, le?: boolean): number;
|
|
5
|
+
export declare function i64(v: DataView, o: number, le?: boolean): number;
|
|
6
|
+
/** Text up to the first NUL. */
|
|
7
|
+
export declare function cstr(b: Uint8Array, latin1?: boolean): string;
|
|
8
|
+
export declare const ascii: (b: Uint8Array) => string;
|
|
9
|
+
export declare const utf8: (b: Uint8Array) => string;
|
|
10
|
+
/** `b` starts with `s` (one byte per character code, so '\xFF' works). */
|
|
11
|
+
export declare function startsWith(b: Uint8Array, s: string, at?: number): boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Batch, ColumnValues, PlanChannel, PlanGroup } from './types';
|
|
2
|
+
/** A combined chunk: column 0 is Time, then every selected channel in selection order. */
|
|
3
|
+
export interface Chunk {
|
|
4
|
+
length: number;
|
|
5
|
+
columns: ColumnValues[];
|
|
6
|
+
}
|
|
7
|
+
/** One group's batches, in time order. */
|
|
8
|
+
export interface Feed {
|
|
9
|
+
pull(): Promise<Batch | null>;
|
|
10
|
+
}
|
|
11
|
+
export declare function iterFeed(it: AsyncIterable<Batch>): Feed;
|
|
12
|
+
/**
|
|
13
|
+
* Per-group feeds over one stream that interleaves groups (EDF records, XDF
|
|
14
|
+
* chunks, unsorted MF4): batches of the other groups wait in a queue. Bounded
|
|
15
|
+
* because such formats interleave their groups in time. `positions` maps a
|
|
16
|
+
* plan group to its feed.
|
|
17
|
+
*/
|
|
18
|
+
export declare function demux(it: AsyncIterator<Batch>, positions: Map<number, number>): Feed[];
|
|
19
|
+
/** Timestamps of a batch: its own, or made from the group's rate or sample index. */
|
|
20
|
+
export declare function batchTime(b: Batch, g: PlanGroup): Float64Array;
|
|
21
|
+
/**
|
|
22
|
+
* Groups onto one time base, streaming: the fastest regular group (most
|
|
23
|
+
* samples) plus every irregular group (their union) are the time base; the
|
|
24
|
+
* others hold their last value (zero-order hold). A chunk covers the rows up to
|
|
25
|
+
* H, the earliest last-buffered time of the time-base groups, so memory stays
|
|
26
|
+
* at about one batch per group whatever the file size. Returns the row count.
|
|
27
|
+
*/
|
|
28
|
+
export declare function combineGroups(groups: PlanGroup[], channels: PlanChannel[][], feeds: Feed[], emit: (chunk: Chunk) => void | Promise<void>, signal?: AbortSignal,
|
|
29
|
+
/** `emit` copies a chunk before it returns (the memory sink): numeric output columns are reused. */
|
|
30
|
+
reuse?: boolean): Promise<number>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Importer } from '../types';
|
|
2
|
+
interface Analog {
|
|
3
|
+
name: string;
|
|
4
|
+
unit: string;
|
|
5
|
+
a: number;
|
|
6
|
+
b: number;
|
|
7
|
+
}
|
|
8
|
+
interface Cfg {
|
|
9
|
+
station: string;
|
|
10
|
+
rev: number;
|
|
11
|
+
analog: Analog[];
|
|
12
|
+
digital: string[];
|
|
13
|
+
rates: [number, number][];
|
|
14
|
+
start: string | null;
|
|
15
|
+
trigger: string | null;
|
|
16
|
+
startSec: number;
|
|
17
|
+
triggerSec: number;
|
|
18
|
+
ft: string;
|
|
19
|
+
timemult: number;
|
|
20
|
+
/** Seconds per DAT timestamp unit: µs, or ns when the CFG times have nanoseconds. */
|
|
21
|
+
timebase: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function parseCfg(text: string): Cfg;
|
|
24
|
+
export declare const comtradeImporter: Importer;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface DbcSignal {
|
|
2
|
+
name: string;
|
|
3
|
+
/** DBC start bit: the LSB for Intel (little endian), the MSB for Motorola (big endian). */
|
|
4
|
+
start: number;
|
|
5
|
+
length: number;
|
|
6
|
+
littleEndian: boolean;
|
|
7
|
+
signed: boolean;
|
|
8
|
+
factor: number;
|
|
9
|
+
offset: number;
|
|
10
|
+
unit: string;
|
|
11
|
+
/** 'switch': the multiplexer; a number: present only when the multiplexer has that value. */
|
|
12
|
+
mux: 'switch' | number | null;
|
|
13
|
+
/** IEEE float signals (SIG_VALTYPE_ 1 = 32, 2 = 64); 0 = integer. */
|
|
14
|
+
float: 0 | 32 | 64;
|
|
15
|
+
/** Value table (VAL_): raw value → text. */
|
|
16
|
+
values: Map<number, string> | null;
|
|
17
|
+
}
|
|
18
|
+
export interface DbcMessage {
|
|
19
|
+
id: number;
|
|
20
|
+
extended: boolean;
|
|
21
|
+
name: string;
|
|
22
|
+
size: number;
|
|
23
|
+
signals: DbcSignal[];
|
|
24
|
+
}
|
|
25
|
+
/** Messages by key: the id, plus 0x80000000 for extended (29-bit) ids. */
|
|
26
|
+
export type Dbc = Map<number, DbcMessage>;
|
|
27
|
+
export declare const messageKey: (id: number, extended: boolean) => number;
|
|
28
|
+
/** Messages, signals (scaling, signedness, byte order, basic multiplexing), value tables and float types of a DBC. */
|
|
29
|
+
export declare function parseDbc(text: string): Dbc;
|
|
30
|
+
export type SignalReader = (d: Uint8Array, o: number) => number;
|
|
31
|
+
/**
|
|
32
|
+
* A reader of a signal's raw (unscaled) value in a frame's bytes at `o`, its
|
|
33
|
+
* bit layout worked out once (decoders call it per frame). Bytes past the
|
|
34
|
+
* frame read as 0.
|
|
35
|
+
*/
|
|
36
|
+
export declare function signalReader(s: DbcSignal): SignalReader;
|
|
37
|
+
/** Values of `n` frames, raw x `f` + `o`: frame k's bytes start at `at[idx[k]]` in `d`. */
|
|
38
|
+
export type SignalColumn = (d: Uint8Array, at: Int32Array, idx: Int32Array, n: number, out: Float64Array, f: number, o: number) => void;
|
|
39
|
+
/**
|
|
40
|
+
* A signal's raw values over many frames at once: one loop per bit layout (the
|
|
41
|
+
* common up-to-32-bit Intel and Motorola fields inline), the reader otherwise.
|
|
42
|
+
*/
|
|
43
|
+
export declare function signalColumn(s: DbcSignal): SignalColumn;
|
|
44
|
+
/** The raw (unscaled) value of a signal in a frame's bytes at `o`. Bytes past the frame read as 0. */
|
|
45
|
+
export declare function rawValue(s: DbcSignal, d: Uint8Array, o: number): number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Importer } from '../types';
|
|
2
|
+
/** EDF+ TALs of one record's annotation bytes. The first one of a record keeps time (its onset, no text). */
|
|
3
|
+
export declare function parseTals(b: Uint8Array): {
|
|
4
|
+
onset: number;
|
|
5
|
+
texts: string[];
|
|
6
|
+
}[];
|
|
7
|
+
export declare const edfImporter: Importer;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type Fn = (x: number) => number;
|
|
2
|
+
/**
|
|
3
|
+
* A conversion formula of X (MF4 algebraic conversions, MDF3 ASAM formulas) as
|
|
4
|
+
* a function: numbers, X (or X1, x), + - * / ^, parentheses and the functions
|
|
5
|
+
* above. Anything else gives null (the raw values are kept, with a note).
|
|
6
|
+
* Built as closures, never evaluated as code. Longer than MAX_FORMULA
|
|
7
|
+
* characters: null (its closures would nest too deep to evaluate).
|
|
8
|
+
*/
|
|
9
|
+
export declare function compileFormula(src: string): Fn | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the page needs to know about each binary format before any parser
|
|
3
|
+
* loads: names, extensions, companions and magic bytes. The parsers live in
|
|
4
|
+
* `importers.ts`, loaded by the import worker.
|
|
5
|
+
*/
|
|
6
|
+
export interface FormatInfo {
|
|
7
|
+
id: string;
|
|
8
|
+
label: string;
|
|
9
|
+
/** Lowercase, with the dot. A hint only: `sniff` decides. */
|
|
10
|
+
extensions: string[];
|
|
11
|
+
/** Files read with the main one: same base name, or (anyName) the only file of that kind in the drop. */
|
|
12
|
+
companions?: {
|
|
13
|
+
ext: string;
|
|
14
|
+
anyName?: boolean;
|
|
15
|
+
}[];
|
|
16
|
+
sniff(head: Uint8Array, name: string): boolean;
|
|
17
|
+
}
|
|
18
|
+
/** Bytes read from each file to recognise it. */
|
|
19
|
+
export declare const HEAD_BYTES = 4096;
|
|
20
|
+
/** Delimited text, read by the CSV path. */
|
|
21
|
+
export declare const TEXT_EXTENSIONS: string[];
|
|
22
|
+
/** Every binary format, in sniffing order (each format adds its entry). */
|
|
23
|
+
export declare const FORMATS: FormatInfo[];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** The part of h5wasm used here (h5wasm's own types ship with it; these keep the importers independent of how it is loaded). */
|
|
2
|
+
export interface H5Attrs {
|
|
3
|
+
[name: string]: {
|
|
4
|
+
value: unknown;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export interface H5Dataset {
|
|
8
|
+
shape: number[] | null;
|
|
9
|
+
metadata: {
|
|
10
|
+
type: number;
|
|
11
|
+
size: number;
|
|
12
|
+
shape?: number[] | null;
|
|
13
|
+
chunks?: number[] | null;
|
|
14
|
+
signed?: boolean;
|
|
15
|
+
compound_type?: {
|
|
16
|
+
members: {
|
|
17
|
+
name: string;
|
|
18
|
+
type: number;
|
|
19
|
+
}[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
attrs: H5Attrs;
|
|
23
|
+
filters?: {
|
|
24
|
+
id: number;
|
|
25
|
+
name: string;
|
|
26
|
+
}[];
|
|
27
|
+
slice(ranges: number[][]): unknown;
|
|
28
|
+
}
|
|
29
|
+
export interface H5Group {
|
|
30
|
+
attrs: H5Attrs;
|
|
31
|
+
keys(): string[];
|
|
32
|
+
get(name: string): unknown;
|
|
33
|
+
create_reference?(): {
|
|
34
|
+
ref_data: Uint8Array;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface H5Handle {
|
|
38
|
+
root: H5Group;
|
|
39
|
+
close(): void;
|
|
40
|
+
}
|
|
41
|
+
export type H5Opener = (file: File) => Promise<H5Handle>;
|
|
42
|
+
export declare const isGroup: (n: unknown) => n is H5Group;
|
|
43
|
+
/** Objects a walk visits at most (links can make a file's tree far larger than the file). */
|
|
44
|
+
export declare const MAX_OBJECTS = 100000;
|
|
45
|
+
/**
|
|
46
|
+
* A walk of a file's groups that visits each group once (hard links can make a
|
|
47
|
+
* group its own descendant) and stops after MAX_OBJECTS objects. `enter`
|
|
48
|
+
* returns false for a group seen before; `count` false once the budget is spent.
|
|
49
|
+
*/
|
|
50
|
+
export declare function h5Walk(): {
|
|
51
|
+
enter(g: H5Group): boolean;
|
|
52
|
+
count(): boolean;
|
|
53
|
+
note(): string | null;
|
|
54
|
+
};
|
|
55
|
+
/** Elements × element size of a dataset; more than a file can hold (×1032 for compressed data) means fill values never written, or damage. */
|
|
56
|
+
export declare function tooLarge(ds: H5Dataset, shape: number[], fileSize: number, compressed: boolean): boolean;
|
|
57
|
+
export declare const isDataset: (n: unknown) => n is H5Dataset;
|
|
58
|
+
/** Set by the import worker (h5wasm + WORKERFS) and by tests (h5wasm's Node build). */
|
|
59
|
+
export declare function setH5Loader(load: () => Promise<H5Opener>): void;
|
|
60
|
+
/**
|
|
61
|
+
* The file, opened once: plan and every read (and split re-reads) share the handle and its
|
|
62
|
+
* datasets, so per-dataset h5wasm calls (open, metadata) are paid once per import.
|
|
63
|
+
* ponytail: never closed (`close` is a no-op); the import worker is one per file and is
|
|
64
|
+
* terminated when the import ends. Close for real if a worker ever serves many files.
|
|
65
|
+
*/
|
|
66
|
+
/** Load h5wasm now (a failed load is tried again by the next call). */
|
|
67
|
+
export declare function warmH5(): void;
|
|
68
|
+
export declare function openH5(file: File): Promise<H5Handle>;
|
|
69
|
+
/** A dataset by absolute path, one object per path (h5wasm caches its metadata on the object). */
|
|
70
|
+
export declare function datasetAt(root: H5Group, path: string, found?: H5Dataset): H5Dataset;
|
|
71
|
+
/** A dataset's slice as Float64Array (int64 via Number; a fresh Float64Array is used as is). */
|
|
72
|
+
export declare function toF64(v: unknown): Float64Array;
|
|
73
|
+
/** Seconds per unit for time datasets. */
|
|
74
|
+
export declare const TIME_UNITS: Record<string, number>;
|
|
75
|
+
export declare function attrText(attrs: H5Attrs, ...names: string[]): string;
|
|
76
|
+
export declare function attrNumber(attrs: H5Attrs, ...names: string[]): number | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ImportPlan } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Bounds for files that may be damaged or hostile: every count, size and string
|
|
4
|
+
* that comes from a file is checked against these (O(1) checks) before it sizes
|
|
5
|
+
* an allocation or a loop.
|
|
6
|
+
*/
|
|
7
|
+
/** What the page shows when a reader fails in a way it did not foresee (RangeError, TypeError, a stuck worker). */
|
|
8
|
+
export declare const DAMAGED = "This file couldn't be read (it may be damaged).";
|
|
9
|
+
/** Deflate never inflates more than ~1032:1; a header claiming more is damaged. */
|
|
10
|
+
export declare const MAX_INFLATE_RATIO = 1032;
|
|
11
|
+
export declare const maxInflated: (compressed: number) => number;
|
|
12
|
+
/** One inflated block or variable held at once (MF4 DZ, MAT miCOMPRESSED). */
|
|
13
|
+
export declare const MAX_INFLATE: number;
|
|
14
|
+
/** Values a group may buffer before the others catch up (one interleaving stream, a held group): ~1 GB. */
|
|
15
|
+
export declare const MAX_PENDING_VALUES = 128000000;
|
|
16
|
+
export declare const capText: (s: string, n: number) => string;
|
|
17
|
+
/**
|
|
18
|
+
* The plan as the page may trust it: names, units, notes, meta and events
|
|
19
|
+
* length-capped; counts integers ≥ -1; rates finite and positive (a 'rate' time
|
|
20
|
+
* base that is not becomes the sample index, with a note); events at finite times.
|
|
21
|
+
*/
|
|
22
|
+
export declare function checkPlan(plan: ImportPlan): ImportPlan;
|
|
23
|
+
/**
|
|
24
|
+
* An error as the page shows it: the readers' own messages (plain Errors,
|
|
25
|
+
* cancellation) as they are; anything else (RangeError, TypeError, a wasm trap,
|
|
26
|
+
* a stack overflow) means the file broke an assumption: damaged.
|
|
27
|
+
*/
|
|
28
|
+
export declare function friendlyError(e: unknown): Error;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PlanGroup } from '../types';
|
|
2
|
+
/** One plottable vector: a variable, a matrix column or row, a struct field. */
|
|
3
|
+
export interface MatChannel {
|
|
4
|
+
name: string;
|
|
5
|
+
length: number;
|
|
6
|
+
read(s: number, e: number): Promise<Float64Array>;
|
|
7
|
+
}
|
|
8
|
+
export interface MatGroup {
|
|
9
|
+
name: string;
|
|
10
|
+
channels: MatChannel[];
|
|
11
|
+
time: MatChannel | null;
|
|
12
|
+
rate: number | null;
|
|
13
|
+
origin: number;
|
|
14
|
+
}
|
|
15
|
+
/** Channels → groups by length, each with its time channel (by name) or a lone rate scalar. */
|
|
16
|
+
export declare function groupChannels(channels: MatChannel[], strings: Map<string, string>, scalars: Map<string, number>): MatGroup[];
|
|
17
|
+
export declare function planGroups(groups: MatGroup[]): PlanGroup[];
|
|
18
|
+
/** The earliest first time value: Time = seconds from it. */
|
|
19
|
+
export declare function setOrigins(groups: MatGroup[]): Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BlobReader } from '../blobReader';
|
|
2
|
+
import type { MatChannel } from './group';
|
|
3
|
+
/** Bytes of a variable: the file, or an inflated miCOMPRESSED element. */
|
|
4
|
+
export interface Source {
|
|
5
|
+
readonly size: number;
|
|
6
|
+
read(offset: number, length: number): Promise<Uint8Array>;
|
|
7
|
+
release(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare class ZlibSource implements Source {
|
|
10
|
+
#private;
|
|
11
|
+
keep: boolean;
|
|
12
|
+
readonly size: number;
|
|
13
|
+
constructor(io: BlobReader, at: number, len: number, inflated: Uint8Array);
|
|
14
|
+
read(o: number, n: number): Promise<Uint8Array<ArrayBufferLike>>;
|
|
15
|
+
release(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface V5 {
|
|
18
|
+
channels: MatChannel[];
|
|
19
|
+
strings: Map<string, string>;
|
|
20
|
+
scalars: Map<string, number>;
|
|
21
|
+
notes: string[];
|
|
22
|
+
sources: ZlibSource[];
|
|
23
|
+
}
|
|
24
|
+
export declare function readV5(io: BlobReader): Promise<V5>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type H5Group } from '../hdf5/h5';
|
|
2
|
+
import type { MatChannel } from './group';
|
|
3
|
+
export interface V73 {
|
|
4
|
+
channels: MatChannel[];
|
|
5
|
+
strings: Map<string, string>;
|
|
6
|
+
scalars: Map<string, number>;
|
|
7
|
+
notes: string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Variables of a MAT 7.3 file. MATLAB is column-major, so an N×m variable is stored with HDF5 shape [m, N].
|
|
11
|
+
* `root` stays open for the import (see `openH5`), so the channels read through it later.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readV73(root: H5Group, fileSize: number): V73;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BlobReader } from '../blobReader';
|
|
2
|
+
import type { FileModel } from './model';
|
|
3
|
+
/** A DZ block inflated whole above this is refused (transposed) or streamed (plain). */
|
|
4
|
+
export declare const MAX_DZ: number;
|
|
5
|
+
/** The text of an MD (XML) block: its <TX>, else the XML without tags (linear: no backtracking on unclosed tags). */
|
|
6
|
+
export declare function mdText(xml: string): string;
|
|
7
|
+
export declare function readMdf4(io: BlobReader, version: string): Promise<FileModel>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { BlobReader } from '../blobReader';
|
|
2
|
+
import { type Dbc, type DbcSignal } from '../dbc';
|
|
3
|
+
import type { Batch, ColumnValues, PlanGroup } from '../types';
|
|
4
|
+
import { type ChannelModel, type FileModel, type GroupModel } from './model';
|
|
5
|
+
/** The members of a CAN_DataFrame structure. */
|
|
6
|
+
export interface FrameLayout {
|
|
7
|
+
id: ChannelModel;
|
|
8
|
+
ide: ChannelModel | null;
|
|
9
|
+
data: ChannelModel;
|
|
10
|
+
}
|
|
11
|
+
export declare function frameLayout(g: GroupModel): FrameLayout | null;
|
|
12
|
+
/** One output group of a message: all its frames (`mux` null) or the frames with one multiplexer value. */
|
|
13
|
+
export interface BusRoute {
|
|
14
|
+
key: number;
|
|
15
|
+
mux: number | null;
|
|
16
|
+
signals: DbcSignal[];
|
|
17
|
+
/** Plan channels: signal index, and whether it is the value-table text. */
|
|
18
|
+
channels: {
|
|
19
|
+
s: number;
|
|
20
|
+
text: boolean;
|
|
21
|
+
}[];
|
|
22
|
+
}
|
|
23
|
+
/** A route's frames decoded from one batch of records: their times and the route's channels (all, or the selected ones). */
|
|
24
|
+
interface Chunk {
|
|
25
|
+
time: Float64Array;
|
|
26
|
+
cols: ColumnValues[];
|
|
27
|
+
}
|
|
28
|
+
export interface BusPlan {
|
|
29
|
+
dbc: Dbc;
|
|
30
|
+
/** Per bus model group: its layout. */
|
|
31
|
+
layouts: Map<number, FrameLayout>;
|
|
32
|
+
routes: {
|
|
33
|
+
model: number;
|
|
34
|
+
route: BusRoute;
|
|
35
|
+
group: PlanGroup;
|
|
36
|
+
}[];
|
|
37
|
+
notes: string[];
|
|
38
|
+
/** Every channel of a route, decoded while planning (one pass over the file); the first read of a route takes it over. */
|
|
39
|
+
cache: Map<BusRoute, Chunk[]>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Bus groups → message groups, in one pass over the frames: it counts each
|
|
43
|
+
* message (and multiplexer value) and its time span, so the plan has exact
|
|
44
|
+
* counts and rates, and decodes every signal on the way (a read then takes the
|
|
45
|
+
* values over instead of decoding the file again). Messages that never occur
|
|
46
|
+
* are left out.
|
|
47
|
+
*/
|
|
48
|
+
export declare function planBus(io: BlobReader, model: FileModel, dbcFiles: File[], signal?: AbortSignal): Promise<BusPlan | null>;
|
|
49
|
+
/**
|
|
50
|
+
* Batches of the selected message groups of one bus model group: the ones
|
|
51
|
+
* decoded while planning as they are, the rest decoded in one pass (a batch
|
|
52
|
+
* per group per batch of records, in frame order).
|
|
53
|
+
*/
|
|
54
|
+
export declare function busBatches(io: BlobReader, model: FileModel, k: number, bus: BusPlan, wanted: {
|
|
55
|
+
group: number;
|
|
56
|
+
route: BusRoute;
|
|
57
|
+
sel: number[];
|
|
58
|
+
}[], signal?: AbortSignal): AsyncGenerator<Batch>;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** A channel conversion, normalised from MF4 CC and MDF3 CC blocks. */
|
|
2
|
+
export type Conv = {
|
|
3
|
+
k: 'id';
|
|
4
|
+
} | {
|
|
5
|
+
k: 'lin';
|
|
6
|
+
a: number;
|
|
7
|
+
b: number;
|
|
8
|
+
} | {
|
|
9
|
+
k: 'rat';
|
|
10
|
+
p: number[];
|
|
11
|
+
} | {
|
|
12
|
+
k: 'poly';
|
|
13
|
+
p: number[];
|
|
14
|
+
} | {
|
|
15
|
+
k: 'alg';
|
|
16
|
+
f: (x: number) => number;
|
|
17
|
+
} | {
|
|
18
|
+
k: 'tab';
|
|
19
|
+
keys: Float64Array;
|
|
20
|
+
vals: Float64Array;
|
|
21
|
+
interp: boolean;
|
|
22
|
+
} | {
|
|
23
|
+
k: 'rtv';
|
|
24
|
+
lo: Float64Array;
|
|
25
|
+
hi: Float64Array;
|
|
26
|
+
vals: Float64Array;
|
|
27
|
+
def: number;
|
|
28
|
+
} | TextConv | {
|
|
29
|
+
k: 'unsupported';
|
|
30
|
+
what: string;
|
|
31
|
+
};
|
|
32
|
+
/** Value→text (lo = hi) and range→text; a nested numeric conversion shows its number as text. */
|
|
33
|
+
export interface TextConv {
|
|
34
|
+
k: 'text';
|
|
35
|
+
ranges: {
|
|
36
|
+
lo: number;
|
|
37
|
+
hi: number;
|
|
38
|
+
to: string | Conv | null;
|
|
39
|
+
}[];
|
|
40
|
+
def: string | Conv | null;
|
|
41
|
+
/** Integer channels: ranges include their upper bound; floats: lo ≤ x < hi. */
|
|
42
|
+
int: boolean;
|
|
43
|
+
}
|
|
44
|
+
export declare const ID: Conv;
|
|
45
|
+
/** A numeric conversion in place. */
|
|
46
|
+
export declare function convertNumbers(c: Conv, v: Float64Array): void;
|
|
47
|
+
/** Value→text / range→text: one string per value (NaN gives null). */
|
|
48
|
+
export declare function convertText(c: TextConv, v: Float64Array): (string | null)[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ColumnValues } from '../types';
|
|
2
|
+
import type { ChannelModel } from './model';
|
|
3
|
+
/**
|
|
4
|
+
* One numeric channel of `n` records (`stride` bytes apart, the record data at
|
|
5
|
+
* `base`) into `out` from `at`. One loop per type, the type switch outside it;
|
|
6
|
+
* byte-aligned 8/16/32/64-bit fields read through the DataView directly.
|
|
7
|
+
*/
|
|
8
|
+
export declare function decodeNumeric(ch: ChannelModel, buf: Uint8Array, n: number, stride: number, base: number, out: Float64Array, at?: number): void;
|
|
9
|
+
export declare const decoderFor: (encoding: string) => TextDecoder;
|
|
10
|
+
/** Text up to the first NUL. */
|
|
11
|
+
export declare function trimNul(s: string): string;
|
|
12
|
+
/** A fixed-length string channel. */
|
|
13
|
+
export declare function decodeStrings(ch: ChannelModel, buf: Uint8Array, n: number, stride: number, base: number): (string | null)[];
|
|
14
|
+
/** Invalid samples (invalidation bit set, or the whole channel flagged invalid) become NaN / null. */
|
|
15
|
+
export declare function applyInvalid(ch: ChannelModel, buf: Uint8Array, n: number, stride: number, invalBase: number, out: ColumnValues): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Importer } from '../types';
|
|
2
|
+
import { type ChannelModel, type FileModel } from './model';
|
|
3
|
+
import { type BusPlan, type BusRoute } from './bus';
|
|
4
|
+
export interface MdfState {
|
|
5
|
+
model: FileModel;
|
|
6
|
+
/** Per plan group: its model group and either the model channels behind its plan channels, or its bus route. */
|
|
7
|
+
groups: ({
|
|
8
|
+
model: number;
|
|
9
|
+
channels: number[];
|
|
10
|
+
route?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
model: number;
|
|
13
|
+
channels?: undefined;
|
|
14
|
+
route: BusRoute;
|
|
15
|
+
})[];
|
|
16
|
+
bus: BusPlan | null;
|
|
17
|
+
}
|
|
18
|
+
export declare const isValueChannel: (c: ChannelModel) => boolean;
|
|
19
|
+
export declare const mdfImporter: Importer;
|