@tarojs/taro 3.7.0-alpha.1 → 3.7.0-alpha.11

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.
Files changed (42) hide show
  1. package/package.json +9 -3
  2. package/types/api/ad/index.d.ts +6 -18
  3. package/types/api/ai/inference.d.ts +129 -0
  4. package/types/api/alipay/index.d.ts +43 -0
  5. package/types/api/base/crypto.d.ts +18 -4
  6. package/types/api/base/index.d.ts +2 -2
  7. package/types/api/base/performance.d.ts +63 -0
  8. package/types/api/base/system.d.ts +65 -0
  9. package/types/api/base/weapp/app-event.d.ts +18 -18
  10. package/types/api/device/calendar.d.ts +2 -2
  11. package/types/api/device/screen.d.ts +61 -0
  12. package/types/api/device/sms.d.ts +26 -0
  13. package/types/api/media/audio.d.ts +50 -30
  14. package/types/api/media/image.d.ts +40 -17
  15. package/types/api/media/live.d.ts +52 -0
  16. package/types/api/media/video.d.ts +64 -23
  17. package/types/api/media/voip.d.ts +103 -0
  18. package/types/api/network/download.d.ts +2 -10
  19. package/types/api/network/request.d.ts +84 -24
  20. package/types/api/network/upload.d.ts +2 -10
  21. package/types/api/open-api/address.d.ts +12 -10
  22. package/types/api/open-api/channels.d.ts +31 -0
  23. package/types/api/open-api/device-voip.d.ts +63 -0
  24. package/types/api/route/index.d.ts +2 -0
  25. package/types/api/share/index.d.ts +1 -1
  26. package/types/api/storage/cache-manager.d.ts +198 -0
  27. package/types/api/taro.extend.d.ts +223 -0
  28. package/types/{taro.hooks.d.ts → api/taro.hooks.d.ts} +4 -4
  29. package/types/api/ui/navigation-bar.d.ts +1 -1
  30. package/types/compile/compiler.d.ts +1 -1
  31. package/types/compile/config/h5.d.ts +63 -2
  32. package/types/compile/config/mini.d.ts +67 -5
  33. package/types/compile/config/project.d.ts +239 -17
  34. package/types/compile/config/rn.d.ts +64 -0
  35. package/types/compile/config/util.d.ts +62 -4
  36. package/types/compile/hooks.d.ts +1 -1
  37. package/types/global.d.ts +8 -8
  38. package/types/index.d.ts +7 -7
  39. package/types/taro.api.d.ts +8 -1
  40. package/types/taro.component.d.ts +2 -1
  41. package/types/taro.config.d.ts +91 -2
  42. package/types/taro.extend.d.ts +0 -112
