@foxglove/extension 2.53.1 → 2.54.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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/experimental.ts +19 -37
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foxglove/extension",
3
- "version": "2.53.1",
3
+ "version": "2.54.0",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Foxglove Technologies",
@@ -20,35 +20,29 @@ import type {
20
20
  * @hidden
21
21
  */
22
22
  export namespace Experimental {
23
- export type DataSourceId = string & { __brand: "DataSourceId" };
23
+ export type ComparisonSlot = string & { __brand: "ComparisonSlot" };
24
24
 
25
- /**
26
- * Requested start position for a source on the compare timeline.
27
- * Manual values are in compare-time seconds and must be non-negative.
28
- */
29
- export type RequestedDataSourceTimeOffset = { mode: "auto" } | { mode: "manual"; offset: Time };
30
-
31
- export type DataSourceInfo = {
32
- /** ID of the data source (e.g. "A", "B", "C", ...) used to identify the data source. */
33
- id: DataSourceId;
34
- /** The name of the data source e.g. the name of the file or URL. */
25
+ export type ComparisonSource = {
26
+ /** The slot assigned to the comparison source (e.g. "A", "B", "C", ...). */
27
+ slot: ComparisonSlot;
28
+ /** The name of the comparison source e.g. the name of the file or URL. */
35
29
  name: string;
36
- /** User-requested compare-time start configuration. */
37
- requestedTimeOffset: RequestedDataSourceTimeOffset;
30
+ /** User-requested compare-time start, or undefined to align source start with t=0. */
31
+ requestedTimeOffset?: Time;
38
32
  /** Effective time offset applied to source timestamps. */
39
33
  timeOffset: Time;
40
34
  };
41
35
 
42
- export type DataSourceMap = ReadonlyMap<DataSourceId, Immutable<DataSourceInfo>>;
36
+ export type ComparisonSources = ReadonlyMap<ComparisonSlot, Immutable<ComparisonSource>>;
43
37
 
44
38
  export type MessageEvent<T = unknown> = BaseMessageEvent<T> & {
45
- /** The data source that the message stems from. */
46
- dataSourceId?: DataSourceId;
39
+ /** The comparison slot that the message stems from. Only set in compare mode.*/
40
+ comparisonSlot?: ComparisonSlot;
47
41
  };
48
42
 
49
43
  export type Subscription = BaseSubscription & {
50
- /** The data source that the subscription stems from. */
51
- dataSourceId?: DataSourceId;
44
+ /** The comparison source that the subscription stems from. Only set in compare mode.*/
45
+ comparisonSlot?: ComparisonSlot;
52
46
  };
53
47
 
54
48
  /**
@@ -308,12 +302,8 @@ export namespace Experimental {
308
302
  export type MetadataRecord = {
309
303
  name: string;
310
304
  metadata: Record<string, string>;
311
- /**
312
- * Which source this came from in multiplexed playback; `undefined` for single-source.
313
- * In merge mode all records share the same `dataSourceId` (the default source's id) —
314
- * use `dataSources` to detect compare mode.
315
- */
316
- dataSourceId?: DataSourceId;
305
+ /** The comparison source that the record stems from. Only set in compare mode.*/
306
+ comparisonSlot?: ComparisonSlot;
317
307
  };
318
308
 
319
309
  /**
@@ -329,29 +319,21 @@ export namespace Experimental {
329
319
  logTime: Time;
330
320
  createTime: Time;
331
321
  sizeBytes: number;
332
- /**
333
- * Which source this came from in multiplexed playback; `undefined` for single-source.
334
- * In merge mode all attachments share the same `dataSourceId` (the default source's id),
335
- * distinct from the attachment's own `id` above — use `dataSources` to detect compare mode.
336
- */
337
- dataSourceId?: DataSourceId;
322
+ /** The comparison source that the attachment stems from. Only set in compare mode.*/
323
+ comparisonSlot?: ComparisonSlot;
338
324
  };
339
325
 
340
326
  export type RenderState = BaseRenderState & {
341
327
  /**
342
- * Map of available individual data sources, keyed by their ID.
328
+ * Map of compare data sources. Only present when multiple data sources are loaded in compare mode.
343
329
  */
344
- dataSources?: DataSourceMap;
330
+ comparisonSources?: ComparisonSources;
345
331
 
346
- /**
347
- * MCAP metadata records from all active sources. In compare mode use `dataSourceId`
348
- * to distinguish per-source records.
349
- */
332
+ /** MCAP metadata records from all active sources. */
350
333
  metadata?: MetadataRecord[];
351
334
 
352
335
  /**
353
336
  * MCAP attachment references from all active sources (name/size/timing only, no bytes).
354
- * In compare mode use `dataSourceId` to distinguish per-source entries.
355
337
  * Call `context.fetchAttachment(id)` to load bytes.
356
338
  */
357
339
  attachments?: AttachmentInfo[];