UNPKG

botbuilder-dialogs-adaptive

Version:

Rule system for the Microsoft BotBuilder dialog system.

66 lines (65 loc) 3.2 kB
/** * @module botbuilder-dialogs-adaptive */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { ArrayProperty, StringProperty } from '../properties'; import { SendActivity, SendActivityConfiguration } from '../actions/sendActivity'; import { ArrayExpression, StringExpression } from 'adaptive-expressions'; import { Converter, ConverterFactory, DialogContext, DialogTurnResult } from 'botbuilder-dialogs'; export interface AskConfiguration extends SendActivityConfiguration { expectedProperties?: ArrayProperty<string>; defaultOperation?: StringProperty; } /** * Ask for an open-ended response. * This sends an activity and then terminates the turn with `DialogTurnStatus.completeAndWait`. * The next activity from the user will then be handled by the parent adaptive dialog. * It also builds in a model of the properties that are expected in response through `DialogPath.expectedProperties`. * `DialogPath.retries` is updated as the same question is asked multiple times. */ export declare class Ask extends SendActivity implements AskConfiguration { static $kind: string; /** *Initializes a new instance of the [Ask](xref:botbuilder-dialogs-adaptive.Ask) class. * * @param text Optional, text value. * @param expectedProperties Optional, [ArrayExpression](xref:adaptive-expressions.ArrayExpression) of expected properties. */ constructor(text?: string, expectedProperties?: ArrayExpression<string>); /** * Gets or sets properties expected to be filled by response. */ expectedProperties: ArrayExpression<string>; /** * Gets or sets the default operation that will be used when no operation is recognized. */ defaultOperation: StringExpression; /** * Called when the [Dialog](xref:botbuilder-dialogs.Dialog) is started and pushed onto the dialog stack. * * @param property The key of the conditional selector configuration. * @returns The converter for the selector configuration. */ getConverter(property: keyof AskConfiguration): Converter | ConverterFactory; /** * Called when the dialog is started and pushed onto the dialog stack. * * @summary * If the task is successful, the result indicates whether the dialog is still * active after the turn has been processed by the dialog. * * You can use the [options](#options) parameter to include the QnA Maker context data, * which represents context from the previous query. To do so, the value should include a * `context` property of type [QnAResponseContext](#QnAResponseContext). * * @param {DialogContext} dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation. * @param {object} options (Optional) Initial information to pass to the dialog. * @returns {Promise<DialogTurnResult>} A promise resolving to the turn result */ beginDialog(dc: DialogContext, options?: object): Promise<DialogTurnResult>; protected onComputeId(): string; } //# sourceMappingURL=ask.d.ts.map