mini-types
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -0,1 +1,10 @@ | ||
# 0.1.6 | ||
* **主要变更** | ||
- [+] `IGetFileInfoOptions` 的 `digestAlgorithm` 参数类型新增 `sha1`。 | ||
- [+] 优化 `offAccelerometerChange`、`offUserCaptureScreen`、`offUserCaptureScreen`、`offCompassChange`、`offGyroscopeChange` 的返回类型。 | ||
- [+] 完善 `my.scan` 参数。 | ||
- [+] 引入 `audio` 文件。 | ||
# 0.1.5 | ||
@@ -2,0 +11,0 @@ |
{ | ||
"name": "mini-types", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "TypeScript declarations for Alipay's mini program.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -30,3 +30,3 @@ /** | ||
*/ | ||
function offAccelerometerChange(): void; | ||
function offAccelerometerChange(callback?: (res: IOnAccelerometerChangeEvent) => void): void; | ||
} |
@@ -7,2 +7,4 @@ /** | ||
* 用于监听用户发起的主动截屏事件,可以接收到系统以及第三方截屏工具的截屏事件通知。 | ||
* 返回值:{NBPageUrl: "https://{{appid}}.hybrid.alipay-eco.com/index.html#pages/index/index"} | ||
* 返回值用不到,这里不进行定义 | ||
*/ | ||
@@ -14,3 +16,3 @@ function onUserCaptureScreen(cb: () => void): void; | ||
*/ | ||
function offUserCaptureScreen(): void; | ||
function offUserCaptureScreen(callback?: (res: () => void) => void): void; | ||
} |
@@ -20,3 +20,3 @@ /** | ||
*/ | ||
function offCompassChange(): void; | ||
function offCompassChange(callback?: (res: IOnCompassChangeEvent) => void): void; | ||
} |
@@ -30,3 +30,3 @@ /** | ||
*/ | ||
function offGyroscopeChange(): void; | ||
function offGyroscopeChange(callback?: (res: IOnGyroscopeChangeEvent) => void): void; | ||
} |
@@ -5,2 +5,8 @@ /** | ||
declare namespace my { | ||
/** | ||
* 扫码识别类型,默认值为 ['qrCode','barCode'] | ||
* 二维码 | 条码 | DM码 | PDF417码 | 窄条二维码 | 异构码 | ||
*/ | ||
type IScanType = 'qrCode' | 'barCode' | 'dmCode' | 'pdf417Code' | 'narrowCode' | 'hmCode'; | ||
interface IScanSuccessResult { | ||
@@ -21,2 +27,22 @@ /** | ||
readonly barCode: string; | ||
/** | ||
* 码类型。 | ||
*/ | ||
readonly scanType: string; | ||
/** | ||
* 码内容。 | ||
*/ | ||
readonly result: string; | ||
/** | ||
* 来源。 | ||
*/ | ||
readonly imageChannel: string; | ||
/** | ||
* Base64 字节流。 | ||
*/ | ||
readonly rawData: string; | ||
} | ||
@@ -34,2 +60,3 @@ | ||
/** | ||
* @deprecated | ||
* 扫码样式(默认 qr): | ||
@@ -42,2 +69,14 @@ * 1. qr,扫码框样式为二维码扫码框; | ||
/** | ||
* 扫码识别类型,默认值为 ['qrCode','barCode']。 | ||
* 可选值: | ||
* 二维码:'qrCode'。 | ||
* 条码:'barCode'。 | ||
* DM码:'dmCode'。 | ||
* PDF417码:'pdf417Code'。 | ||
* 窄条二维码:'narrowCode'。 | ||
* 异构码:'hmCode'。 | ||
*/ | ||
scanType?: IScanType[]; | ||
/** | ||
* 是否隐藏相册(不允许从相册选择图片),只能从相机扫码 | ||
@@ -44,0 +83,0 @@ */ |
/** | ||
* @file 屏幕亮度 | ||
*/ | ||
import IFailResult from "../../common/IFailResult"; | ||
declare namespace my { | ||
interface IGetKeepScreenOnSuccessResult { | ||
brightness: number; | ||
success: boolean; | ||
} | ||
interface ISetKeepScreenOnSuccessResult { | ||
success: boolean; | ||
} | ||
interface ISetKeepScreenSuccessResult { | ||
success: boolean; | ||
} | ||
interface ISetKeepScreenOnOptions { | ||
@@ -14,3 +29,3 @@ /** | ||
*/ | ||
success?(res: any): void; | ||
success?(res: ISetKeepScreenOnSuccessResult): void; | ||
@@ -20,3 +35,3 @@ /** | ||
*/ | ||
fail?(res: any): void; | ||
fail?(res: IFailResult): void; | ||
@@ -38,3 +53,3 @@ /** | ||
*/ | ||
success?(res: any): void; | ||
success?(res: IGetKeepScreenOnSuccessResult): void; | ||
@@ -44,3 +59,3 @@ /** | ||
*/ | ||
fail?(res: any): void; | ||
fail?(res: IFailResult): void; | ||
@@ -67,3 +82,3 @@ /** | ||
*/ | ||
success?(res: any): void; | ||
success?(res: ISetKeepScreenSuccessResult): void; | ||
@@ -73,3 +88,3 @@ /** | ||
*/ | ||
fail?(res: any): void; | ||
fail?(res: IFailResult): void; | ||
@@ -76,0 +91,0 @@ /** |
@@ -11,3 +11,3 @@ /** | ||
*/ | ||
function watchShake(options: IWatchShakeOptions): void; | ||
function watchShake(options?: IWatchShakeOptions): void; | ||
} |
@@ -69,3 +69,3 @@ /** | ||
*/ | ||
readonly app: string; | ||
readonly app: 'alipay' | 'UC' | 'QUARK' | 'AK' | 'amap' | 'YK'; | ||
@@ -72,0 +72,0 @@ /** |
@@ -6,3 +6,3 @@ /** | ||
interface IVibrateOptions { | ||
success(): void; | ||
success?(): void; | ||
} | ||
@@ -12,3 +12,3 @@ /** | ||
*/ | ||
function vibrate(options: IVibrateOptions): void; | ||
function vibrate(options?: IVibrateOptions): void; | ||
@@ -21,3 +21,3 @@ interface IVibrateLongOptions { | ||
*/ | ||
function vibrateLong(options: IVibrateLongOptions): void; | ||
function vibrateLong(options?: IVibrateLongOptions): void; | ||
@@ -30,3 +30,3 @@ interface IVibrateShortOptions { | ||
*/ | ||
function vibrateShort(options: IVibrateShortOptions): void; | ||
function vibrateShort(options?: IVibrateShortOptions): void; | ||
} |
@@ -153,3 +153,3 @@ /** | ||
apFilePath: string; | ||
digestAlgorithm?: 'md5' | 'md5'; | ||
digestAlgorithm?: 'md5' | 'sha1'; | ||
success?(res: IGetFileInfoSuccessResult): void; | ||
@@ -156,0 +156,0 @@ fail?(): void; |
@@ -101,2 +101,20 @@ /// <reference path="./ui/index.d.ts" /> | ||
function showSharePanel(): void; | ||
interface IOnUnhandledRejectionCallbackOptions { | ||
/** | ||
* 拒绝原因,一般是 error 对象。 | ||
*/ | ||
reason: string; | ||
/** | ||
* 被拒绝的 Promise 对象。 | ||
*/ | ||
promise: Promise<any>; | ||
} | ||
interface IOnUnhandledRejectionCallback { | ||
(res: IOnUnhandledRejectionCallbackOptions): void; | ||
} | ||
function onUnhandledRejection(cb: IOnUnhandledRejectionCallback): void; | ||
} |
@@ -0,1 +1,3 @@ | ||
/// <reference path="./audio.d.ts" /> | ||
/** | ||
@@ -2,0 +4,0 @@ * @file 多媒体 |
@@ -79,2 +79,8 @@ declare namespace tinyapp { | ||
onShareAppMessage?(options: OnShareAppMessageOptions): IOnShareAppMessageResult; | ||
/** | ||
* 当Promise 被 reject 且没有 reject 处理器时触发。也可使用 my.onUnhandledRejection 绑定监听。 | ||
* 参数和注意事项与 my.onUnhandledRejection 一致。 | ||
*/ | ||
onUnhandledRejection?(options?: my.IOnUnhandledRejectionCallbackOptions): void; | ||
} | ||
@@ -81,0 +87,0 @@ |
{ | ||
"extends": "dtslint/dtslint.json", | ||
"rules": { | ||
"interface-name" : [true, "never"] | ||
"interface-name" : [true, "always-prefix"], | ||
"strict-export-declare-modifiers": false, | ||
"no-redundant-jsdoc": false | ||
} | ||
} |
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
188631
86
6446