botbuilder-dialogs-adaptive
Version:
Rule system for the Microsoft BotBuilder dialog system.
114 lines • 5.39 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, IntProperty, StringProperty } from '../properties';
import { Converter, ConverterFactory, Dialog, DialogContext, DialogTurnResult } from 'botbuilder-dialogs';
import { BoolExpression, IntExpression, StringExpression } from 'adaptive-expressions';
export interface ForEachPageConfiguration extends ActionScopeConfiguration {
itemsProperty?: StringProperty;
page?: StringProperty;
pageIndex?: StringProperty;
pageSize?: IntProperty;
disabled?: BoolProperty;
}
/**
* Executes a set of actions once for each page of results in an in-memory list or collection.
*
* @remarks
* The list or collection at [property](#property) will be broken up into pages and stored in
* `dialog.page` for each iteration of the loop. The size of each page is determined by [maxSize](#maxsize)
* and defaults to a size of 10. The loop can be exited early by including either a `EndDialog` or
* `GotoDialog` action.
*/
export declare class ForEachPage<O extends object = {}> extends ActionScope<O> implements ForEachPageConfiguration {
static $kind: string;
constructor();
/**
* Expression used to compute the list that should be enumerated.
*/
itemsProperty: StringExpression;
/**
* Expression used to compute the list that should be enumerated.
*/
page: StringExpression;
/**
* Expression used to compute the list that should be enumerated.
*/
pageIndex: StringExpression;
/**
* Page size, default to 10.
*/
pageSize: IntExpression;
/**
* 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 ForEachPageConfiguration): 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 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
* 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 [ActionScopeResult](xref:botbuilder-dialogs-adaptive.ActionScopeResult), contains the actions scope result.
* @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 [ActionScopeResult](xref:botbuilder-dialogs-adaptive.ActionScopeResult), contains the actions scope result.
* @returns A `Promise` representing the asynchronous operation.
*/
protected onContinueLoop(dc: DialogContext, _actionScopeResult: ActionScopeResult): 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
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation.
* @returns A `Promise` representing the asynchronous operation.
*/
private nextPage;
/**
* @private
*/
private getPage;
}
//# sourceMappingURL=forEachPage.d.ts.map