Skip to main content

@elizaos/core v1.0.0-beta.51 / TypedEventHandler

Type Alias: TypedEventHandler()

TypedEventHandler: (data) => Promise<void> | void

Defines a more specific type for event handlers, expecting an EventDataObject. This aims to improve upon generic 'any' type handlers, providing a clearer contract for functions that respond to events emitted within the agent runtime (see emitEvent in AgentRuntime). Handlers can be synchronous or asynchronous.

Parameters​

• data: EventDataObject

Returns​

Promise<void> | void

Defined in​

packages/core/src/types.ts:2274