35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import { Feature } from 'oak-frontend-base/es/types/Feature';
|
|
import { EntityDict } from '../oak-app-domain';
|
|
import { Cache } from 'oak-frontend-base/es/features/cache';
|
|
import { LocalStorage } from 'oak-frontend-base/es/features/localStorage';
|
|
import { Environment } from 'oak-frontend-base/es/features/environment';
|
|
import wx from 'weixin-js-sdk';
|
|
type ConfigOptions = {
|
|
debug?: boolean;
|
|
appId: string;
|
|
timestamp: number;
|
|
nonceStr: string;
|
|
signature: string;
|
|
jsApiList?: wx.jsApiList;
|
|
openTagList?: wx.openTagList;
|
|
};
|
|
export declare class WechatSdk<ED extends EntityDict> extends Feature {
|
|
private cache;
|
|
private storage;
|
|
private environment;
|
|
private landingUrl?;
|
|
private lastConfigUrl?;
|
|
constructor(cache: Cache<ED>, storage: LocalStorage, environment: Environment);
|
|
signatureJsSDK(url: string): Promise<any>;
|
|
getConfig(config: ConfigOptions): Promise<unknown>;
|
|
setLandingUrl(url?: string): void;
|
|
private initedApiList;
|
|
private init;
|
|
/**
|
|
* 微信jssdk 传入方法名
|
|
*/
|
|
loadWxAPi<T extends wx.ApiMethod>(name: T, options?: Parameters<(typeof wx)[T]>[0]): Promise<object>;
|
|
subscribeMpMessage(messageTypes: string[], haveToAccept?: boolean, tip?: string): Promise<boolean>;
|
|
}
|
|
export {};
|