/** * @module teams-ai */ /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { BotConfigAuth, TaskModuleResponse, TaskModuleTaskInfo, TurnContext } from 'botbuilder'; import { Application, RouteSelector } from './Application'; import { TurnState } from './TurnState'; export declare enum TaskModuleInvokeNames { CONFIG_FETCH_INVOKE_NAME = "config/fetch", CONFIG_SUBMIT_INVOKE_NAME = "config/submit", FETCH_INVOKE_NAME = "task/fetch", SUBMIT_INVOKE_NAME = "task/submit", DEFAULT_TASK_DATA_FILTER = "verb" } /** * Options for TaskModules class. */ export interface TaskModulesOptions { /** * Data field to use to ide1ntify the verb of the handler to trigger. * @remarks * When a task module is triggered, the field name specified here will be used to determine * the name of the verb for the handler to route the request to. * * Defaults to a value of 'verb'. */ taskDataFilter?: string; } /** * TaskModules class to enable fluent style registration of handlers related to Task Modules. * @template TState Type of the turn state object being persisted. */ export declare class TaskModules { private readonly _app; /** * Creates a new instance of the TaskModules class. * @param {Application} app Top level application class to register handlers with. */ constructor(app: Application); /** * Registers a handler to process the initial fetch of the task module. * @remarks * Handlers should respond with either an initial TaskInfo object or a string containing * a message to display to the user. * @template TData Optional. Type of the data object being passed to the handler. * @param {string | RegExp | RouteSelector | string[] | RegExp[] | RouteSelector[]} verb - Name of the verb(s) to register the handler for. * @param {(context: TurnContext, state: TState, data: TData) => Promise} handler - Function to call when the handler is triggered. * @param {TurnContext} handler.context - Context for the current turn of conversation with the user. * @param {TState} handler.state - Current state of the turn. * @param {TData} handler.data - Data object passed to the handler. * @returns {Application} The application for chaining purposes. */ fetch = Record>(verb: string | RegExp | RouteSelector | (string | RegExp | RouteSelector)[], handler: (context: TurnContext, state: TState, data: TData) => Promise): Application; /** * Registers a handler to process the submission of a task module. * @remarks * Handlers should respond with another TaskInfo object, message string, or `null` to indicate * the task is completed. * @template TData Optional. Type of the data object being passed to the handler. * @param {string | RegExp | RouteSelector | string[] | RegExp[] | RouteSelector[]} verb - Name of the verb(s) to register the handler for. * @param {(context: TurnContext, state: TState, data: TData) => Promise} handler - Function to call when the handler is triggered. * @param {TurnContext} handler.context - Context for the current turn of conversation with the user. * @param {TState} handler.state - Current state of the turn. * @param {TData} handler.data - Data object passed to the handler. * @returns {Application} The application for chaining purposes. */ submit = Record>(verb: string | RegExp | RouteSelector | (string | RegExp | RouteSelector)[], handler: (context: TurnContext, state: TState, data: TData) => Promise): Application; /** * Registers a handler for fetching Teams config data for Auth or Task Modules * @template TData Optional. Type of the data object being passed to the handler. * @param {(context: TurnContext, state: TState, data: TData) => Promise} handler - Function to call when the handler is triggered. * @param {TurnContext} handler.context - Context for the current turn of conversation with the user. * @param {TState} handler.state - Current state of the turn. * @param {TData} handler.data - Data object passed to the handler. * @returns {Application} The application for chaining purposes. */ configFetch>(handler: (context: TurnContext, state: TState, data: TData) => Promise): Application; /** * Registers a handler for submitting Teams config data for Auth or Task Modules * @template TData Optional. Type of the data object being passed to the handler. * @param {(context: TurnContext, state: TState, data: TData) => Promise} handler - Function to call when the handler is triggered. * @param {TurnContext} handler.context - Context for the current turn of conversation with the user. * @param {TState} handler.state - Current state of the turn. * @param {TData} handler.data - Data object passed to the handler. * @returns {Application} The application for chaining purposes. */ configSubmit>(handler: (context: TurnContext, state: TState, data: TData) => Promise): Application; } //# sourceMappingURL=TaskModules.d.ts.map