// error Do not use a triple slash reference for xxx, use `import` style instead
// eslint-disable-next-line spaced-comment, @typescript-eslint/triple-slash-reference
///
/**
* 小程序快捷方法扩展, 参考`../../src/utils/extends.ts`.
* @deprecated 建议直接引用extends方法, 不推荐使用扩展到my上方式, 因为会有污染.
*/
declare namespace my {
/**
* 小程序更新.
*/
function upgradeManage (): void;
/**
* 将小程序API通过promise形式调用.
*
* @template T Type of success value.
* @param key 方法名称(例:showToast), 和小程序api对应.
*/
function aliApiPromise (
key: string
): Promise;
/**
* 将小程序API通过promise形式调用.
*
* @template T Type of success value.
* @param key 方法名称(例:showToast), 和小程序api对应.
* @param rejectOnCancel 取消操作时是否reject Promise, 默认是, 传递false不reject, 默认取消操作错误码11.
*/
function aliApiPromise (
key: string,
// error This overload and the one on line 10 can be combined into one signature with an optional parameter
// eslint-disable-next-line @typescript-eslint/unified-signatures
rejectOnCancel: boolean
): Promise;
/**
* 将小程序API通过promise形式调用.
*
* @template T Type of success value.
* @param key 方法名称(例:showToast), 和小程序api对应.
* @param cancelCode 取消操作错误码.
*/
function aliApiPromise (
key: string,
// error This overload and the one on line 10 can be combined into one signature with an optional parameter
// error This overload and the one on line 23 can be combined into one signature taking `boolean | number`
// eslint-disable-next-line @typescript-eslint/unified-signatures
cancelCode: number
): Promise;
/**
* 将小程序API通过promise形式调用.
*
* @template T Type of success value.
* @template O Type of api options.
* @param key 方法名称(例:showToast), 和小程序api对应.
* @param options api配置参数, 和小程序原本调用方式一致(例:aliApiPromise('showToast', {content:'toast'})).
*/
function aliApiPromise > (
key: string,
options: O
): Promise;
/**
* 将小程序API通过promise形式调用.
*
* @template T Type of success value.
* @template O Type of api options.
* @param key 方法名称(例:showToast), 和小程序api对应.
* @param options api配置参数, 和小程序原本调用方式一致(例:aliApiPromise('showToast', {content:'toast'})).
* @param rejectOnCancel 取消操作时是否reject Promise, 默认是, 传递false不reject.
*/
function aliApiPromise > (
key: string,
options: O,
// error This overload and the one on line 10 can be combined into one signature with an optional parameter
// eslint-disable-next-line @typescript-eslint/unified-signatures
rejectOnCancel: boolean
): Promise;
/**
* 将小程序API通过promise形式调用.
*
* @template T Type of success value.
* @template O Type of api options.
* @param key 方法名称(例:showToast), 和小程序api对应.
* @param options api配置参数, 和小程序原本调用方式一致(例:aliApiPromise('showToast', {content:'toast'})).
* @param cancelCode 取消操作错误码.
*/
function aliApiPromise > (
key: string,
options: O,
// error This overload and the one on line 10 can be combined into one signature with an optional parameter
// error This overload and the one on line 23 can be combined into one signature taking `boolean | number`
// eslint-disable-next-line @typescript-eslint/unified-signatures
cancelCode: number
): Promise;
/**
* 简化showToast.
*
* @param content 内容.
* @param options 配置参数.
*/
function toast (content: string, options?: my.IShowToastOptions): void;
/**
* 主动授权获取用户基础信息
*/
function getAuthCodeUser (): Promise;
/**
* 静默授权
*/
function getAuthCodeBase (): Promise;
interface IStartAPVerifyOptions {
url: string;
certifyId: string;
success?: (res: IStartAPVerifySuccessResult) => void;
// error Unexpected any. Specify a different type
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fail?: (err: any) => void;
complete?: () => void;
}
interface IStartAPVerifySuccessResult {
resultStatus: string;
result: {
certifyId: string;
errorCode: string;
};
}
function startAPVerify (options: IStartAPVerifyOptions): void;
}