botbuilder-dialogs-adaptive
Version:
Rule system for the Microsoft BotBuilder dialog system.
84 lines • 3.13 kB
TypeScript
/**
* @module botbuilder-dialogs-adaptive
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { BoolProperty, EnumProperty, StringProperty, UnknownProperty } from '../properties';
import { BoolExpression, EnumExpression, StringExpression, ValueExpression } from 'adaptive-expressions';
import { Converter, ConverterFactory, Dialog, DialogConfiguration, DialogContext, DialogTurnResult } from 'botbuilder-dialogs';
export declare enum ArrayChangeType {
push = "push",
pop = "pop",
take = "take",
remove = "remove",
clear = "clear"
}
export interface EditArrayConfiguration extends DialogConfiguration {
changeType?: EnumProperty<ArrayChangeType>;
itemsProperty?: StringProperty;
resultProperty?: StringProperty;
value?: UnknownProperty;
disabled?: BoolProperty;
}
/**
* Lets you modify an array in memory.
*/
export declare class EditArray<O extends object = {}> extends Dialog<O> implements EditArrayConfiguration {
static $kind: string;
constructor();
/**
* Initializes a new instance of the [EditArray](xref:botbuilder-dialogs-adaptive.EditArray) class.
*
* @param changeType [ArrayChangeType](xref:botbuilder-dialogs-adaptive.ArrayChangeType), change type.
* @param itemsProperty Array property.
* @param value Optional. Value to insert.
* @param resultProperty Optional. Output property to put Pop/Take into.
*/
constructor(changeType: ArrayChangeType, itemsProperty: string, value?: any, resultProperty?: string);
/**
* Type of change being applied.
*/
changeType: EnumExpression<ArrayChangeType>;
/**
* Property path expression to the collection of items.
*/
itemsProperty: StringExpression;
/**
* The path expression to store the result of action.
*/
resultProperty: StringExpression;
/**
* The expression of the value to put onto the array.
*/
value: ValueExpression;
/**
* 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 EditArrayConfiguration): Converter | ConverterFactory;
/**
* 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;
/**
* @private
*/
private ensureValue;
}
//# sourceMappingURL=editArray.d.ts.map