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

# Interface: HandlerFor\<TMessageType, THandler>

Defined in: [packages/bus-core/src/handler/handler-for.ts:67](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-core/src/handler/handler-for.ts#L67)

A message type and the handler declared for it with `handlerFor`, ready to pass to `withHandler`

## Type Parameters

| Type Parameter |
| ------ |
| `TMessageType` *extends* [`Message`](../../bus-messages/classes/Message.md) |
| `THandler` |

## Properties

| Property | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| <a id="property-messagehandler"></a> `messageHandler` | `THandler` | The handler, typed as it was given | [packages/bus-core/src/handler/handler-for.ts:75](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-core/src/handler/handler-for.ts#L75) |
| <a id="property-messagetype"></a> `messageType` | [`MessageDeclaration`](../../bus-messages/type-aliases/MessageDeclaration.md)<`TMessageType`> | The message class or definition the handler handles | [packages/bus-core/src/handler/handler-for.ts:71](https://github.com/node-ts/bus/blob/2e6cf65c27833b707ae31ee623cfb6343770f434/packages/bus-core/src/handler/handler-for.ts#L71) |
