import { Outgoing } from './outgoing'; export declare namespace Incoming { /** * 机器人发送的消息类型 */ export enum ContentType { Text = "text", Audio = "audio", Video = "video", Image = "picture", RichText = "richText", File = "file" } export namespace RichText { type TextSection = { text: string; }; type ImageSection = { type: 'picture'; downloadCode: string; pictureDownloadCode: string; }; type Section = TextSection | ImageSection; } export type RichTextSection = RichText.Section; export type RichTextMessage = { msgtype: 'richText'; content: { richText: RichTextSection[]; }; }; export type ImageMessage = { msgtype: 'picture'; content: { downloadCode: string; pictureDownloadCode: string; }; }; export type AudioMessage = { msgtype: 'audio'; content: { duration: number; downloadCode: string; recognition: string; }; }; export type VideoMessage = { msgtype: 'video'; content: { duration: number; downloadCode: string; videoType: string; }; }; export type FileMessage = { msgtype: 'file'; content: { spaceId: string; field: string; downloadCode: string; fileName: string; }; }; type MessageMap = { [ContentType.Text]: Outgoing.TextMessage; [ContentType.RichText]: RichTextMessage; [ContentType.Image]: ImageMessage; [ContentType.Audio]: AudioMessage; [ContentType.Video]: VideoMessage; [ContentType.File]: FileMessage; }; export type Message = MessageMap[ContentType]; export {}; }