@@ -154,6 +154,11 @@ declare module './index' {
154
154
  * @default: false
155
155
  */
156
156
  disableScroll?: boolean
157
+ /** 是否使用页面全局滚动,MPA下默认为全局滚动,SPA默认为局部滚动
158
+ * 只在H5生效
159
+ * @default: MPA:true SPA:false
160
+ */
161
+ usingWindowScroll?: boolean
157
162
  /** 禁止页面右滑手势返回
158
163
  *
159
164
  * **注意** 自微信客户端 7.0.5 开始,页面配置中的 disableSwipeBack 属性将不再生效,
@@ -210,6 +215,22 @@ declare module './index' {
210
215
  * @default "webview"
211
216
  */
212
217
  renderer?: 'webview' | 'skyline'
218
+ /**
219
+ * 组件框架
220
+ * @default "exparser"
221
+ * @see https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/glass-easel/migration.html
222
+ */
223
+ componentFramework?: 'exparser' | 'glass-easel'
224
+ /**
225
+ * 指定特殊的样式隔离选项
226
+ *
227
+ * isolated 表示启用样式隔离,在自定义组件内外,使用 class 指定的样式将不会相互影响(一般情况下的默认值)
228
+ *
229
+ * apply-shared 表示页面 wxss 样式将影响到自定义组件,但自定义组件 wxss 中指定的样式不会影响页面
230
+ *
231
+ * shared 表示页面 wxss 样式将影响到自定义组件,自定义组件 wxss 中指定的样式也会影响页面和其他设置了 apply-shared 或 shared 的自定义组件。(这个选项在插件中不可用。)
232
+ */
233
+ styleIsolation?: 'isolated' | 'apply-shared' | 'shared'
213
234
  /**
214
235
  * 设置导航栏额外图标,目前支持设置属性 icon,值为图标 url(以 https/http 开头)或 base64 字符串,大小建议 30*30 px
215
236
  *
@@ -340,6 +361,34 @@ declare module './index' {
340
361
  delay?: number
341
362
  }
342
363
 
364
+ interface RenderOptions {
365
+ skyline: {
366
+ /**
367
+ * 开启默认Block布局
368
+ * @see https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/wxss.html#%E5%BC%80%E5%90%AF%E9%BB%98%E8%AE%A4Block%E5%B8%83%E5%B1%80
369
+ */
370
+ defaultDisplayBlock?: boolean
371
+ /**
372
+ * 关闭 Skyline AB 实验
373
+ * @see https://developers.weixin.qq.com/miniprogram/dev/framework/runtime/skyline/migration/release.html#%E5%8F%91%E5%B8%83%E4%B8%8A%E7%BA%BF
374
+ */
375
+ disableABTest?: boolean
376
+ }
377
+ }
378
+
379
+ interface Behavior {
380
+ /**
381
+ * 使用小程序默认分享功能时(即不显式设置 Page.onShareAppMessage),当设置此字段后,会使客户端生成的用于分享的 scheme 带上当前用户打开的页面所携带的 query 参数。
382
+ * @supported alipay 基础库 2.7.10 及以上开始支持,同时需使用 IDE 2.7.0 及以上版本进行构建。
383
+ */
384
+ shareAppMessage?: 'appendQuery'
385
+ /**
386
+ * 小程序在解析全局参数、页面参数时默认会对键/值做 encodeURIComponent。当设置为 disable 后,则不再对键/值做encodeURIComponent
387
+ * @supported alipay 基础库 2.7.19 及以上开始支持,同时需使用 IDE 3.0.0 及以上版本进行构建。
388
+ */
389
+ decodeQuery?: 'disable'
390
+ }
391
+
343
392
  interface AppConfig {
344
393
  /** 小程序默认启动首页,未指定 entryPagePath 时,数组的第一项代表小程序的初始页面(首页)。 */
345
394
  entryPagePath?: string
@@ -360,7 +409,11 @@ declare module './index' {
360
409
  * @default false
361
410
  * @since 2.1.0
362
411
  */
363
- functionalPages?: boolean
412
+ functionalPages?:
413
+ | boolean
414
+ | {
415
+ independent?: boolean
416
+ }
364
417
  /** 分包结构配置
365
418
  * @example
366
419
  * ```json
@@ -381,7 +434,7 @@ declare module './index' {
381
434
  * 使用 Worker 处理多线程任务时,设置 Worker 代码放置的目录
382
435
  * @since 1.9.90
383
436
  */
384
- workers?: string
437
+ workers?: string | string[]
385
438
  /** 申明需要后台运行的能力,类型为数组。目前支持以下项目:
386
439
  * - audio: 后台音乐播放
387
440
  * - location: 后台定位
@@ -548,6 +601,42 @@ declare module './index' {
548
601
  * @default "webview"
549
602
  */
550
603
  renderer?: 'webview' | 'skyline'
604
+ /**
605
+ * 渲染后端选项
606
+ * @see https://developers.weixin.qq.com/miniprogram/dev/reference/configuration/app.html#rendererOptions
607
+ */
608
+ rendererOptions?: RenderOptions
609
+ /**
610
+ * 指定小程序使用的组件框架
611
+ * @default "exparser"
612
+ * @see https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/glass-easel/migration.html
613
+ */
614
+ componentFramework?: 'exparser' | 'glass-easel'
615
+ /**
616
+ * 多端模式场景接入身份管理服务时开启小程序授权页相关配置
617
+ * @see https://dev.weixin.qq.com/docs/framework/getting_started/auth.html#%E6%96%B0%E6%89%8B%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B
618
+ */
619
+ miniApp?: {
620
+ /**
621
+ * 用于 wx.weixinMinProgramLogin 在小程序中插入「小程序授权 Page」
622
+ */
623
+ useAuthorizePage: boolean
624
+ }
625
+ /**
626
+ * 正常情况下默认所有资源文件都被打包发布到所有平台,可以通过 static 字段配置特定每个目录/文件只能发布到特定的平台(多端场景)
627
+ * @see https://dev.weixin.qq.com/docs/framework/guideline/devtools/condition-compile.html#%E8%B5%84%E6%BA%90
628
+ */
629
+ static?: { pattern: string; platforms: string[] }[]
630
+ /**
631
+ * 动态插件配置规则,声明小程序需要使用动态插件
632
+ * @supported alipay
633
+ */
634
+ useDynamicPlugins?: boolean
635
+ /**
636
+ * 用于改变小程序若干运行行为
637
+ * @supported alipay
638
+ */
639
+ behavior?: Behavior
551
640
  }
552
641
 
553
642
  interface Config extends PageConfig, AppConfig {
@@ -1,112 +0,0 @@
1
- import React from 'react'
2
-
3
- import Taro from './index'
4
-
5
- declare module './index' {
6
- type MessageType = 'info' | 'success' | 'error' | 'warning'
7
-
8
- interface AtMessageOptions {
9
- message: string
10
- type?: MessageType
11
- duration?: number
12
- }
13
-
14
- interface RequestParams<T=any> extends request.Option<T, any> {
15
- [propName: string]: any
16
- }
17
-
18
- interface Current {
19
- app: AppInstance | null
20
- router: RouterInfo | null
21
- page: PageInstance | null
22
- onReady: string
23
- onHide: string
24
- onShow: string
25
- preloadData?: Record<any, any>
26
- /**
27
- * RN 私有对象navigationRef,用于使用底层接口控制路由
28
- */
29
- rnNavigationRef?: React.RefObject<any>
30
- }
31
-
32
- interface SetGlobalDataPlugin {
33
- install (app: any, data: any): void
34
- }
35
-
36
- interface TARO_ENV_TYPE {
37
- [TaroGeneral.ENV_TYPE.WEAPP]: TaroGeneral.ENV_TYPE.WEAPP
38
- [TaroGeneral.ENV_TYPE.WEB]: TaroGeneral.ENV_TYPE.WEB
39
- [TaroGeneral.ENV_TYPE.RN]: TaroGeneral.ENV_TYPE.RN
40
- [TaroGeneral.ENV_TYPE.SWAN]: TaroGeneral.ENV_TYPE.SWAN
41
- [TaroGeneral.ENV_TYPE.ALIPAY]: TaroGeneral.ENV_TYPE.ALIPAY
42
- [TaroGeneral.ENV_TYPE.TT]: TaroGeneral.ENV_TYPE.TT
43
- [TaroGeneral.ENV_TYPE.QQ]: TaroGeneral.ENV_TYPE.QQ
44
- [TaroGeneral.ENV_TYPE.JD]: TaroGeneral.ENV_TYPE.JD
45
- }
46
-
47
- interface TaroStatic {
48
- Events: {
49
- new (): TaroGeneral.Events
50
- }
51
-
52
- /** 事件中心
53
- * @supported global
54
- */
55
- eventCenter: TaroGeneral.Events
56
-
57
- ENV_TYPE: TARO_ENV_TYPE
58
-
59
- /** 获取环境变量
60
- * @supported global
61
- */
62
- getEnv(): TaroGeneral.ENV_TYPE
63
-
64
- /** 尺寸转换
65
- * @supported global
66
- */
67
- pxTransform(size: number, designWidth?: number): string
68
-
69
- /** 尺寸转换初始化
70
- * @supported global
71
- */
72
- initPxTransform(config: {
73
- baseFontSize?: number
74
- deviceRatio?: TaroGeneral.TDeviceRatio
75
- designWidth?: number
76
- targetUnit?: string
77
- unitPrecision?: number
78
- }): void
79
-
80
- /** 小程序引用插件 JS 接口
81
- * @supported weapp, alipay, h5, rn, jd, qq, swan, tt, quickapp
82
- */
83
- requirePlugin(pluginName: string): any
84
-
85
- /** 获取当前页面实例
86
- * @supported global
87
- */
88
- getCurrentInstance(): Current
89
- Current: Current
90
-
91
- /** Vue3 插件,用于设置 `getApp()` 中的全局变量
92
- * @supported weapp, alipay, h5, rn, jd, qq, swan, tt, quickapp
93
- * @example
94
- * ```js
95
- * // 使用插件
96
- * const App = createApp(...)
97
- * App.use(setGlobalDataPlugin, {
98
- * xxx: 999
99
- * })
100
- * // 获取全局变量
101
- * Taro.getApp().xxx
102
- * ```
103
- */
104
- setGlobalDataPlugin: SetGlobalDataPlugin
105
-
106
- /** 获取自定义 TabBar 对应的 React 或 Vue 组件实例
107
- * @supported weapp
108
- * @param page 小程序页面对象,可以通过 Taro.getCurrentInstance().page 获取
109
- */
110
- getTabBar<T>(page: Current['page']): T | undefined
111
- }
112
- }