@foxglove/embed 0.2.0 → 0.2.3

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/src/types.ts CHANGED
@@ -1,3 +1,7 @@
1
+ import type { Layout } from "./layout.generated";
2
+
3
+ export * from "./layout.generated";
4
+
1
5
  /**
2
6
  * An opaque JSON object representing a Foxglove layout. The layout data should be a JSON file that
3
7
  * was exported from the Foxglove app.
@@ -62,18 +66,33 @@ export type FoxgloveViewerEventMap = {
62
66
 
63
67
  export type FoxgloveViewerEventType = keyof FoxgloveViewerEventMap;
64
68
 
65
- export type SelectLayoutParams = {
66
- /**
67
- * The storage key to identify the layout in local storage. When reusing the same storage key,
68
- * any modifications made by the user will be restored unless `force` is true.
69
- * */
70
- storageKey: string;
71
- /**
72
- * The layout data to load if this layout did not already exist, or if `force` is true.
73
- * This is an opaque JavaScript object, which should be parsed from a JSON layout file
74
- * that was exported from the Foxglove app. If not provided, the default layout will be used.
75
- * */
76
- opaqueLayout?: OpaqueLayoutData;
77
- /** If true, opaqueLayout will override the layout if it already exists. Default: false */
78
- force?: boolean;
79
- };
69
+ export type SelectLayoutParams =
70
+ | {
71
+ /**
72
+ * The storage key to identify the layout in local storage. When reusing the same storage key,
73
+ * any modifications made by the user will be restored unless `force` is true.
74
+ * */
75
+ storageKey: string;
76
+ /**
77
+ * The layout data to load if this layout did not already exist, or if `force` is true.
78
+ * This is an opaque JavaScript object, which should be parsed from a JSON layout file
79
+ * that was exported from the Foxglove app. If not provided, the default layout will be used.
80
+ * */
81
+ opaqueLayout?: OpaqueLayoutData;
82
+ /** If true, `opaqueLayout` will override the layout if it already exists. Default: false */
83
+ force?: boolean;
84
+ }
85
+ | {
86
+ /**
87
+ * The storage key to identify the layout in local storage. When reusing the same storage key,
88
+ * any modifications made by the user will be restored unless `force` is true.
89
+ * */
90
+ storageKey: string;
91
+ /**
92
+ * The layout data to load if this layout did not already exist, or if `force` is true.
93
+ * This is a JSON object matching the format defined in @foxglove/layout-api.
94
+ * */
95
+ layout?: Layout;
96
+ /** If true, `layout` will override the layout if it already exists. Default: false */
97
+ force?: boolean;
98
+ };