/// import { TokenCache } from "../cache/tokencache"; import { ReadStream } from "fs"; export declare type ApiUrl = "https://qyapi.weixin.qq.com/cgi-bin/"; /** * UNIX 时间戳 */ export declare type timestamp = number; export interface Corp { corpId: string; corpSecret: string; mailSecret: string; checkInSecret: string; approvalSecret: string; apiUrl?: string; } export declare enum TokenType { corpSecret = 0, mailSecret = 1, checkInSecret = 2, approvalSecret = 3 } /** * 初始化参数 */ export interface WechatInitOptions { corp: Corp; tokenCache: TokenCache; } export interface WechatTextMsg { toUser?: string; toParty?: string; toTag?: string; agentId: number; content: string; safe?: number; } export interface WechatFileMsg { toUser?: string; toParty?: string; toTag?: string; agentId: number; mediaId: number; safe?: number; } export declare enum MediaType { IMAGE = "image", VOICE = "voice", VIDEO = "video", FILE = "file" } export interface MediaFile { toUser?: string; toParty?: string; toTag?: string; agentId: number; mediaId: number; safe?: number; } export interface FileOptions { filename: string; contentType: string; } export interface File { value: ReadStream; options: FileOptions; } export declare enum OpenCheckInDataType { GoToWork = 1, GoOut = 2, All = 3 } /** * 群聊 */ export interface AppChat { name?: string; owner?: string; userlist: string[]; chatid?: string; } /** * 修改时的群聊信息 */ export interface AppChatInfo { chatid: string; name?: string; owner?: string; add_user_list?: string[]; del_user_list?: string[]; } export interface AppChatMsg { chatid: string; msgtype: "text" | "markdown"; content: string; safe?: number; }