UNPKG

1.98 kBTypeScriptView Raw
1import { Configuration } from "./configuration";
2import { HandleCommand } from "./HandleCommand";
3import { HandleEvent } from "./HandleEvent";
4import { HandlerResult } from "./HandlerResult";
5import { ExpressServer } from "./internal/transport/express/ExpressServer";
6import { CommandIncoming, EventIncoming, RequestProcessor } from "./internal/transport/RequestProcessor";
7import { WebSocketClient } from "./internal/transport/websocket/WebSocketClient";
8import { AutomationServer } from "./server/AutomationServer";
9import { BuildableAutomationServer } from "./server/BuildableAutomationServer";
10import { Maker } from "./util/constructionUtils";
11export declare class AutomationClient implements RequestProcessor {
12 configuration: Configuration;
13 automations: BuildableAutomationServer;
14 webSocketClient: WebSocketClient;
15 httpServer: ExpressServer;
16 webSocketHandler: RequestProcessor;
17 httpHandler: RequestProcessor;
18 private defaultListeners;
19 constructor(configuration: Configuration);
20 readonly automationServer: AutomationServer;
21 withCommandHandler(chm: Maker<HandleCommand>): AutomationClient;
22 withEventHandler(event: Maker<HandleEvent<any>>): AutomationClient;
23 withIngester(ingester: string): AutomationClient;
24 processCommand(command: CommandIncoming, callback?: (result: Promise<HandlerResult>) => void): any;
25 processEvent(event: EventIncoming, callback?: (results: Promise<HandlerResult[]>) => void): any;
26 run(): Promise<void>;
27 private raiseStartupEvent;
28 private configureStatsd;
29 private configureLogging;
30 private setupWebSocketClusterRequestHandler;
31 private setupWebSocketClusterWorkerRequestHandler;
32 private setupWebSocketRequestHandler;
33 private setupApplicationEvents;
34 private setupExpressRequestHandler;
35 private runWs;
36 private runHttp;
37}
38export declare function automationClient(configuration: Configuration): AutomationClient;
39//# sourceMappingURL=automationClient.d.ts.map
\No newline at end of file