@tarojs/taro 3.3.15 → 3.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/taro",
3
- "version": "3.3.15",
3
+ "version": "3.3.16",
4
4
  "description": "Taro framework",
5
5
  "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
6
6
  "main": "index.js",
@@ -26,9 +26,9 @@
26
26
  "author": "O2Team",
27
27
  "license": "MIT",
28
28
  "dependencies": {
29
- "@tarojs/api": "3.3.15",
30
- "@tarojs/runtime": "3.3.15",
31
- "@tarojs/taro-h5": "3.3.15"
29
+ "@tarojs/api": "3.3.16",
30
+ "@tarojs/runtime": "3.3.16",
31
+ "@tarojs/taro-h5": "3.3.16"
32
32
  },
33
- "gitHead": "4a11ab9a8950f6a580e1278c160f6b4aaa8ac4f2"
33
+ "gitHead": "75d3de695c98fab79998612ef87567a68ea981a7"
34
34
  }
@@ -15,9 +15,10 @@ declare module '../../index' {
15
15
  *
16
16
  * 可选值:
17
17
  * - 'success': 显示成功图标,此时 title 文本最多显示 7 个汉字长度;
18
+ * - 'error': 显示失败图标,此时 title 文本最多显示 7 个汉字长度;
18
19
  * - 'loading': 显示加载图标,此时 title 文本最多显示 7 个汉字长度;
19
20
  * - 'none': 不显示图标,此时 title 文本最多可显示两行 */
20
- icon?: 'success' | 'loading' | 'none'
21
+ icon?: 'success' | 'error' | 'loading' | 'none'
21
22
  /** 自定义图标的本地路径,image 的优先级高于 icon */
22
23
  image?: string
23
24
  /** 是否显示透明蒙层,防止触摸穿透 */
@@ -121,6 +122,8 @@ declare module '../../index' {
121
122
 
122
123
  namespace enableAlertBeforeUnload {
123
124
  interface Option {
125
+ /** 询问对话框内容 */
126
+ message: string
124
127
  /** 接口调用结束的回调函数(调用成功、失败都会执行) */
125
128
  complete?: (res: TaroGeneral.CallbackResult) => void
126
129
  /** 接口调用失败的回调函数 */
@@ -257,7 +260,7 @@ declare module '../../index' {
257
260
  * ```
258
261
  * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.enableAlertBeforeUnload.html
259
262
  */
260
- enableAlertBeforeUnload(option?: enableAlertBeforeUnload.Option): void
263
+ enableAlertBeforeUnload(option: enableAlertBeforeUnload.Option): void
261
264
 
262
265
  /** 关闭小程序页面返回询问对话框
263
266
  * @supported weapp
@@ -209,10 +209,6 @@ declare enum LogLevel {
209
209
  DEBUG = 'debug'
210
210
  }
211
211
 
212
- export interface IDeviceRatio {
213
- [key: string]: number
214
- }
215
-
216
212
  export type SystemConfig = {
217
213
  /**
218
214
  * 打印日志等级,分为 off,error,warn,info,log,debug
@@ -361,7 +357,7 @@ export interface IProjectBaseConfig {
361
357
  date?: string,
362
358
  designWidth?: number,
363
359
  watcher?: any[],
364
- deviceRatio?: IDeviceRatio,
360
+ deviceRatio?: TaroGeneral.TDeviceRatio,
365
361
  sourceRoot?: string,
366
362
  outputRoot?: string,
367
363
  env?: IOption,
package/types/global.d.ts CHANGED
@@ -387,4 +387,6 @@ declare namespace TaroGeneral {
387
387
  QQ = 'QQ',
388
388
  JD = 'JD'
389
389
  }
390
+
391
+ type TDeviceRatio = Record<string, number>
390
392
  }
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  /// <reference types="vue" />
3
3
 
4
- import Taro, { ComponentOptions, Config, RouterInfo } from './index'
4
+ import Taro, { Config } from './index'
5
5
 
6
6
  declare module './index' {
7
7
  // Components
@@ -42,10 +42,23 @@ declare module './index' {
42
42
  rnNavigationRef?: React.RefObject<any>
43
43
  }
44
44
 
45
+ interface TARO_ENV_TYPE {
46
+ [TaroGeneral.ENV_TYPE.WEAPP]: TaroGeneral.ENV_TYPE.WEAPP
47
+ [TaroGeneral.ENV_TYPE.WEB]: TaroGeneral.ENV_TYPE.WEB
48
+ [TaroGeneral.ENV_TYPE.RN]: TaroGeneral.ENV_TYPE.RN
49
+ [TaroGeneral.ENV_TYPE.SWAN]: TaroGeneral.ENV_TYPE.SWAN
50
+ [TaroGeneral.ENV_TYPE.ALIPAY]: TaroGeneral.ENV_TYPE.ALIPAY
51
+ [TaroGeneral.ENV_TYPE.TT]: TaroGeneral.ENV_TYPE.TT
52
+ [TaroGeneral.ENV_TYPE.QQ]: TaroGeneral.ENV_TYPE.QQ
53
+ [TaroGeneral.ENV_TYPE.JD]: TaroGeneral.ENV_TYPE.JD
54
+ }
55
+
45
56
  interface TaroStatic {
46
57
  // eventCenter
47
58
  eventCenter: TaroGeneral.Events
48
59
 
60
+ ENV_TYPE: TARO_ENV_TYPE
61
+
49
62
  getEnv(): TaroGeneral.ENV_TYPE
50
63
 
51
64
  render(component: Component | JSX.Element, element: Element | null): any
@@ -56,7 +69,7 @@ declare module './index' {
56
69
  atMessage(options: AtMessageOptions): void
57
70
 
58
71
  pxTransform(size: number, designWidth?: number): string
59
- initPxTransform(config: { designWidth: number; deviceRatio: object }): void
72
+ initPxTransform(config: { designWidth: number; deviceRatio: TaroGeneral.TDeviceRatio }): void
60
73
 
61
74
  addInterceptor(interceptor: interceptor): any
62
75