Function: defineEventHandler()
Function: defineEventHandler()
Utility function to define an event handler.
Param
The EventHandler module.
Param
The options for the EventHandler.
Call Signature
function defineEventHandler<U, V>(module): Partial<StoneBlueprint<U>>;
Utility function to define a function-based event handler.
Type Parameters
U
U
extends IncomingEvent
= IncomingEvent
V
V
= OutgoingResponse
Parameters
module
FunctionalEventHandler
<U
, V
>
The EventHandler module.
Returns
Partial
<StoneBlueprint
<U
>>
The StoneBlueprint.
Param
The EventHandler module.
Param
The options for the EventHandler.
Call Signature
function defineEventHandler<U, V>(module, options): Partial<StoneBlueprint<U>>;
Utility function to define a factory-based event handler.
Type Parameters
U
U
extends IncomingEvent
= IncomingEvent
V
V
= OutgoingResponse
Parameters
module
FactoryEventHandler
<U
, V
>
The EventHandler module.
options
The options for the EventHandler.
isFactory
true
Returns
Partial
<StoneBlueprint
<U
>>
The StoneBlueprint.
Param
The EventHandler module.
Param
The options for the EventHandler.
Call Signature
function defineEventHandler<U, V>(module, options): Partial<StoneBlueprint<U>>;
Utility function to define a factory-based event handler.
Type Parameters
U
U
extends IncomingEvent
= IncomingEvent
V
V
= OutgoingResponse
Parameters
module
EventHandlerClass
<U
, V
>
The EventHandler module.
options
The options for the EventHandler.
isClass
true
Returns
Partial
<StoneBlueprint
<U
>>
The StoneBlueprint.
Param
The EventHandler module.
Param
The options for the EventHandler.