mini-types
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -0,1 +1,15 @@ | ||
# 0.1.4 | ||
* **主要变更** | ||
- [+] 增加 `my.getExtConfigSync()`、`my.getAppIdSync()`、`my.getUpdateManager()`、`my.showSharePanel()` 类型声明。 | ||
* **Refactor** | ||
- 将 `getApp` 返回的 `{ globalData: any; }` 重构成 `tinyapp.IGetAppResult`。 | ||
* **Bug Fix** | ||
- 修复 animation 类型。 | ||
# 0.1.3 | ||
@@ -2,0 +16,0 @@ |
{ | ||
"name": "mini-types", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "TypeScript declarations for Alipay's mini program.", | ||
@@ -8,3 +8,3 @@ "scripts": { | ||
"ci": "npm run lint", | ||
"prepublish": "npm run ci" | ||
"prepublishOnly": "npm run ci" | ||
}, | ||
@@ -21,5 +21,5 @@ "repository": { | ||
"devDependencies": { | ||
"dtslint": "^0.7.2" | ||
"dtslint": "3.6.4" | ||
}, | ||
"types": "./types/index.d.ts" | ||
} |
@@ -59,2 +59,44 @@ /// <reference path="./ui/index.d.ts" /> | ||
function call(apiName: string, params?: Record<string, any>, callback?: (...args: any[]) => void): void; | ||
/** | ||
* 获取自定义配置数据:https://opendocs.alipay.com/mini/isv/creatminiapp | ||
*/ | ||
function getExtConfigSync(): Record<string, any>; | ||
/** | ||
* 同步获取小程序 APPID。 | ||
*/ | ||
function getAppIdSync(): string; | ||
interface IUpdateManager { | ||
/** | ||
* 当小程序新版本下载完成后(即收到 onUpdateReady 回调),强制小程序重启并使用新版本。 | ||
*/ | ||
applyUpdate(): void; | ||
/** | ||
* 监听向支付宝后台请求检查更新结果事件。 | ||
*/ | ||
onCheckForUpdate(cb: (res: { hasUpdate: boolean }) => void): void; | ||
/** | ||
* 监听小程序有版本更新事件。 | ||
*/ | ||
onUpdateReady(cb: () => void): void; | ||
/** | ||
* 监听小程序更新失败事件。 | ||
*/ | ||
onUpdateFailed(cb: () => void): void; | ||
} | ||
/** | ||
* 创建一个 UpdateManager 对象,获取全局唯一的版本更新管理器,用于管理小程序更新。 | ||
*/ | ||
function getUpdateManager(): IUpdateManager; | ||
/** | ||
* 唤起分享面板。当通过 my.showSharePanel 唤起分享功能时,page.onShareAppMessage 入参中 from 的值为 code。 | ||
*/ | ||
function showSharePanel(): void; | ||
} |
@@ -166,3 +166,3 @@ declare namespace my { | ||
*/ | ||
animation?: string; | ||
animation?: boolean; | ||
@@ -169,0 +169,0 @@ success?: () => void; |
@@ -89,2 +89,12 @@ declare namespace tinyapp { | ||
/** | ||
* getApp()返回的小程序实例 | ||
*/ | ||
interface IGetAppResult { | ||
/** | ||
* 全局状态数据 | ||
*/ | ||
globalData: any; | ||
} | ||
/** | ||
* App 实现的接口对象 | ||
@@ -91,0 +101,0 @@ * 参考: https://docs.alipay.com/mini/framework/app |
@@ -11,3 +11,3 @@ /** | ||
*/ | ||
declare function getApp(): { globalData: any }; | ||
declare function getApp(): tinyapp.IGetAppResult; | ||
@@ -14,0 +14,0 @@ /** |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
177775
6089