/** * Copyright(c) Microsoft Corporation.All rights reserved. * Licensed under the MIT License. */ import { BotTelemetryClient } from 'botbuilder-core'; import { InterruptableDialog } from './interruptableDialog'; import { DialogContext, DialogTurnResult } from 'botbuilder-dialogs'; import { InterruptionAction } from './interruptionAction'; /** * Provides interruption logic and methods for handling incoming activities based on type. */ export declare abstract class ActivityHandlerDialog extends InterruptableDialog { constructor(dialogId: string, telemetryClient: BotTelemetryClient); /** * Called when the dialog is started and pushed onto the parent's dialog stack. * @param innerDc The inner for the current turn of conversation * @param options Optional, initial information to pass to the dialog. * @returns A promise representing the asynchronous operation * @remarks If the task is successful, the result indicates whether the dialog is still * active after the turn has been processed by the dialog. The result may also contain a return value. */ protected onBeginDialog(innerDc: DialogContext, options: Object): Promise; /** * Called when the dialog is continued, where it is the active dialog and the user replies with a new activity. * @param innerDc The inner for the current turn of conversation * @returns A promise representing the asynchronous operation * @remarks If the task is successful, the result indicates whether the dialog is still * active after the turn has been processed by the dialog. The result may also contain a return value. * * By default, this calls OnInterruptDialog method then routes the activity to the waiting active dialog, * or to a handling method based on its activity type. */ protected onContinueDialog(innerDc: DialogContext): Promise; protected endComponent(outerDc: DialogContext, result: Object): Promise; /** * Called on every turn, enabling interruption scenarios. * @param innerDc The dialog context for the component. * @returns A promise returning an InterruptionAction which indicates what action should be taken after interruption. */ protected onInterruptDialog(innerDc: DialogContext): Promise; /** * Called when an event activity is received. * @param innerDc The dialog context for the component. * @returns A promise representing the asynchronous operation. */ protected onEventActivity(innerDc: DialogContext): Promise; /** * Called when a message activity is received. * @param innerDc The dialog context for the component. * @returns A promise representing the asynchronous operation. */ protected onMessageActivity(innerDc: DialogContext): Promise; /** * Called when a conversationUpdate activity is received. * @param innerDc The dialog context for the component. * @returns A promise representing the asynchronous operation. */ protected onMembersAdded(innerDc: DialogContext): Promise; /** * Called when an activity type other than event, message, or conversationUpdate is received. * @param innerDc The dialog context for the component. * @returns A promise representing the asynchronous operation. */ protected onUnhandledActivityType(innerDc: DialogContext): Promise; /** * Called when the inner dialog stack completes. * @param innerDc The dialog context for the component. * @param result The dialog turn result for the component. * @returns A promise representing the asynchronous operation. */ protected onDialogComplete(outerDc: DialogContext, result: object): Promise; }