Skip to content

API reference / @node-ts/bus-messages / MessageTypes

Interface: MessageTypes ​

Defined in: packages/bus-messages/src/message-types.ts:46

The runtime types of messages and workflow state, generated from their TypeScript source by bus generate-message-types in @node-ts/bus-cli. Pass the generated file's messageTypes to Bus.configure().withMessageTypes(), so the bus restores Dates, Maps, Sets, BigInts and class instances at any depth of the messages and workflow state it receives.

Properties ​

PropertyTypeDescriptionDefined in
messagesobjectMaps the $name of each message and workflow state to the key of its entry in typespackages/bus-messages/src/message-types.ts:56
source?stringIdentifies the generated file, e.g. @my-org/messages/src/message-types.generated, so an error about two message types that conflict can say where each comes frompackages/bus-messages/src/message-types.ts:51
typesobjectHow to restore each class or object type, by keypackages/bus-messages/src/message-types.ts:61

Released under the MIT License.