botbuilder-dialogs-adaptive
Version:
Rule system for the Microsoft BotBuilder dialog system.
80 lines • 2.96 kB
TypeScript
/**
* @module botbuilder-dialogs-adaptive
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { ActionScope } from './actionScope';
import { BoolExpression } from 'adaptive-expressions';
import { BoolProperty } from '../properties';
import { Converter, ConverterFactory, Dialog, DialogConfiguration, DialogContext, DialogDependencies, DialogTurnResult } from 'botbuilder-dialogs';
export interface IfConditionConfiguration extends DialogConfiguration {
condition?: BoolProperty;
actions?: string[] | Dialog[];
elseActions?: string[] | Dialog[];
disabled?: BoolProperty;
}
/**
* Conditional branch.
*/
export declare class IfCondition<O extends object = {}> extends Dialog<O> implements DialogDependencies, IfConditionConfiguration {
static $kind: string;
constructor();
/**
* Conditional expression to evaluate.
*/
condition: BoolExpression;
/**
* The actions to run if [condition](#condition) returns true.
*/
actions: Dialog[];
/**
* The actions to run if [condition](#condition) returns false.
*/
elseActions: Dialog[];
/**
* An optional expression which if is true will disable this action.
*/
disabled?: BoolExpression;
/**
* @param property The key of the conditional selector configuration.
* @returns The converter for the selector configuration.
*/
getConverter(property: keyof IfConditionConfiguration): Converter | ConverterFactory;
/**
* @protected
* Gets the true scope.
* @returns An [ActionScope](xref:botbuilder-dialogs-adaptive.ActionScope).
*/
protected get trueScope(): ActionScope;
/**
* @protected
* Gets the false scope.
* @returns An [ActionScope](xref:botbuilder-dialogs-adaptive.ActionScope).
*/
protected get falseScope(): ActionScope;
private _trueScope;
private _falseScope;
/**
* Gets the child [Dialog](xref:botbuilder-dialogs.Dialog) dependencies so they can be added to the containers [Dialog](xref:botbuilder-dialogs.Dialog) set.
*
* @returns The child [Dialog](xref:botbuilder-dialogs.Dialog) dependencies.
*/
getDependencies(): Dialog[];
/**
* Starts a new [Dialog](xref:botbuilder-dialogs.Dialog) and pushes it onto the dialog stack.
*
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation.
* @param _options Optional. Initial information to pass to the dialog.
* @returns A `Promise` representing the asynchronous operation.
*/
beginDialog(dc: DialogContext, _options?: O): Promise<DialogTurnResult>;
/**
* @protected
* Builds the compute Id for the [Dialog](xref:botbuilder-dialogs.Dialog).
* @returns A `string` representing the compute Id.
*/
protected onComputeId(): string;
}
//# sourceMappingURL=ifCondition.d.ts.map