botbuilder
Version:
Bot Builder is a framework for building rich bots on virtually any platform.
126 lines • 4.83 kB
TypeScript
import { MicrosoftAppCredentials } from 'botframework-connector';
import { Activity, Middleware, TurnContext, BotState, UserState, ConversationState, Storage } from 'botbuilder-core';
/** @private */
declare abstract class InterceptionMiddleware implements Middleware {
/**
* Implement middleware signature
*
* @param turnContext {TurnContext} An incoming TurnContext object.
* @param next {function} The next delegate function.
*/
onTurn(turnContext: TurnContext, next: () => Promise<void>): Promise<void>;
protected abstract inbound(turnContext: TurnContext, traceActivity: Partial<Activity>): Promise<any>;
protected abstract outbound(turnContext: TurnContext, traceActivities: Partial<Activity>[]): Promise<any>;
protected abstract traceState(turnContext: TurnContext): Promise<any>;
private invokeInbound;
private invokeOutbound;
private invokeTraceState;
}
/**
* InspectionMiddleware for emulator inspection of runtime Activities and BotState.
*
* @remarks
* InspectionMiddleware for emulator inspection of runtime Activities and BotState.
* @deprecated This class will be removed in a future version of the framework.
*/
export declare class InspectionMiddleware extends InterceptionMiddleware {
private static readonly command;
private readonly inspectionState;
private readonly inspectionStateAccessor;
private readonly userState;
private readonly conversationState;
private readonly credentials;
/**
* Create the Inspection middleware for sending trace activities out to an emulator session
*
* @param inspectionState A state management object for inspection state.
* @param userState A state management object for user state.
* @param conversationState A state management object for conversation state.
* @param credentials The authentication credentials.
*/
constructor(inspectionState: InspectionState, userState?: UserState, conversationState?: ConversationState, credentials?: Partial<MicrosoftAppCredentials>);
/**
* Indentifies open and attach commands and calls the appropriate method.
*
* @param turnContext The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @returns True if the command is open or attached, otherwise false.
*/
processCommand(turnContext: TurnContext): Promise<any>;
/**
* Processes inbound activities.
*
* @param turnContext The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param traceActivity The trace activity.
* @returns {Promise<any>} A promise representing the asynchronous operation.
*/
protected inbound(turnContext: TurnContext, traceActivity: Partial<Activity>): Promise<any>;
/**
* Processes outbound activities.
*
* @param turnContext The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @param traceActivities A collection of trace activities.
*/
protected outbound(turnContext: TurnContext, traceActivities: Partial<Activity>[]): Promise<any>;
/**
* Processes the state management object.
*
* @param turnContext The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
*/
protected traceState(turnContext: TurnContext): Promise<any>;
/**
* @private
*/
private processOpenCommand;
/**
* @private
*/
private processAttachCommand;
/**
* @private
*/
private openCommand;
/**
* @private
*/
private attachCommand;
/**
* @private
*/
private findSession;
/**
* @private
*/
private invokeSend;
/**
* @private
*/
private cleanUpSession;
/**
* @private
*/
private getAttachId;
}
/**
* InspectionState for use by the InspectionMiddleware for emulator inspection of runtime Activities and BotState.
*
* @remarks
* InspectionState for use by the InspectionMiddleware for emulator inspection of runtime Activities and BotState.
* @deprecated This class will be removed in a future version of the framework.
*/
export declare class InspectionState extends BotState {
/**
* Creates a new instance of the [InspectionState](xref:botbuilder.InspectionState) class.
*
* @param storage The [Storage](xref:botbuilder-core.Storage) layer this state management object will use to store and retrieve state.
*/
constructor(storage: Storage);
/**
* Gets the key to use when reading and writing state to and from storage.
*
* @param _turnContext The [TurnContext](xref:botbuilder-core.TurnContext) for this turn.
* @returns The storage key.
*/
protected getStorageKey(_turnContext: TurnContext): string;
}
export {};
//# sourceMappingURL=inspectionMiddleware.d.ts.map