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
| Property | Type | Description | Defined in |
|---|---|---|---|
messages | object | Maps the $name of each message and workflow state to the key of its entry in types | packages/bus-messages/src/message-types.ts:56 |
source? | string | Identifies 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 from | packages/bus-messages/src/message-types.ts:51 |
types | object | How to restore each class or object type, by key | packages/bus-messages/src/message-types.ts:61 |