@microsoft/agents-hosting-teams
Version:
Microsoft 365 Agents SDK for JavaScript
30 lines (29 loc) • 1.31 kB
TypeScript
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { TurnContext, TurnState } from '@microsoft/agents-hosting';
import { TeamsApplication } from '../teamsApplication';
import { TaskModuleTaskInfo } from '../../task/taskModuleTaskInfo';
/**
* 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: TeamsApplication<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>): TeamsApplication<TState>;
}