UNPKG

1.57 kBTypeScriptView Raw
1/**
2 * @module botkit
3 */
4/**
5 * Copyright (c) Microsoft Corporation. All rights reserved.
6 * Licensed under the MIT License.
7 */
8import { DialogContext } from 'botbuilder-dialogs';
9import { BotkitConversationStep } from './conversation';
10/**
11 * This class is used to provide easy access to common actions taken on active BotkitConversation instances.
12 * These objects are passed into handlers bound to BotkitConversations using .before .onChange and conditional handler functions passed to .ask and .addQuestion
13 * Grants access to convo.vars convo.gotoThread() convo.setVar() and convo.repeat().
14 */
15export declare class BotkitDialogWrapper {
16 private dc;
17 private step;
18 /**
19 * An object containing variables and user responses from this conversation.
20 */
21 vars: {
22 [key: string]: any;
23 };
24 constructor(dc: DialogContext, step: BotkitConversationStep);
25 /**
26 * Jump immediately to the first message in a different thread.
27 * @param thread Name of a thread
28 */
29 gotoThread(thread: string): Promise<void>;
30 /**
31 * Repeat the last message sent on the next turn.
32 */
33 repeat(): Promise<void>;
34 /**
35 * Stop the dialog.
36 */
37 stop(): Promise<void>;
38 /**
39 * Set the value of a variable that will be available to messages in the conversation.
40 * Equivalent to convo.vars.key = val;
41 * Results in {{vars.key}} being replaced with the value in val.
42 * @param key the name of the variable
43 * @param val the value for the variable
44 */
45 setVar(key: any, val: any): void;
46}