UNPKG

botbuilder-dialogs-adaptive

Version:

Rule system for the Microsoft BotBuilder dialog system.

47 lines 2.06 kB
/** * @module botbuilder-dialogs-adaptive */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { BoolExpression } from 'adaptive-expressions'; import { BoolProperty } from '../properties'; import { Converter, ConverterFactory, Dialog, DialogConfiguration, DialogContext, DialogTurnResult } from 'botbuilder-dialogs'; export declare type CodeActionHandler = (dc: DialogContext, options?: object) => Promise<DialogTurnResult>; export interface CodeActionConfiguration extends DialogConfiguration { disabled?: BoolProperty; } /** * Class representing a [Dialog](xref:botbuilder-dialogs.Dialog) code action. */ export declare class CodeAction<O extends object = {}> extends Dialog<O> { private codeHandler; disabled?: BoolExpression; /** * @param property The key of the conditional selector configuration. * @returns The converter for the selector configuration. */ getConverter(property: keyof CodeActionConfiguration): Converter | ConverterFactory; /** * Initializes a new instance of the [CodeAction](xref:botbuilder-dialogs-adaptive.CodeAction) class. * * @param codeHandler [CodeActionHandler](xref:botbuilder-dialogs-adaptive.CodeActionHandler), code handler for the action. */ constructor(codeHandler: CodeActionHandler); /** * Builds the compute Id for the [Dialog](xref:botbuilder-dialogs.Dialog). * * @returns A `string` representing the compute Id. */ protected onComputeId(): string; /** * Called when the [Dialog](xref:botbuilder-dialogs.Dialog) is started and pushed 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>; } //# sourceMappingURL=codeAction.d.ts.map