/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { DialogContext } from './dialogContext'; import { DialogReason } from './dialogReason'; import { DialogTurnResult } from './dialogTurnResult'; /** * Values passed to the `WaterfallStepContext` constructor. */ export interface WaterfallStepInfo { /** * The index of the current step in the waterfall dialog. */ index: number; /** * The options passed to the waterfall dialog when it was started. */ options: O; /** * The reason the current step is being executed. */ reason: DialogReason; /** * The result returned by the previous step or dialog. */ result: any; /** * A dictionary of values shared across all steps in the waterfall dialog. */ values: object; /** * A function to proceed to the next step in the waterfall dialog. * * @param result Optional result to pass to the next step. * @returns A promise resolving to the result of the next dialog turn. */ onNext(result?: any): Promise; } /** * Context object passed in to a `WaterfallStep`. * * @param O (Optional) type of options passed to the steps waterfall dialog in the call to `DialogContext.beginDialog()`. */ export declare class WaterfallStepContext extends DialogContext { private _stepInfo; /** * Creates a new WaterfallStepContext instance. * * @param dialogContext The dialog context for the current turn of conversation. * @param stepInfo Values to initialize the step context with. */ constructor(dialogContext: DialogContext, stepInfo: WaterfallStepInfo); /** * The index of the current waterfall step being executed. * * @returns The index of the current waterfall step being executed. */ get index(): number; /** * Any options passed to the steps waterfall dialog when it was started with * `DialogContext.beginDialog()`. * * @returns Any options the waterfall dialog was called with. */ get options(): O; /** * The reason the waterfall step is being executed. * * @returns The reason the waterfall step is being executed. */ get reason(): DialogReason; /** * Results returned by a dialog or prompt that was called in the previous waterfall step. * * @returns The result from the previous waterfall step. */ get result(): any; /** * A dictionary of values which will be persisted across all waterfall steps. * * @returns A dictionary of values which will be persisted across all waterfall steps. */ get values(): object; /** * Skips to the next waterfall step. * * @param result (Optional) result to pass to the next step. * @returns A promise with the DialogTurnResult. */ next(result?: any): Promise; }