import Store, { StoreCardItem, StoreGlobalTokenItem } from './store/Store'; import { WeChatOptions } from './WeChatOptions'; export interface CardSignObject { shopId: string; cardType: string; cardId: string; timestamp: string; nonceStr: string; appid: string; api_ticket: string; cardSign?: string; signType?: string; } export interface CardExtObject { timestamp: string; nonce_str: string; card_id?: string; code?: string; openid?: string; api_ticket?: string; signature?: string; fixed_begintimestamp?: string; outer_str?: string; } /** * Wechat Card/Coupons class * @return {Card} Card instance */ declare class Card { options: WeChatOptions; store: Store; constructor(options?: WeChatOptions); static get CODE_TYPE(): Record; static get CARD_TYPE(): Record; /** * Get Card api_ticket * @param {string} accessToken * @return {Promise} */ getApiTicketRemotely(accessToken: string): Promise; /** * Get global access token * @param {Boolean} force if should check for cached token */ getGlobalToken(force?: boolean): Promise; /** * Get card api_ticket * @return {Promise} */ getApiTicket(): Promise; /** * Generate card signature info for chooseCard function * @param {string=} shopId, aka: location_id * @param {string=} cardType * @param {string=} cardId * @return {Promise} */ getCardSignature(shopId: string, cardType: string, cardId: string): Promise; /** * Generate cardExt * @param {string} cardId * @param {string=} code * @param {string=} openid * @param {string=} fixedBeginTimestamp * @param {string=} outerStr */ getCardExt(cardId: string, code: string, openid: string, fixedBeginTimestamp: string, outerStr: string): Promise; /** * Simply send decode card encrypt_code api * @param {String} encryptCode encrypt_code of real card code * @param {object} qs querystring object to send with the request * @return {Promise} */ sendDecodeRequest(encryptCode: string, qs: { [key: string]: string | number | boolean; }): Promise>; /** * Decode/Decrypt card encrypt_code to get real card code * @param {string} encryptCode * @return {Promise} */ decryptCardCode(encryptCode: string): Promise>; } export default Card;