/** * REST API layer for the Teams Chat Service. * * All HTTP calls to {region}.ng.msg.teams.microsoft.com/v1 (skype token) or * teams.cloud.microsoft/api/chatsvc/{region}/v1 (Bearer token) are here. * This module is stateless — every function takes a TeamsToken explicitly. */ import type { TeamsToken, Conversation, ConversationsPage, Message, MessageFormat, MessagesPage, Member, SentMessage, EditedMessage, DeletedMessage, ReactionResult, ScheduledMessage } from "../types.js"; /** * Fetch conversations from the Teams Chat Service. * Returns one page of conversations (no built-in pagination). */ export declare function fetchConversations(token: TeamsToken, pageSize: number): Promise; export declare function fetchConversationsPage(token: TeamsToken, pageSize: number, backwardLink?: string): Promise; /** * Fetch one page of messages from a conversation. */ export declare function fetchMessagesPage(token: TeamsToken, conversationId: string, pageSize: number, backwardLink?: string): Promise; /** * Fetch members of a conversation. */ export declare function fetchMembers(token: TeamsToken, conversationId: string): Promise; /** * Send a message to a conversation. * * The `format` parameter controls how `content` is interpreted: * - `"text"` — plain text, sent as-is * - `"markdown"` (default) — converted from Markdown to HTML * - `"html"` — raw HTML, sent as-is */ export declare function postMessage(token: TeamsToken, conversationId: string, content: string, senderDisplayName: string, format?: MessageFormat, amsReferences?: string[], filesJson?: string, subject?: string, quoteHtml?: string): Promise; /** * Edit an existing message in a conversation. * * The `format` parameter controls how `content` is interpreted: * - `"text"` — plain text, sent as-is * - `"markdown"` (default) — converted from Markdown to HTML * - `"html"` — raw HTML, sent as-is */ export declare function editMessage(token: TeamsToken, conversationId: string, messageId: string, content: string, senderDisplayName: string, format?: MessageFormat, quoteHtml?: string): Promise; /** * Delete a message from a conversation. * * Sends a DELETE to the Chat Service; handles empty response body. */ export declare function deleteMessage(token: TeamsToken, conversationId: string, messageId: string): Promise; /** * Schedule a message to be sent at a future time. * * Creates a "ScheduledDraft" via the Chat Service drafts endpoint. * The server delivers the message automatically at the specified time. * * The `format` parameter controls how `content` is interpreted: * - `"text"` — plain text, sent as-is * - `"markdown"` (default) — converted from Markdown to HTML * - `"html"` — raw HTML, sent as-is */ export declare function postScheduledMessage(token: TeamsToken, conversationId: string, content: string, senderDisplayName: string, scheduleAt: Date, format?: MessageFormat, amsReferences?: string[], filesJson?: string, subject?: string): Promise; /** * Add a reaction (emotion) to a message. * * Uses the Chat Service emotions property endpoint. * The `reactionKey` is the emotion name (e.g. "like", "heart", "laugh", "surprised"). */ export declare function addReaction(token: TeamsToken, conversationId: string, messageId: string, reactionKey: string): Promise; /** * Remove a reaction (emotion) from a message. * * Uses the Chat Service emotions property endpoint with DELETE method. * Only removes the current user's reaction of the specified type. */ export declare function removeReaction(token: TeamsToken, conversationId: string, messageId: string, reactionKey: string): Promise; /** * Fetch user properties for the authenticated user. * Returns raw properties — display name may or may not be present. */ export declare function fetchUserProperties(token: TeamsToken): Promise>; /** * Parse a raw API message object into the public Message type. */ export declare function parseRawMessage(raw: Record): Message; //# sourceMappingURL=chat-service.d.ts.map