UNPKG

@microsoft/agents-hosting-extensions-teams

Version:

Microsoft 365 Agents SDK for JavaScript. Teams extensions

41 lines (40 loc) 1.62 kB
/** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ import { AgentApplication, TurnContext, TurnState } from '@microsoft/agents-hosting'; import { TaskModuleTaskInfo } from '../taskModule'; /** * Enum representing the names of message invoke actions. * * This enum is used to define the specific invoke actions that can be triggered * in the context of message handling. */ export declare enum MessageInvokeNames { /** * Represents the action to fetch a task associated with a message. */ FETCH_INVOKE_NAME = "message/fetchTask" } /** * Handles message-related operations for Teams applications. * Provides methods for handling message fetch operations. * @template TState Type extending TurnState to be used by the application */ export declare class Messages<TState extends TurnState> { private readonly _app; /** * Creates a new Messages instance. * @param app The TeamsApplication instance to associate with this Messages instance */ constructor(app: AgentApplication<TState>); /** * Handles fetch requests for messages in Teams, which typically occur when * a message action is invoked. * * @template TData Type of data expected in the message fetch request * @param handler Function to handle the message fetch request * @returns The TeamsApplication instance for chaining */ fetch<TData extends Record<string, any> = Record<string, any>>(handler: (context: TurnContext, state: TState, data: TData) => Promise<TaskModuleTaskInfo | string>): AgentApplication<TState>; }