botbuilder-dialogs-adaptive
Version:
Rule system for the Microsoft BotBuilder dialog system.
110 lines • 5.23 kB
TypeScript
/**
* @module botbuilder-dialogs-adaptive
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { ActionScope, ActionScopeConfiguration, ActionScopeResult } from './actionScope';
import { BoolProperty, StringProperty } from '../properties';
import { Converter, ConverterFactory, Dialog, DialogContext, DialogTurnResult } from 'botbuilder-dialogs';
import { ForEachPageConfiguration } from './forEachPage';
import { BoolExpression, StringExpression } from 'adaptive-expressions';
export interface ForEachConfiguration extends ActionScopeConfiguration {
itemsProperty?: StringProperty;
index?: StringProperty;
value?: StringProperty;
disabled?: BoolProperty;
}
/**
* Executes a set of actions once for each item in an in-memory list or collection.
*/
export declare class ForEach<O extends object = {}> extends ActionScope<O> implements ForEachPageConfiguration {
static $kind: string;
private currentIndex;
constructor();
/**
* Initializes a new instance of the [Foreach](xref:botbuilder-dialogs-adaptive.Foreach) class.
*
* @param itemsProperty Property path expression to the collection of items.
* @param actions The actions to execute.
*/
constructor(itemsProperty: string, actions: Dialog[]);
/**
* Property path expression to the collection of items.
*/
itemsProperty: StringExpression;
/**
* Property path expression to the item index.
*/
index: StringExpression;
/**
* Property path expression to the item value.
*/
value: StringExpression;
/**
* 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 ForEachConfiguration): Converter | ConverterFactory;
/**
* 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
* Called when returning control to this [Dialog](xref:botbuilder-dialogs.Dialog) with an [ActionScopeResult](xref:botbuilder-dialogs-adaptive.ActionScopeResult)
* with the property `ActionCommand` set to `BreakLoop`.
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation.
* @param _actionScopeResult The [ActionScopeResult](xref:botbuilder-dialogs-adaptive.ActionScopeResult).
* @returns A `Promise` representing the asynchronous operation.
*/
protected onBreakLoop(dc: DialogContext, _actionScopeResult: ActionScopeResult): Promise<DialogTurnResult>;
/**
* @protected
* Called when returning control to this [Dialog](xref:botbuilder-dialogs.Dialog) with an [ActionScopeResult](xref:botbuilder-dialogs-adaptive.ActionScopeResult)
* with the property `ActionCommand` set to `ContinueLoop`.
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation.
* @param _actionScopeResult The [ActionScopeResult](xref:botbuilder-dialogs-adaptive.ActionScopeResult).
* @returns A `Promise` representing the asynchronous operation.
*/
protected onContinueLoop(dc: DialogContext, _actionScopeResult: ActionScopeResult): Promise<DialogTurnResult>;
/**
* @protected
* Called when the [Dialog](xref:botbuilder-dialogs.Dialog) continues to the next action.
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation.
* @param _result Optional. Value returned from the dialog that was called. The type
* of the value returned is dependent on the child dialog.
* @returns A `Promise` representing the asynchronous operation.
*/
protected onEndOfActions(dc: DialogContext, _result?: any): Promise<DialogTurnResult>;
/**
* @protected
* Calls the next item in the stack.
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation.
* @returns A `Promise` representing the asynchronous operation.
*/
protected nextItem(dc: DialogContext): Promise<DialogTurnResult>;
/**
* @protected
* Builds the compute Id for the [Dialog](xref:botbuilder-dialogs.Dialog).
* @returns A `string` representing the compute Id.
*/
protected onComputeId(): string;
private convertToList;
}
//# sourceMappingURL=forEach.d.ts.map