UNPKG

botbuilder-dialogs-adaptive

Version:

Rule system for the Microsoft BotBuilder dialog system.

64 lines 2.18 kB
/** * @module botbuilder-dialogs-adaptive */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { ActionContext } from '../actionContext'; import { Converter, ConverterFactory } from 'botbuilder-dialogs'; import { OnCondition } from '../conditions/onCondition'; import { TriggerSelector } from '../triggerSelector'; import { BoolProperty } from '../properties'; import { BoolExpression, ExpressionParserInterface } from 'adaptive-expressions'; export interface ConditionalSelectorConfiguration { condition?: BoolProperty; ifTrue?: TriggerSelector; ifFalse?: TriggerSelector; } /** * Select between two rule selectors based on a condition. */ export declare class ConditionalSelector extends TriggerSelector implements ConditionalSelectorConfiguration { static $kind: string; private _conditionals; private _evaluate; /** * Expression that determines which selector to use. */ condition: BoolExpression; /** * Gets or sets selector if condition is true. */ ifTrue: TriggerSelector; /** * Gets or sets selector if condition is false. */ ifFalse: TriggerSelector; /** * Gets or sets the expression parser to use. */ parser: ExpressionParserInterface; /** * Gets the converter for the selector configuration. * * @param property The key of the conditional selector configuration. * @returns The converter for the selector configuration. */ getConverter(property: keyof ConditionalSelectorConfiguration): Converter | ConverterFactory; /** * Initialize the selector with the set of rules. * * @param conditionals Possible rules to match. * @param evaluate True if rules should be evaluated on select. */ initialize(conditionals: OnCondition[], evaluate: boolean): void; /** * Select the best rule to execute. * * @param actionContext Dialog context for evaluation. * @returns A Promise with a number array. */ select(actionContext: ActionContext): Promise<OnCondition[]>; } //# sourceMappingURL=conditionalSelector.d.ts.map