@tnwx/openmp
Version:
TNWX 微信系开发脚手架之缓存
112 lines (111 loc) • 4.49 kB
TypeScript
import { AccessToken } from '@tnwx/accesstoken';
/**
* @author Javen
* @copyright javendev@126.com
* @description 微信开发平台 API
*/
export declare class OpenMpApi {
private static componentLoginPageUrl;
/**
* 授权注册页面扫码授权
* @param appId 第三方平台方 appid
* @param preAuthCode 预授权码
* @param redirectUrl 回调 URI
* @param authType 要授权的帐号类型 1 仅展示公众号 2 展示小程序 3 表示公众号和小程序都展示
* @param bizAppId 指定授权唯一的小程序或公众号
*/
static getComponentLoginPage(appId: string, preAuthCode: string, redirectUrl: string, authType?: number, bizAppId?: string): string;
private static bindComponentUrl;
/**
* 点击移动端链接快速授权
* @param appId 第三方平台方 appid
* @param preAuthCode 预授权码
* @param redirectUrl 回调 URI
* @param authType 要授权的帐号类型 1 仅展示公众号 2 展示小程序 3 表示公众号和小程序都展示
* @param bizAppId 指定授权唯一的小程序或公众号
*/
static bindComponent(appId: string, preAuthCode: string, redirectUrl: string, authType?: number, bizAppId?: string): string;
private static getPreAuthCodeUrl;
/**
* 获取预授权码
* @param appId 第三方平台 appid
*/
static getPreAuthCode(appId: string): Promise<any>;
private static queryAuthUrl;
/**
* 使用授权码获取授权信息
* @param appId 第三方平台 appid
* @param authorizationCode 授权码
*/
static queryAuth(appId: string, authorizationCode: string): Promise<any>;
private static getAuthorizerInfoUrl;
/**
* 获取授权方的帐号基本信息
* @param appId 第三方平台 appid
* @param authorizerAppId 授权方 appid
*/
static getAuthorizerInfo(appId: string, authorizerAppId: string): Promise<any>;
private static getAuthorizerOptionUrl;
/**
* 获取授权方选项信息
* @param appId 第三方平台 appid
* @param authorizerAppId 授权方 appid
* @param optionName 选项名称
*/
static getAuthorizerOption(appId: string, authorizerAppId: string, optionName: string): Promise<any>;
private static setAuthorizerOptionUrl;
/**
* 设置授权方选项信息
* @param appId 第三方平台 appid
* @param authorizerAppId 授权方 appid
* @param optionName 选项名称
* @param optionValue 选项值
*/
static setAuthorizerOption(appId: string, authorizerAppId: string, optionName: string, optionValue: string): Promise<any>;
private static getAuthorizerListUrl;
/**
* 拉取所有已授权的帐号信息
* @param appId 第三方平台 appid
* @param offset 偏移位置/起始位置
* @param count 拉取数量,最大为 500
*/
static getAuthorizerList(appId: string, offset: number, count: number): Promise<any>;
private static createUrl;
/**
* 创建开放平台帐号并绑定公众号/小程序
* @param appId 授权公众号/小程序的 appid
*/
static create(appId: string): Promise<any>;
private static bindUrl;
/**
* 将公众号/小程序绑定到开放平台帐号下
* @param appId 授权公众号/小程序的 appid
* @param openAppId 开放平台帐号 appid
*/
static bind(appId: string, openAppId: string): Promise<any>;
private static unBindUrl;
/**
* 将公众号/小程序从开放平台帐号下解绑
* @param appId 授权公众号/小程序的 appid
* @param openAppId 开放平台帐号 appid
*/
static unBind(appId: string, openAppId: string): Promise<any>;
private static getUrl;
/**
* 将公众号/小程序从开放平台帐号下解绑
* @param appId 授权公众号/小程序的 appid
*/
static get(appId: string): Promise<any>;
private static clearQuotaUrl;
/**
* 对公众号的所有 API 调用次数进行清零
* @param appId 公众号的 appId
*/
static clearQuota(appId: string, accessToken: AccessToken): Promise<any>;
private static clearComponentQuotaUrl;
/**
* 第三方平台 API 调用次数清零
* @param appId 第三方平台 appId
*/
static clearComponentQuota(appId: string): Promise<any>;
}