import { AxiosResponse } from 'axios' ; import debug from 'debug' ; import { Send } from '../interfaces/send' ; import { ajax } from '@/utils/ajax' ; const Debugger = debug ( 'push:cool-push' ) ; /**
 * 推送类型，见 [Cool Push](https://cp.xuthus.cc/)。
 * 暂不支持 一对多推送/指定特定的qq号或者群/企业微信消息推送/钉钉群消息/邮箱消息推送
 */ export type PushType = 'send' | 'group' | 'psend' | 'pgroup' | 'wx' | 'tg' ; author CaoMeiYouRen
 *  date export class export class CoolPush implements Send { private private SKEY : string ; author CaoMeiYouRen
     *  date param SKEY constructor ( SKEY ) { this . SKEY = SKEY ; Debugger ( 'set SKEY: "%s"' , SKEY ) ; if ( ! this . SKEY ) { throw new Error ( 'SKEY 是必须的！' ) ; } } author CaoMeiYouRen
     *  date param content param type returns async send ( content , type = 'send' ) { Debugger ( 'content: "%s" ,type: "%s"' , content , type ) ; return ajax ( { url : `https://push.xuthus.cc/${ type }/${ this . SKEY }` , method : 'POST' , headers : { 'Content-Type' : 'application/x-www-form-urlencoded' , } , query : { c : content , } , } ) ; } }