@foxglove/extension 2.25.1 → 2.27.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.
- package/package.json +1 -1
- package/src/experimental.ts +88 -0
- package/src/stable.ts +12 -0
package/package.json
CHANGED
package/src/experimental.ts
CHANGED
|
@@ -7,6 +7,48 @@ import {
|
|
|
7
7
|
MessageEvent,
|
|
8
8
|
} from "./stable";
|
|
9
9
|
|
|
10
|
+
export type MessageSchemaField = "string" | "number" | "bool" | "byte";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Describes the structure of a message with field names and their types.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* {
|
|
18
|
+
* // Primitive fields
|
|
19
|
+
* position: "number",
|
|
20
|
+
* name: "string",
|
|
21
|
+
* active: "bool",
|
|
22
|
+
* singleByte: "byte",
|
|
23
|
+
*
|
|
24
|
+
* // Arrays of primitive types
|
|
25
|
+
* coordinates: ["number"],
|
|
26
|
+
* labels: ["string"],
|
|
27
|
+
* flags: ["bool"],
|
|
28
|
+
* rawData: ["byte"],
|
|
29
|
+
*
|
|
30
|
+
* // Nested objects
|
|
31
|
+
* metadata: {
|
|
32
|
+
* timestamp: "number",
|
|
33
|
+
* source: "string"
|
|
34
|
+
* },
|
|
35
|
+
*
|
|
36
|
+
* // Arrays of objects
|
|
37
|
+
* points: [{
|
|
38
|
+
* x: "number",
|
|
39
|
+
* y: "number",
|
|
40
|
+
* z: "number"
|
|
41
|
+
* }]
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export type MessageSchemaDescription = {
|
|
46
|
+
[key: string]:
|
|
47
|
+
| MessageSchemaField
|
|
48
|
+
| MessageSchemaDescription
|
|
49
|
+
| [MessageSchemaField | MessageSchemaDescription];
|
|
50
|
+
};
|
|
51
|
+
|
|
10
52
|
/**
|
|
11
53
|
* The experimental namespace contains experimental APIs that are not yet stable and WILL change or
|
|
12
54
|
* be REMOVED at any time.
|
|
@@ -31,6 +73,52 @@ export namespace Experimental {
|
|
|
31
73
|
inputTopics: string[];
|
|
32
74
|
outputTopic: string;
|
|
33
75
|
schemaName: string;
|
|
76
|
+
/**
|
|
77
|
+
* Describes the structure of the output messages produced by this converter.
|
|
78
|
+
*
|
|
79
|
+
* This optional field allows Foxglove to understand the structure of your messages, enabling
|
|
80
|
+
* features like autocompletion for message path selection.
|
|
81
|
+
*
|
|
82
|
+
* The schema can include:
|
|
83
|
+
* - Primitive types: "string", "number", "bool", "byte"
|
|
84
|
+
* - Arrays of primitives: ["string"], ["number"], ["bool"], ["byte"]
|
|
85
|
+
* - Nested objects with their own field definitions
|
|
86
|
+
* - Arrays of objects (each element having the same structure)
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```
|
|
90
|
+
* schemaDescription: {
|
|
91
|
+
* // Simple fields
|
|
92
|
+
* timestamp: "number",
|
|
93
|
+
* label: "string",
|
|
94
|
+
* enabled: "bool",
|
|
95
|
+
* flags: "byte",
|
|
96
|
+
*
|
|
97
|
+
* // Array of primitives
|
|
98
|
+
* values: ["number"],
|
|
99
|
+
* names: ["string"],
|
|
100
|
+
* options: ["bool"],
|
|
101
|
+
* data: ["byte"],
|
|
102
|
+
*
|
|
103
|
+
* // Nested object
|
|
104
|
+
* position: {
|
|
105
|
+
* x: "number",
|
|
106
|
+
* y: "number",
|
|
107
|
+
* z: "number"
|
|
108
|
+
* },
|
|
109
|
+
*
|
|
110
|
+
* // Array of objects
|
|
111
|
+
* landmarks: [{
|
|
112
|
+
* id: "string",
|
|
113
|
+
* position: {
|
|
114
|
+
* x: "number",
|
|
115
|
+
* y: "number"
|
|
116
|
+
* }
|
|
117
|
+
* }]
|
|
118
|
+
* }
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
schemaDescription?: MessageSchemaDescription;
|
|
34
122
|
create: () => TopicConverterReturnType;
|
|
35
123
|
};
|
|
36
124
|
|
package/src/stable.ts
CHANGED
|
@@ -1209,6 +1209,12 @@ export type SettingsTreeField = SettingsTreeFieldValue & {
|
|
|
1209
1209
|
* Optional message indicating any error state for the field.
|
|
1210
1210
|
*/
|
|
1211
1211
|
error?: string;
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Optional message indicating any warning state for the field.
|
|
1215
|
+
* This message is not displayed when an error message is present.
|
|
1216
|
+
*/
|
|
1217
|
+
warning?: string;
|
|
1212
1218
|
};
|
|
1213
1219
|
|
|
1214
1220
|
/**
|
|
@@ -1290,6 +1296,12 @@ export type SettingsTreeNode = {
|
|
|
1290
1296
|
*/
|
|
1291
1297
|
error?: string;
|
|
1292
1298
|
|
|
1299
|
+
/**
|
|
1300
|
+
* Optional message indicating any warning state for the node.
|
|
1301
|
+
* This message is not displayed when an error message is present.
|
|
1302
|
+
*/
|
|
1303
|
+
warning?: string;
|
|
1304
|
+
|
|
1293
1305
|
/**
|
|
1294
1306
|
* Field inputs attached directly to this node.
|
|
1295
1307
|
*/
|