UNPKG

@riddance/host

Version:

7 lines (6 loc) 510 B
import { Context, HandlerConfiguration, type JsonObject } from './context.js'; export * from './context.js'; export type EventHandlerConfiguration = HandlerConfiguration & {}; export type Handler = (context: Context, subject: string, event: JsonObject | undefined, timestamp: Date, messageId: string) => Promise<void> | void; export declare function on(topic: string, event: string, fn: Handler): void; export declare function on(topic: string, event: string, config: HandlerConfiguration, fn: Handler): void;