export declare type MsgType = 'text' | 'image' | 'voice' | 'video' | 'music' | 'news' | 'transfer_customer_service'; export declare type TextContent = string; export interface ImageContent { mediaId: string; } export interface VoiceContent { mediaId: string; } export interface VideoContent { mediaId: string; title: string; description: string; } export interface MusicContent { mediaId: string; title: string; description: string; musicUrl: string; hqMusicUrl: string; } export interface NewsContent { title: string; description: string; picUrl: string; url: string; } export interface ServiceContent { kfAccount?: string; } export declare type ReplyContent = TextContent | NewsContent[] | { type: MsgType; content: TextContent | ImageContent | VoiceContent | VideoContent | MusicContent | NewsContent[] | ServiceContent; }; export declare type Handle = (message: object, ctx: object) => Promise; export declare type HandlerConfig = string | { token: string; appid?: string; encodingAESKey?: string; }; export declare class Handler { private token; private appid; private encodingAESKey; private readonly handlers; private cryptor; constructor(config?: HandlerConfig); setConfig(config: HandlerConfig): void; getHandler(type: string): Handle; setHandler(type: string, handle: Handle): Handler; text(handle: Handle): Handler; image(handle: Handle): Handler; voice(handle: Handle): Handler; location(handle: Handle): Handler; link(handle: Handle): Handler; event(handle: Handle): Handler; shortvideo(handle: Handle): Handler; hardware(handle: Handle): Handler; device_text(handle: Handle): Handler; device_event(handle: Handle): Handler; any(handle: Handle): Handler; middlewarify(): (ctx: any, next: any) => Promise; } export declare const middleware: (config?: HandlerConfig) => Handler;