@tarojs/taro 3.4.0-beta.0 → 3.5.0-canary.0

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.4.0-beta.0",
3
+ "version": "3.5.0-canary.0",
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.4.0-beta.0",
30
- "@tarojs/runtime": "3.4.0-beta.0",
31
- "@tarojs/taro-h5": "3.4.0-beta.0"
29
+ "@tarojs/api": "3.5.0-canary.0",
30
+ "@tarojs/runtime": "3.5.0-canary.0",
31
+ "@tarojs/taro-h5": "3.5.0-canary.0"
32
32
  },
33
- "gitHead": "107670bc2360ee9136a0e558e6d5fad1db640fba"
33
+ "gitHead": "a0222bc41bc05b0e34413d6db3de963d777a5015"
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
@@ -46,10 +46,23 @@ declare module './index' {
46
46
  install (app: any, data: any): void
47
47
  }
48
48
 
49
+ interface TARO_ENV_TYPE {
50
+ [TaroGeneral.ENV_TYPE.WEAPP]: TaroGeneral.ENV_TYPE.WEAPP
51
+ [TaroGeneral.ENV_TYPE.WEB]: TaroGeneral.ENV_TYPE.WEB
52
+ [TaroGeneral.ENV_TYPE.RN]: TaroGeneral.ENV_TYPE.RN
53
+ [TaroGeneral.ENV_TYPE.SWAN]: TaroGeneral.ENV_TYPE.SWAN
54
+ [TaroGeneral.ENV_TYPE.ALIPAY]: TaroGeneral.ENV_TYPE.ALIPAY
55
+ [TaroGeneral.ENV_TYPE.TT]: TaroGeneral.ENV_TYPE.TT
56
+ [TaroGeneral.ENV_TYPE.QQ]: TaroGeneral.ENV_TYPE.QQ
57
+ [TaroGeneral.ENV_TYPE.JD]: TaroGeneral.ENV_TYPE.JD
58
+ }
59
+
49
60
  interface TaroStatic {
50
61
  // eventCenter
51
62
  eventCenter: TaroGeneral.Events
52
63
 
64
+ ENV_TYPE: TARO_ENV_TYPE
65
+
53
66
  getEnv(): TaroGeneral.ENV_TYPE
54
67
 
55
68
  render(component: Component | JSX.Element, element: Element | null): any
@@ -60,7 +73,7 @@ declare module './index' {
60
73
  atMessage(options: AtMessageOptions): void
61
74
 
62
75
  pxTransform(size: number, designWidth?: number): string
63
- initPxTransform(config: { designWidth: number; deviceRatio: object }): void
76
+ initPxTransform(config: { designWidth: number; deviceRatio: TaroGeneral.TDeviceRatio }): void
64
77
 
65
78
  addInterceptor(interceptor: interceptor): any
66
79