Socket
Socket
Sign inDemoInstall

@foxglove/message-definition

Package Overview
Dependencies
0
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @foxglove/message-definition

Defines common types for message definition schemas (ROS .msg, Protobuf, FlatBuffers, IDL, PX4 ULog, JSON Schema, etc)


Version published
Weekly downloads
2.2K
decreased by-31.42%
Maintainers
2
Install size
28.8 kB
Created
Weekly downloads
 

Readme

Source

@foxglove/message-definition

Defines common TypeScript types for message definition schemas (ROS .msg, Protobuf, FlatBuffers, IDL, PX4 ULog, JSON Schema, etc).

Why is this useful?

Several interface definition languages exist today for describing the structure of messages. These languages are often used to generate code for serialization and deserialization of messages. This package defines a common representation in TypeScript for interface definitions, sometimes referred to as message definitions, so they can be reasoned about in a generic way. A concrete example of this is in Foxglove Studio, which supports many different message serializations but provides common functionality across all of them such as Message Path Syntax and structured message display.

Examples

Here is a an example of a ROS 2 message definition (.msg file) and its corresponding TypeScript representation:

UserAccount.msg:

string username
Account account
============
MSG: custom_type/Account
string name
uint16 id

UserAccount.ts:

[
  {
    definitions: [
      { type: "string", name: "username" },
      { type: "custom_type/Account", name: "account", isComplex: true },
    ],
  },
  {
    name: "custom_type/Account",
    definitions: [
      { type: "string", name: "name" },
      { type: "uint16", name: "id" },
    ],
  },
];

Note that this package only provides type definitions, not any functionality for parsing or generating message definitions. For that, see foxglove/rosmsg or other packages that depend on this one.

License

@foxglove/message-definition is licensed under MIT License.

Releasing

  1. Run yarn version --[major|minor|patch] to bump version
  2. Run git push && git push --tags to push new tag
  3. GitHub Actions will take care of the rest

Stay in touch

Join our Slack channel to ask questions, share feedback, and stay up to date on what our team is working on.

Keywords

FAQs

Last updated on 10 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc