UNPKG

2.38 kBTypeScriptView Raw
1import { EventFired } from "../HandleEvent";
2import { HandlerContext } from "../HandlerContext";
3import { HandlerResult } from "../HandlerResult";
4import { CommandInvocation } from "../internal/invoker/Payload";
5import { CommandIncoming, EventIncoming, RequestProcessor } from "../internal/transport/RequestProcessor";
6import { Destination, MessageOptions } from "../spi/message/MessageClient";
7export interface AutomationEventListener {
8 registrationSuccessful(handler: RequestProcessor): void;
9 contextCreated(context: HandlerContext): void;
10 commandIncoming(payload: CommandIncoming): void;
11 commandStarting(payload: CommandInvocation, ctx: HandlerContext): void;
12 commandSuccessful(payload: CommandInvocation, ctx: HandlerContext, result: HandlerResult): Promise<void>;
13 commandFailed(payload: CommandInvocation, ctx: HandlerContext, err: any): Promise<void>;
14 eventIncoming(payload: EventIncoming): void;
15 eventStarting(payload: EventFired<any>, ctx: HandlerContext): void;
16 eventSuccessful(payload: EventFired<any>, ctx: HandlerContext, result: HandlerResult[]): Promise<void>;
17 eventFailed(payload: EventFired<any>, ctx: HandlerContext, err: any): Promise<void>;
18 messageSent(message: any, destinations: Destination | Destination[], options: MessageOptions, ctx: HandlerContext): Promise<void>;
19}
20export declare class AutomationEventListenerSupport implements AutomationEventListener {
21 registrationSuccessful(handler: RequestProcessor): void;
22 contextCreated(context: HandlerContext): void;
23 commandIncoming(payload: CommandIncoming): void;
24 commandStarting(payload: CommandInvocation, ctx: HandlerContext): void;
25 commandSuccessful(payload: CommandInvocation, ctx: HandlerContext, result: HandlerResult): Promise<void>;
26 commandFailed(payload: CommandInvocation, ctx: HandlerContext, err: any): Promise<void>;
27 eventIncoming(payload: EventIncoming): void;
28 eventStarting(payload: EventFired<any>, ctx: HandlerContext): void;
29 eventSuccessful(payload: EventFired<any>, ctx: HandlerContext, result: HandlerResult[]): Promise<void>;
30 eventFailed(payload: EventFired<any>, ctx: HandlerContext, err: any): Promise<void>;
31 messageSent(message: any, destinations: Destination | Destination[], options: MessageOptions, ctx: HandlerContext): Promise<void>;
32}
33//# sourceMappingURL=AutomationEventListener.d.ts.map
\No newline at end of file