@foxglove/extension 2.29.0 → 2.30.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 +1 -1
- package/src/stable.ts +45 -4
package/package.json
CHANGED
package/src/experimental.ts
CHANGED
|
@@ -25,7 +25,7 @@ export namespace Experimental {
|
|
|
25
25
|
/** The URL to the WebAssembly module for this data loader. */
|
|
26
26
|
wasmUrl: string;
|
|
27
27
|
/** The file extension that this data loader should be associated with. */
|
|
28
|
-
supportedFileType:
|
|
28
|
+
supportedFileType: `.${string}`;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/**
|
package/src/stable.ts
CHANGED
|
@@ -932,7 +932,21 @@ export type RegisterMessageConverterArgsTopic = {
|
|
|
932
932
|
type: "topic";
|
|
933
933
|
inputTopics: string[];
|
|
934
934
|
outputTopic: string;
|
|
935
|
-
|
|
935
|
+
|
|
936
|
+
/** Name of the schema for messages output by the converter.
|
|
937
|
+
*
|
|
938
|
+
* If you output well-known messages like a foxglove CompressedImage then your schema name would
|
|
939
|
+
* be `foxglove.CompressedImage`.
|
|
940
|
+
*
|
|
941
|
+
* If you are creating a new custom schema you can assign any name. Avoid picking an existing name
|
|
942
|
+
* if your data uses a different schema.
|
|
943
|
+
*
|
|
944
|
+
* NOTE: For ROS users, we also support names like `sensor_msgs/msg/CompressedImage`. See the
|
|
945
|
+
* supported messages documentation for each panel to learn what kinds of schemas it can display.
|
|
946
|
+
*
|
|
947
|
+
*/
|
|
948
|
+
outputSchemaName: string;
|
|
949
|
+
|
|
936
950
|
/**
|
|
937
951
|
* Describes the structure of the output messages produced by this converter.
|
|
938
952
|
*
|
|
@@ -978,11 +992,38 @@ export type RegisterMessageConverterArgsTopic = {
|
|
|
978
992
|
* }
|
|
979
993
|
* ```
|
|
980
994
|
*/
|
|
995
|
+
outputSchemaDescription?: MessageSchemaDescription;
|
|
996
|
+
|
|
997
|
+
/** @deprecated use `outputSchemaName` instead */
|
|
998
|
+
schemaName?: string;
|
|
999
|
+
|
|
1000
|
+
/** @deprecated use `outputSchemaDescription` instead */
|
|
981
1001
|
schemaDescription?: MessageSchemaDescription;
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
*
|
|
1005
|
+
* The create function initializes the converter. It is called by the app to create the converter
|
|
1006
|
+
* when some panel subscribes to the output topic.
|
|
1007
|
+
*
|
|
1008
|
+
* ```
|
|
1009
|
+
* create: () => {
|
|
1010
|
+
* return (msgEvent: MessageEvent) => {
|
|
1011
|
+
* const msg = msgEvent.message as MySignal;
|
|
1012
|
+
* return { value: Math.abs(msg.acceleration) };
|
|
1013
|
+
* };
|
|
1014
|
+
* },
|
|
1015
|
+
* ```
|
|
1016
|
+
*
|
|
1017
|
+
* @returns A function that is called with a MessageEvent for every input message. It performs any
|
|
1018
|
+
* computation and returns a new message(s) matching the schema description. The function can
|
|
1019
|
+
* optionally return undefined to skip producing message(s) for the given input.
|
|
1020
|
+
*/
|
|
982
1021
|
create: () => TopicConverterReturnType;
|
|
983
1022
|
};
|
|
984
1023
|
|
|
985
|
-
type TopicConverterReturnType = (
|
|
1024
|
+
type TopicConverterReturnType = (
|
|
1025
|
+
messageEvent: Immutable<MessageEvent>,
|
|
1026
|
+
) => undefined | Record<string, unknown> | Record<string, unknown>[];
|
|
986
1027
|
|
|
987
1028
|
/**
|
|
988
1029
|
* This type represents the arguments you pass to
|
|
@@ -996,8 +1037,8 @@ type TopicConverterReturnType = (messageEvent: Immutable<MessageEvent>) => unkno
|
|
|
996
1037
|
* messages for visualization in the [Map
|
|
997
1038
|
* panel](https://docs.foxglove.dev/docs/visualization/panels/map).
|
|
998
1039
|
*
|
|
999
|
-
* See the [Creating a
|
|
1000
|
-
* converter](https://docs.foxglove.dev/docs/visualization/extensions/guides/create-
|
|
1040
|
+
* See the [Creating a topic
|
|
1041
|
+
* converter](https://docs.foxglove.dev/docs/visualization/extensions/guides/create-topic-converter)
|
|
1001
1042
|
* guide for more details.
|
|
1002
1043
|
*
|
|
1003
1044
|
* @category Message converters
|