UNPKG

2.83 kBTypeScriptView Raw
1/**
2 * @module botbuilder
3 */
4/**
5 * Copyright (c) Microsoft Corporation. All rights reserved.
6 * Licensed under the MIT License.
7 */
8import { MicrosoftAppCredentials } from 'botframework-connector';
9import { Activity, Middleware, TurnContext, BotState, UserState, ConversationState, Storage } from 'botbuilder-core';
10/** @private */
11declare abstract class InterceptionMiddleware implements Middleware {
12 /** Implement middleware signature
13 * @param context {TurnContext} An incoming TurnContext object.
14 * @param next {function} The next delegate function.
15 */
16 onTurn(turnContext: TurnContext, next: () => Promise<void>): Promise<void>;
17 protected abstract inbound(turnContext: TurnContext, traceActivity: Partial<Activity>): Promise<any>;
18 protected abstract outbound(turnContext: TurnContext, traceActivities: Partial<Activity>[]): Promise<any>;
19 protected abstract traceState(turnContext: TurnContext): Promise<any>;
20 private invokeInbound;
21 private invokeOutbound;
22 private invokeTraceState;
23}
24/**
25 * InspectionMiddleware for emulator inspection of runtime Activities and BotState.
26 *
27 * @remarks
28 * InspectionMiddleware for emulator inspection of runtime Activities and BotState.
29 *
30 */
31export declare class InspectionMiddleware extends InterceptionMiddleware {
32 private static readonly command;
33 private readonly inspectionState;
34 private readonly inspectionStateAccessor;
35 private readonly userState;
36 private readonly conversationState;
37 private readonly credentials;
38 /**
39 * Create the Inspection middleware for sending trace activities out to an emulator session
40 */
41 constructor(inspectionState: InspectionState, userState?: UserState, conversationState?: ConversationState, credentials?: Partial<MicrosoftAppCredentials>);
42 processCommand(turnContext: TurnContext): Promise<any>;
43 protected inbound(turnContext: TurnContext, traceActivity: Partial<Activity>): Promise<any>;
44 protected outbound(turnContext: TurnContext, traceActivities: Partial<Activity>[]): Promise<any>;
45 protected traceState(turnContext: TurnContext): Promise<any>;
46 private processOpenCommand;
47 private processAttachCommand;
48 private openCommand;
49 private attachCommand;
50 private findSession;
51 private invokeSend;
52 private cleanUpSession;
53 private getAttachId;
54}
55/**
56 * InspectionState for use by the InspectionMiddleware for emulator inspection of runtime Activities and BotState.
57 *
58 * @remarks
59 * InspectionState for use by the InspectionMiddleware for emulator inspection of runtime Activities and BotState.
60 *
61 */
62export declare class InspectionState extends BotState {
63 constructor(storage: Storage);
64 protected getStorageKey(turnContext: TurnContext): string;
65}
66export {};
67//# sourceMappingURL=inspectionMiddleware.d.ts.map
\No newline at end of file