---
url: >-
  https://node-ts.github.io/bus/api/bus-messages/interfaces/MessageTypeDefinition.md
---
[API reference](../../index.md) / [@node-ts/bus-messages](../index.md) / MessageTypeDefinition

# Interface: MessageTypeDefinition

Defined in: [packages/bus-messages/src/message-types.ts:26](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-messages/src/message-types.ts#L26)

How to restore one class or object type

## Properties

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| <a id="property-class"></a> `class?` | (...`args`) => `object` | The class restored objects are created from. They get its prototype, so `instanceof`, getters and methods work, but its constructor isn't run. Object types such as interfaces have no class and are restored as plain objects. | [packages/bus-messages/src/message-types.ts:32](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-messages/src/message-types.ts#L32) |
| <a id="property-fields"></a> `fields` | `object` | The fields that need restoring, by name. Fields that aren't listed are kept as they were parsed. | [packages/bus-messages/src/message-types.ts:37](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-messages/src/message-types.ts#L37) |
