/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { TurnContext } from '@microsoft/agents-hosting'; import { Dialog } from '../dialog'; import { DialogContext } from '../dialogContext'; import { PromptOptions, PromptRecognizerResult, PromptValidator } from './prompt'; import { DialogInstance } from '../dialogInstance'; import { DialogReason } from '../dialogReason'; import { DialogTurnResult } from '../dialogTurnResult'; import { Activity } from '@microsoft/agents-activity'; /** * Waits for an activity to be received. * * @remarks * This prompt requires a validator be passed in and is useful when waiting for non-message * activities like an event to be received. The validator can ignore received events until the * expected activity is received. */ export declare class ActivityPrompt extends Dialog { private validator; /** * Creates a new ActivityPrompt instance. * * @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`. * @param validator Validator that will be called each time a new activity is received. */ constructor(dialogId: string, validator: PromptValidator); /** * Called when a prompt dialog is pushed onto the dialog stack and is being activated. * * @param dialogContext The DialogContext for the current * turn of the conversation. * @param options PromptOptions, additional * information to pass to the prompt being started. * @returns A `Promise` representing the asynchronous operation. * * @remarks * If the promise is successful, the result indicates whether the prompt is still * active after the turn has been processed by the prompt. * */ beginDialog(dialogContext: DialogContext, options: PromptOptions): Promise; /** * Called when a prompt dialog is the active dialog and the user replied with a new activity. * * @param dialogContext The DialogContext for the current * turn of conversation. * @returns A `Promise` representing the asynchronous operation. * * @remarks * If the promise is successful, the result indicates whether the dialog is still * active after the turn has been processed by the dialog. * The prompt generally continues to receive the user's replies until it accepts the * user's reply as valid input for the prompt. * */ continueDialog(dialogContext: DialogContext): Promise; /** * Called when a prompt dialog resumes being the active dialog on the dialog stack, such as * when the previous active dialog on the stack completes. * * @param dialogContext The DialogContext for the current turn * of the conversation. * @param _reason DialogReason, an enum indicating why * the dialog resumed. * @param _result Optional. Value returned from the previous dialog on the stack. * The type of the value returned is dependent on the previous dialog. * @returns A `Promise` representing the asynchronous operation. */ resumeDialog(dialogContext: DialogContext, _reason: DialogReason, _result?: any): Promise; /** * Called when a prompt dialog has been requested to re-prompt the user for input. * * @param context TurnContext, context for the current * turn of conversation with the user. * @param instance DialogInstance, the instance * of the dialog on the stack. * @returns A `Promise` representing the asynchronous operation. */ repromptDialog(context: TurnContext, instance: DialogInstance): Promise; /** * When overridden in a derived class, prompts the user for input. * * @param context TurnContext, context for the current * turn of conversation with the user. * @param state Contains state for the current instance of the prompt on the dialog stack. * @param options A PromptOptions object constructed * from the options initially provided in the call to Prompt. * @param isRetry A boolean representing if the prompt is a retry. * @returns A `Promise` representing the asynchronous operation. */ protected onPrompt(context: TurnContext, state: object, options: PromptOptions, isRetry: boolean): Promise; /** * When overridden in a derived class, attempts to recognize the incoming Activity. * * @param context TurnContext, context for the current * turn of conversation with the user. * @param _state Contains state for the current instance of the prompt on the dialog stack. * @param _options A PromptOptions object constructed * from the options initially provided in the call to Prompt. * @returns A `Promise` representing the asynchronous operation. */ protected onRecognize(context: TurnContext, _state: object, _options: PromptOptions): Promise>; }