typed-wx-api
Version:
Typed Wechat API
62 lines (61 loc) • 1.54 kB
TypeScript
import { WxMpMessages } from '../../mp';
export type WxSpBaseInfoMessage<T> = {
AppId: string;
CreateTime: string;
InfoType: T;
};
export interface WxSpInfoMessages {
}
export declare class WxSpCrypto {
private readonly wxCrypto;
constructor(config: {
token: string;
encodingAESKey: string;
componentAppid: string;
});
decrypt(params: {
msg_signature: string;
timestamp: string;
nonce: string;
}, encrypt: string): Promise<{
errMessage: string;
message?: undefined;
} | {
errMessage: undefined;
message: string;
}>;
private formatXmlObj;
decryptInfoXML(params: {
msg_signature: string;
timestamp: string;
nonce: string;
}, xmlStr: string): Promise<{
errMessage: string;
} | {
errMessage: undefined;
AppID: string;
Decrypt: WxSpInfoMessages[keyof WxSpInfoMessages];
}>;
decryptMpMessageXML(params: {
msg_signature: string;
timestamp: string;
nonce: string;
}, xmlStr: string): Promise<{
errMessage: string;
} | {
errMessage: undefined;
Decrypt: WxMpMessages[keyof WxMpMessages];
}>;
decryptXML<T>(params: {
msg_signature: string;
timestamp: string;
nonce: string;
}, xmlStr: string): Promise<{
errMessage: string;
message?: undefined;
} | {
errMessage: undefined;
AppID: string;
Decrypt: T;
}>;
}