diff --git a/docs/apis/ai/visionkit/VKCamera.md b/docs/apis/ai/visionkit/VKCamera.md index b9d413d291f2..800e43effd77 100644 --- a/docs/apis/ai/visionkit/VKCamera.md +++ b/docs/apis/ai/visionkit/VKCamera.md @@ -13,8 +13,8 @@ sidebar_label: VKCamera | 参数 | 类型 | 说明 | | --- | --- | --- | -| viewMatrix | `Float32Array` | 视图矩阵 | -| intrinsics | `Float32Array` | 相机内参,只有 v2 版本支持 | +| viewMatrix | `Float32Array` | 视图矩阵 | +| intrinsics | `Float32Array` | 相机内参,只有 v2 版本支持 | ### getProjectionMatrix @@ -25,7 +25,7 @@ sidebar_label: VKCamera > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKCamera.getProjectionMatrix.html) ```tsx -(near: number, far: number) => Float32Array +(near: number, far: number) => Float32Array ``` | 参数 | 类型 | 说明 | diff --git a/docs/apis/ai/visionkit/VKFrame.md b/docs/apis/ai/visionkit/VKFrame.md index d9ae075d9603..bf40e8ffbd9e 100644 --- a/docs/apis/ai/visionkit/VKFrame.md +++ b/docs/apis/ai/visionkit/VKFrame.md @@ -60,7 +60,7 @@ vision kit 会话对象 > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ai/visionkit/VKFrame.getDisplayTransform.html) ```tsx -() => Float32Array +() => Float32Array ``` ## 参数 diff --git a/docs/apis/ai/visionkit/VKMarkerAnchor.md b/docs/apis/ai/visionkit/VKMarkerAnchor.md index dcf1a20a161e..d62dfce73409 100644 --- a/docs/apis/ai/visionkit/VKMarkerAnchor.md +++ b/docs/apis/ai/visionkit/VKMarkerAnchor.md @@ -15,7 +15,7 @@ marker anchor | --- | --- | --- | | id | `number` | 唯一标识 | | type | `1` | 类型 | -| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | +| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | | markerId | `number` | marker id | | path | `string` | 图片路径 | diff --git a/docs/apis/ai/visionkit/VKPlaneAnchor.md b/docs/apis/ai/visionkit/VKPlaneAnchor.md index 70fcb21498e1..6497ae011a5d 100644 --- a/docs/apis/ai/visionkit/VKPlaneAnchor.md +++ b/docs/apis/ai/visionkit/VKPlaneAnchor.md @@ -15,7 +15,7 @@ sidebar_label: VKPlaneAnchor | --- | --- | --- | | id | `number` | 唯一标识 | | type | `0` | 类型 | -| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | +| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | | size | `ISize` | 尺寸 | | alignment | `number` | 方向 | diff --git a/docs/apis/ai/visionkit/VKSession.md b/docs/apis/ai/visionkit/VKSession.md index e06e8549f380..c2d883f9e762 100644 --- a/docs/apis/ai/visionkit/VKSession.md +++ b/docs/apis/ai/visionkit/VKSession.md @@ -618,7 +618,7 @@ hitTest 检测结果 | 参数 | 类型 | 说明 | | --- | --- | --- | -| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | +| transform | `Float32Array` | 包含位置、旋转、放缩信息的矩阵,以列为主序 | ### IStartStatus diff --git a/docs/apis/canvas/ImageData.md b/docs/apis/canvas/ImageData.md index aa0c7ed37e33..0cfb49f1dff7 100644 --- a/docs/apis/canvas/ImageData.md +++ b/docs/apis/canvas/ImageData.md @@ -15,7 +15,7 @@ ImageData 对象 | --- | --- | --- | | width | `number` | 使用像素描述 ImageData 的实际宽度 | | height | `number` | 使用像素描述 ImageData 的实际高度 | -| data | `Uint8ClampedArray` | 一维数组,包含以 RGBA 顺序的数据,数据使用 0 至 255(包含)的整数表示 | +| data | `Uint8ClampedArray` | 一维数组,包含以 RGBA 顺序的数据,数据使用 0 至 255(包含)的整数表示 | ## API 支持度 diff --git a/docs/apis/canvas/canvasGetImageData.md b/docs/apis/canvas/canvasGetImageData.md index 885c643f5bd1..a793c9894dd3 100644 --- a/docs/apis/canvas/canvasGetImageData.md +++ b/docs/apis/canvas/canvasGetImageData.md @@ -39,7 +39,7 @@ sidebar_label: canvasGetImageData | 参数 | 类型 | 说明 | | --- | --- | --- | -| data | `Uint8ClampedArray` | 图像像素点数据,一维数组,每四项表示一个像素点的 rgba | +| data | `Uint8ClampedArray` | 图像像素点数据,一维数组,每四项表示一个像素点的 rgba | | height | `number` | 图像数据矩形的高度 | | width | `number` | 图像数据矩形的宽度 | | errMsg | `string` | 调用结果 | diff --git a/docs/apis/canvas/canvasPutImageData.md b/docs/apis/canvas/canvasPutImageData.md index b01b65ee23ab..1e77805ffad7 100644 --- a/docs/apis/canvas/canvasPutImageData.md +++ b/docs/apis/canvas/canvasPutImageData.md @@ -27,7 +27,7 @@ sidebar_label: canvasPutImageData | 参数 | 类型 | 必填 | 说明 | | --- | --- | :---: | --- | | canvasId | `string` | 是 | 画布标识,传入 [canvas](/docs/components/canvas) 组件的 canvas-id 属性。 | -| data | `Uint8ClampedArray` | 是 | 图像像素点数据,一维数组,每四项表示一个像素点的 rgba | +| data | `Uint8ClampedArray` | 是 | 图像像素点数据,一维数组,每四项表示一个像素点的 rgba | | height | `number` | 是 | 源图像数据矩形区域的高度 | | width | `number` | 是 | 源图像数据矩形区域的宽度 | | x | `number` | 是 | 源图像数据在目标画布中的位置偏移量(x 轴方向的偏移量) | diff --git a/docs/apis/canvas/createCanvasContext.md b/docs/apis/canvas/createCanvasContext.md index 5b7b30b00fca..c6e3e61eab54 100644 --- a/docs/apis/canvas/createCanvasContext.md +++ b/docs/apis/canvas/createCanvasContext.md @@ -7,7 +7,7 @@ sidebar_label: createCanvasContext **Tip**: 需要指定 canvasId,该绘图上下文只作用于对应的 ``;另外,Web 端需要在 `useReady` 回调中执行它,否则会因为底层 canvas 渲染出来之前而去获取 CanvasContext,导致其底层的 context 为 `undefined`,从而不能正常绘图。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.createCanvasContext.html) diff --git a/docs/apis/cloud/cloud.md b/docs/apis/cloud/cloud.md index e68999838538..1b7760afab3f 100644 --- a/docs/apis/cloud/cloud.md +++ b/docs/apis/cloud/cloud.md @@ -536,6 +536,7 @@ const r = await c1.callContainer({ | 参数 | 类型 | 必填 | 说明 | | --- | --- | :---: | --- | +| config | `{ env: string; }` | 否 | | | path | `string` | 是 | 服务路径 | | method | string or number or symbol | 否 | HTTP请求方法,默认 GET | | data | `P` | 否 | 请求数据 | diff --git a/docs/apis/device/keyboard/hideKeyboard.md b/docs/apis/device/keyboard/hideKeyboard.md index a5c1f8293766..aaf1df8a3c92 100644 --- a/docs/apis/device/keyboard/hideKeyboard.md +++ b/docs/apis/device/keyboard/hideKeyboard.md @@ -5,7 +5,7 @@ sidebar_label: hideKeyboard 在input、textarea等focus拉起键盘之后,手动调用此接口收起键盘 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/keyboard/wx.hideKeyboard.html) diff --git a/docs/apis/device/memory/offMemoryWarning.md b/docs/apis/device/memory/offMemoryWarning.md index dd306b72d141..34831c810229 100644 --- a/docs/apis/device/memory/offMemoryWarning.md +++ b/docs/apis/device/memory/offMemoryWarning.md @@ -5,7 +5,7 @@ sidebar_label: offMemoryWarning 取消监听内存不足告警事件。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/memory/wx.offMemoryWarning.html) diff --git a/docs/apis/device/memory/onMemoryWarning.md b/docs/apis/device/memory/onMemoryWarning.md index 4b26c24f3857..c02486b61bf2 100644 --- a/docs/apis/device/memory/onMemoryWarning.md +++ b/docs/apis/device/memory/onMemoryWarning.md @@ -7,7 +7,7 @@ sidebar_label: onMemoryWarning 当 iOS/Android 向小程序进程发出内存警告时,触发该事件。触发该事件不意味小程序被杀,大部分情况下仅仅是告警,开发者可在收到通知后回收一些不必要资源避免进一步加剧内存紧张。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/device/performance/wx.onMemoryWarning.html) diff --git a/docs/apis/files/getFileSystemManager.md b/docs/apis/files/getFileSystemManager.md index bf468ca2aee2..8c38110a6ac6 100644 --- a/docs/apis/files/getFileSystemManager.md +++ b/docs/apis/files/getFileSystemManager.md @@ -5,7 +5,7 @@ sidebar_label: getFileSystemManager 获取全局唯一的文件管理器 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getFileSystemManager.html) diff --git a/docs/apis/location/getLocation.md b/docs/apis/location/getLocation.md index e828bf6854e3..5665bbcc53d9 100644 --- a/docs/apis/location/getLocation.md +++ b/docs/apis/location/getLocation.md @@ -9,7 +9,7 @@ sidebar_label: getLocation - 工具中定位模拟使用IP定位,可能会有一定误差。且工具目前仅支持 gcj02 坐标。 - 使用第三方服务进行逆地址解析时,请确认第三方服务默认的坐标系,正确进行坐标转换。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/location/wx.getLocation.html) diff --git a/docs/apis/media/audio/AudioBuffer.md b/docs/apis/media/audio/AudioBuffer.md index dbcc20325370..334e778f1c65 100644 --- a/docs/apis/media/audio/AudioBuffer.md +++ b/docs/apis/media/audio/AudioBuffer.md @@ -27,7 +27,7 @@ AudioBuffer 接口表示存在内存里的一段短小的音频资源,利用 [ > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.getChannelData.html) ```tsx -(channel: number) => Float32Array +(channel: number) => Float32Array ``` | 参数 | 类型 | @@ -86,12 +86,12 @@ for (let channel = 0; channel < channels; channel++) { > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/AudioBuffer.copyToChannel.html) ```tsx -(source: Float32Array, channelNumber: number, startInChannel: number) => void +(source: Float32Array, channelNumber: number, startInChannel: number) => void ``` | 参数 | 类型 | 说明 | | --- | --- | --- | -| source | `Float32Array` | 需要复制的源数组 | +| source | `Float32Array` | 需要复制的源数组 | | channelNumber | `number` | 需要复制到的目的通道号 | | startInChannel | `number` | 复制偏移数据量 | diff --git a/docs/apis/media/audio/WebAudioContext.md b/docs/apis/media/audio/WebAudioContext.md index c81ae17f9365..18196d8c6636 100644 --- a/docs/apis/media/audio/WebAudioContext.md +++ b/docs/apis/media/audio/WebAudioContext.md @@ -187,13 +187,13 @@ const waveNode = audioContext.createPeriodicWave(real, imag, {disableNormalizati > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.createPeriodicWave.html) ```tsx -(real: Float32Array, imag: Float32Array, constraints: Constraints) => PeriodicWave +(real: Float32Array, imag: Float32Array, constraints: Constraints) => PeriodicWave ``` | 参数 | 类型 | 说明 | | --- | --- | --- | -| real | `Float32Array` | 一组余弦项(传统上是A项) | -| imag | `Float32Array` | 一组余弦项(传统上是A项) | +| real | `Float32Array` | 一组余弦项(传统上是A项) | +| imag | `Float32Array` | 一组余弦项(传统上是A项) | | constraints | `Constraints` | 一个字典对象,它指定是否应该禁用规范化(默认启用规范化) | ### createBiquadFilter @@ -373,9 +373,15 @@ const myArrayBuffer = audioCtx.createBuffer(channels, frameCount, audioCtx.sampl > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.decodeAudioData.html) ```tsx -() => AudioBuffer +(audioData: ArrayBuffer, successCallback: (buffer: AudioBuffer) => void, errorCallback: (error: any) => void) => Promise ``` +| 参数 | 类型 | +| --- | --- | +| audioData | `ArrayBuffer` | +| successCallback | `(buffer: AudioBuffer) => void` | +| errorCallback | `(error: any) => void` | + #### 示例代码 ```tsx diff --git a/docs/apis/media/video/chooseMedia.md b/docs/apis/media/video/chooseMedia.md index 4e57236ee04b..397bfafab5bd 100644 --- a/docs/apis/media/video/chooseMedia.md +++ b/docs/apis/media/video/chooseMedia.md @@ -5,7 +5,7 @@ sidebar_label: chooseMedia 拍摄或从手机相册中选择图片或视频。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseMedia.html) diff --git a/docs/apis/media/video/createVideoContext.md b/docs/apis/media/video/createVideoContext.md index 4f82d2e7ad1f..bc1eec7918d0 100644 --- a/docs/apis/media/video/createVideoContext.md +++ b/docs/apis/media/video/createVideoContext.md @@ -5,7 +5,7 @@ sidebar_label: createVideoContext 创建 video 上下文 VideoContext 对象。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.createVideoContext.html) diff --git a/docs/apis/network/download/downloadFile.md b/docs/apis/network/download/downloadFile.md index 954e614ac36d..287a3024393f 100644 --- a/docs/apis/network/download/downloadFile.md +++ b/docs/apis/network/download/downloadFile.md @@ -7,7 +7,7 @@ sidebar_label: downloadFile 注意:请在服务端响应的 header 中指定合理的 `Content-Type` 字段,以保证客户端正确处理文件类型。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/network/download/wx.downloadFile.html) diff --git a/docs/apis/network/request/request.md b/docs/apis/network/request/request.md index 12c6d5a272d4..79441ba3fb3a 100644 --- a/docs/apis/network/request/request.md +++ b/docs/apis/network/request/request.md @@ -49,7 +49,7 @@ sidebar_label: request | referrerStrategy | `keyof ReferrerStrategy` | `"querystring"` | 否 | referer 策略,用于控制当前请求 header 对象中 referer 字段格式。该参数默认值可通过 app.json 中的配置进行修改。
API 支持度: alipay 支付宝: 10.3.50+ APPX: 2.8.7 开发者工具: 3.5.1
[参考地址](https://opendocs.alipay.com/mini/api/owycmh#referrerStrategy%20%E5%8F%82%E6%95%B0%E8%AF%B4%E6%98%8E) | | success | `(result: SuccessCallbackResult) => void` | | 否 | 接口调用成功的回调函数 | | fail | `(res: TaroGeneral.CallbackResult) => void` | | 否 | 接口调用失败的回调函数 | -| complete | `(res: Partial & TaroGeneral.CallbackResult) => void` | | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | +| complete | `(res: any) => void` | | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) | | jsonp | string or boolean | `false` | 否 | 设置是否使用 jsonp 方式获取数据
API 支持度: h5 | | jsonpCache | `RequestCache` | | 否 | 设置 jsonp 请求 url 是否需要被缓存
API 支持度: h5 | | mode | `keyof CorsMode` | `"same-origin"` | 否 | 设置是否允许跨域请求
API 支持度: h5 | diff --git a/docs/apis/network/upload/uploadFile.md b/docs/apis/network/upload/uploadFile.md index 265675879225..6fc2e1486213 100644 --- a/docs/apis/network/upload/uploadFile.md +++ b/docs/apis/network/upload/uploadFile.md @@ -5,7 +5,7 @@ sidebar_label: uploadFile 将本地资源上传到服务器。客户端发起一个 HTTPS POST 请求,其中 `content-type` 为 `multipart/form-data`。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/network/upload/wx.uploadFile.html) diff --git a/docs/apis/route/switchTab.md b/docs/apis/route/switchTab.md index ef0a84ac3bc8..50d43c1f9af7 100644 --- a/docs/apis/route/switchTab.md +++ b/docs/apis/route/switchTab.md @@ -5,7 +5,7 @@ sidebar_label: switchTab 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.switchTab.html) diff --git a/docs/apis/storage/clearStorage.md b/docs/apis/storage/clearStorage.md index fdc20d668ceb..d29b2ed4a6ac 100644 --- a/docs/apis/storage/clearStorage.md +++ b/docs/apis/storage/clearStorage.md @@ -5,7 +5,7 @@ sidebar_label: clearStorage 清理本地数据缓存 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/storage/wx.clearStorage.html) diff --git a/docs/apis/taro.hooks/useLoad.md b/docs/apis/taro.hooks/useLoad.md index 1a1cb2b7d70b..baf5cae68834 100644 --- a/docs/apis/taro.hooks/useLoad.md +++ b/docs/apis/taro.hooks/useLoad.md @@ -5,7 +5,7 @@ sidebar_label: useLoad 页面加载完成时的回调。 -支持情况: +支持情况: ## 类型 diff --git a/docs/apis/taro.hooks/useReady.md b/docs/apis/taro.hooks/useReady.md index cdcb37d660ac..91fd1dad5691 100644 --- a/docs/apis/taro.hooks/useReady.md +++ b/docs/apis/taro.hooks/useReady.md @@ -6,7 +6,7 @@ sidebar_label: useReady 页面初次渲染完成的回调。 此时页面已经准备妥当,可以和视图层进行交互。 -支持情况: +支持情况: ## 类型 diff --git a/docs/apis/taro.hooks/useUnload.md b/docs/apis/taro.hooks/useUnload.md index b3c405a2274e..866fb69fbef2 100644 --- a/docs/apis/taro.hooks/useUnload.md +++ b/docs/apis/taro.hooks/useUnload.md @@ -5,7 +5,7 @@ sidebar_label: useUnload 页面卸载时的回调。 -支持情况: +支持情况: ## 类型 diff --git a/docs/apis/ui/tab-bar/hideTabBar.md b/docs/apis/ui/tab-bar/hideTabBar.md index 082adce21453..c4458ca65f1f 100644 --- a/docs/apis/ui/tab-bar/hideTabBar.md +++ b/docs/apis/ui/tab-bar/hideTabBar.md @@ -5,7 +5,7 @@ sidebar_label: hideTabBar 隐藏 tabBar -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBar.html) diff --git a/docs/apis/ui/tab-bar/hideTabBarRedDot.md b/docs/apis/ui/tab-bar/hideTabBarRedDot.md index 6808c96d0b48..2c3da47bc628 100644 --- a/docs/apis/ui/tab-bar/hideTabBarRedDot.md +++ b/docs/apis/ui/tab-bar/hideTabBarRedDot.md @@ -5,7 +5,7 @@ sidebar_label: hideTabBarRedDot 隐藏 tabBar 某一项的右上角的红点 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBarRedDot.html) diff --git a/docs/apis/ui/tab-bar/removeTabBarBadge.md b/docs/apis/ui/tab-bar/removeTabBarBadge.md index c53a609bedbe..d2b2a511a5ec 100644 --- a/docs/apis/ui/tab-bar/removeTabBarBadge.md +++ b/docs/apis/ui/tab-bar/removeTabBarBadge.md @@ -5,7 +5,7 @@ sidebar_label: removeTabBarBadge 移除 tabBar 某一项右上角的文本 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.removeTabBarBadge.html) diff --git a/docs/apis/ui/tab-bar/setTabBarBadge.md b/docs/apis/ui/tab-bar/setTabBarBadge.md index 7657d46f1a20..42e6a987897d 100644 --- a/docs/apis/ui/tab-bar/setTabBarBadge.md +++ b/docs/apis/ui/tab-bar/setTabBarBadge.md @@ -5,7 +5,7 @@ sidebar_label: setTabBarBadge 为 tabBar 某一项的右上角添加文本 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.setTabBarBadge.html) diff --git a/docs/apis/ui/tab-bar/setTabBarItem.md b/docs/apis/ui/tab-bar/setTabBarItem.md index f6468184a7d2..220a6fe129f1 100644 --- a/docs/apis/ui/tab-bar/setTabBarItem.md +++ b/docs/apis/ui/tab-bar/setTabBarItem.md @@ -5,7 +5,7 @@ sidebar_label: setTabBarItem 动态设置 tabBar 某一项的内容,`2.7.0` 起图片支持临时文件和网络文件。 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.setTabBarItem.html) diff --git a/docs/apis/ui/tab-bar/showTabBar.md b/docs/apis/ui/tab-bar/showTabBar.md index 471a9d0ab7a6..924986a4e527 100644 --- a/docs/apis/ui/tab-bar/showTabBar.md +++ b/docs/apis/ui/tab-bar/showTabBar.md @@ -5,7 +5,7 @@ sidebar_label: showTabBar 显示 tabBar -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBar.html) diff --git a/docs/apis/ui/tab-bar/showTabBarRedDot.md b/docs/apis/ui/tab-bar/showTabBarRedDot.md index c557074d71f3..508dcd472fbb 100644 --- a/docs/apis/ui/tab-bar/showTabBarRedDot.md +++ b/docs/apis/ui/tab-bar/showTabBarRedDot.md @@ -5,7 +5,7 @@ sidebar_label: showTabBarRedDot 显示 tabBar 某一项的右上角的红点 -支持情况: +支持情况: > [参考文档](https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBarRedDot.html) diff --git a/docs/components/forms/textarea.md b/docs/components/forms/textarea.md index f90baaa676f3..940fc447acce 100755 --- a/docs/components/forms/textarea.md +++ b/docs/components/forms/textarea.md @@ -90,7 +90,7 @@ export default class PageView extends Component { | showCount | `boolean` | `true` | 否 | 是否渲染字数统计功能(是否删除默认计数器/是否显示字数统计)。 | | controlled | `boolean` | `false` | 否 | 是否为受控组件。为 true 时,value 内容会完全受 setData 控制。 | | ariaLabel | `string` | | 否 | 无障碍访问,(属性)元素的额外描述 | -| adjustKeyboardTo | `boolean` | `false` | 否 | 键盘对齐位置 | +| adjustKeyboardTo | "cursor" or "bottom" | `'cursor'` | 否 | 键盘对齐位置 | | onFocus | `CommonEventFunction` | | 否 | 输入框聚焦时触发 | | onBlur | `CommonEventFunction` | | 否 | 输入框失去焦点时触发 | | onLineChange | `CommonEventFunction` | | 否 | 输入框行数变化时调用 | diff --git a/docs/components/list-item.md b/docs/components/list-item.md new file mode 100644 index 000000000000..3baaf4676730 --- /dev/null +++ b/docs/components/list-item.md @@ -0,0 +1,10 @@ +--- +title: ListItem +sidebar_label: ListItem +--- + +## 类型 + +```tsx +ComponentType +``` diff --git a/docs/components/list.md b/docs/components/list.md new file mode 100644 index 000000000000..266e8dd892ae --- /dev/null +++ b/docs/components/list.md @@ -0,0 +1,24 @@ +--- +title: List +sidebar_label: List +--- + +## 类型 + +```tsx +ComponentType> +``` + +## ListProps + +| 参数 | 类型 | 默认值 | 必填 | 说明 | +| --- | --- | :---: | :---: | --- | +| upperThresholdCount | `number` | `50` | 否 | 距顶部/左边多远时(单位px),触发 scrolltoupper 事件 | +| lowerThresholdCount | `number` | `50` | 否 | 距底部/右边多远时(单位px),触发 scrolltolower 事件 | + +### API 支持度 + +| API | 微信小程序 | 百度小程序 | 支付宝小程序 | 抖音小程序 | QQ 小程序 | 京东小程序 | H5 | React Native | Harmony | Harmony hybrid | +| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | +| ListProps.upperThresholdCount | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | +| ListProps.lowerThresholdCount | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | ✔️ | diff --git a/packages/taro-components/types/List.d.ts b/packages/taro-components/types/List.d.ts new file mode 100644 index 000000000000..a2663909f600 --- /dev/null +++ b/packages/taro-components/types/List.d.ts @@ -0,0 +1,38 @@ +import type { ComponentType, PropsWithChildren } from 'react' +import type { ListBuilderProps } from './ListBuilder' +import type { ScrollViewProps } from './ScrollView' +import type { StandardProps } from './common' + +interface ListProps + extends Pick< + ScrollViewProps, + | 'scrollX' + | 'scrollY' + | 'scrollTop' + | 'scrollIntoView' + | 'enableBackToTop' + | 'showScrollbar' + | 'onScroll' + | 'onScrollStart' + | 'onScrollEnd' + | 'onScrollToUpper' + | 'onScrollToLower' + | 'cacheExtent' + >, + Omit, + Pick { + /** 距顶部/左边多远时(单位px),触发 scrolltoupper 事件 + * @default 50 + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + */ + upperThresholdCount?: number + /** 距底部/右边多远时(单位px),触发 scrolltolower 事件 + * @default 50 + * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid + */ + lowerThresholdCount?: number +} + +declare const List: ComponentType> + +export { List, ListProps } diff --git a/packages/taro-components/types/ListItem.d.ts b/packages/taro-components/types/ListItem.d.ts new file mode 100644 index 000000000000..eaa65742b287 --- /dev/null +++ b/packages/taro-components/types/ListItem.d.ts @@ -0,0 +1,6 @@ +import type { ComponentType, Key, PropsWithChildren } from 'react' +import type { ViewProps } from './View' + +declare const ListItem: ComponentType> + +export { ListItem } diff --git a/packages/taro-components/types/Textarea.d.ts b/packages/taro-components/types/Textarea.d.ts index a70e745b580e..139e0edc7ac4 100644 --- a/packages/taro-components/types/Textarea.d.ts +++ b/packages/taro-components/types/Textarea.d.ts @@ -125,9 +125,9 @@ interface TextareaProps extends StandardProps, FormItemProps { ariaLabel?: string /** 键盘对齐位置 * @supported weapp - * @default false + * @default 'cursor' */ - adjustKeyboardTo?: boolean + adjustKeyboardTo?: 'cursor' | 'bottom' /** 输入框聚焦时触发 * @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony, harmony_hybrid */ diff --git a/packages/taro-components/types/index.d.ts b/packages/taro-components/types/index.d.ts index 3405a60a4573..f848253df038 100644 --- a/packages/taro-components/types/index.d.ts +++ b/packages/taro-components/types/index.d.ts @@ -63,6 +63,8 @@ export { OpenContainer } from './OpenContainer' export { DraggableSheet } from './DraggableSheet' export { NestedScrollHeader } from './NestedScrollHeader' export { NestedScrollBody } from './NestedScrollBody' +export { List } from './List' +export { ListItem } from './ListItem' /** 导航 */ export { FunctionalPageNavigator } from './FunctionalPageNavigator' diff --git a/packages/taro/types/api/canvas/index.d.ts b/packages/taro/types/api/canvas/index.d.ts index 99ea3407615e..df65774034ad 100644 --- a/packages/taro/types/api/canvas/index.d.ts +++ b/packages/taro/types/api/canvas/index.d.ts @@ -2048,7 +2048,7 @@ declare module '../../index' { /** 创建 canvas 的绘图上下文 [CanvasContext](/docs/apis/canvas/CanvasContext) 对象 * * **Tip**: 需要指定 canvasId,该绘图上下文只作用于对应的 ``;另外,Web 端需要在 `useReady` 回调中执行它,否则会因为底层 canvas 渲染出来之前而去获取 CanvasContext,导致其底层的 context 为 `undefined`,从而不能正常绘图。 - * @supported weapp, alipay, swan, jd, qq, tt, h5, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, harmony_hybrid, harmony * @example * ```tsx * import { useReady } from '@tarojs/taro' diff --git a/packages/taro/types/api/cloud/index.d.ts b/packages/taro/types/api/cloud/index.d.ts index 16b37f586696..df076bdbc8f9 100644 --- a/packages/taro/types/api/cloud/index.d.ts +++ b/packages/taro/types/api/cloud/index.d.ts @@ -1,4 +1,4 @@ -import Taro, { DownloadTask, UploadTask } from "../../index" +import Taro from "../../index" declare module '../../index' { namespace cloud { @@ -212,6 +212,10 @@ declare module '../../index' { /** 调用云托管参数 */ interface CallContainerParam < P extends string | TaroGeneral.IAnyObject | ArrayBuffer = any | any > { + config?:{ + /** 微信云托管的环境ID, 如果在 Taro.cloud.init 中配置了env, 则可以不配置。 */ + env: string, + } /** 服务路径 */ path: string /** HTTP请求方法,默认 GET */ diff --git a/packages/taro/types/api/device/keyboard.d.ts b/packages/taro/types/api/device/keyboard.d.ts index bf6f1bbae5f9..12b80ab1a5e3 100644 --- a/packages/taro/types/api/device/keyboard.d.ts +++ b/packages/taro/types/api/device/keyboard.d.ts @@ -43,7 +43,7 @@ declare module '../../index' { interface TaroStatic { /** 在input、textarea等focus拉起键盘之后,手动调用此接口收起键盘 - * @supported weapp, alipay, swan, jd, tt, rn, harmony_hybrid + * @supported weapp, alipay, swan, jd, tt, rn, harmony_hybrid, harmony * @example * ```tsx * Taro.hideKeyboard({ diff --git a/packages/taro/types/api/device/memory.d.ts b/packages/taro/types/api/device/memory.d.ts index 94516403951f..d366723c9dee 100644 --- a/packages/taro/types/api/device/memory.d.ts +++ b/packages/taro/types/api/device/memory.d.ts @@ -26,7 +26,7 @@ declare module '../../index' { /** 监听内存不足告警事件。 * * 当 iOS/Android 向小程序进程发出内存警告时,触发该事件。触发该事件不意味小程序被杀,大部分情况下仅仅是告警,开发者可在收到通知后回收一些不必要资源避免进一步加剧内存紧张。 - * @supported weapp, alipay, swan, jd, tt + * @supported weapp, alipay, swan, jd, tt, harmony * @example * ```tsx * Taro.onMemoryWarning(function () { @@ -41,7 +41,7 @@ declare module '../../index' { ): void /** 取消监听内存不足告警事件。 - * @supported weapp, alipay, swan + * @supported weapp, alipay, swan, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/memory/wx.offMemoryWarning.html */ offMemoryWarning( diff --git a/packages/taro/types/api/files/index.d.ts b/packages/taro/types/api/files/index.d.ts index 8ab00efa1eb0..bf6f74e9617a 100644 --- a/packages/taro/types/api/files/index.d.ts +++ b/packages/taro/types/api/files/index.d.ts @@ -1464,7 +1464,7 @@ declare module '../../index' { getFileInfo(option: getFileInfo.Option): Promise /** 获取全局唯一的文件管理器 - * @supported weapp, alipay, swan, jd, qq, tt, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, harmony_hybrid, harmony * @see https://developers.weixin.qq.com/miniprogram/dev/api/file/wx.getFileSystemManager.html */ getFileSystemManager(): FileSystemManager diff --git a/packages/taro/types/api/location/index.d.ts b/packages/taro/types/api/location/index.d.ts index 9be76e5ab502..cfe35bbc373e 100644 --- a/packages/taro/types/api/location/index.d.ts +++ b/packages/taro/types/api/location/index.d.ts @@ -455,7 +455,7 @@ declare module '../../index' { * **注意** * - 工具中定位模拟使用IP定位,可能会有一定误差。且工具目前仅支持 gcj02 坐标。 * - 使用第三方服务进行逆地址解析时,请确认第三方服务默认的坐标系,正确进行坐标转换。 - * @supported weapp, swan, jd, qq, tt, rn, harmony_hybrid + * @supported weapp, swan, jd, qq, tt, rn, harmony_hybrid, harmony * @example * ```tsx * Taro.getLocation({ diff --git a/packages/taro/types/api/media/audio.d.ts b/packages/taro/types/api/media/audio.d.ts index 0d8eedcac9f0..3a938cc0d168 100644 --- a/packages/taro/types/api/media/audio.d.ts +++ b/packages/taro/types/api/media/audio.d.ts @@ -740,7 +740,11 @@ declare module '../../index' { * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/audio/WebAudioContext.decodeAudioData.html */ - decodeAudioData(): AudioBuffer + decodeAudioData( + audioData: ArrayBuffer, + successCallback: (buffer: AudioBuffer) => void, + errorCallback: (error: any) => void + ): Promise } namespace WebAudioContext { diff --git a/packages/taro/types/api/media/video.d.ts b/packages/taro/types/api/media/video.d.ts index fbf13418c9a4..81dc34fb13b8 100644 --- a/packages/taro/types/api/media/video.d.ts +++ b/packages/taro/types/api/media/video.d.ts @@ -442,7 +442,7 @@ declare module '../../index' { getVideoInfo(option: getVideoInfo.Option): Promise /** 创建 video 上下文 VideoContext 对象。 - * @supported weapp, h5, rn, harmony_hybrid + * @supported weapp, h5, rn, harmony_hybrid, harmony * @example * ```tsx * videoContext = Taro.createVideoContext('myVideo') @@ -505,7 +505,7 @@ declare module '../../index' { chooseVideo(option: chooseVideo.Option): Promise /** 拍摄或从手机相册中选择图片或视频。 - * @supported weapp, h5, harmony_hybrid + * @supported weapp, h5, harmony_hybrid, harmony * @example * ```tsx * Taro.chooseMedia({ diff --git a/packages/taro/types/api/media/voip.d.ts b/packages/taro/types/api/media/voip.d.ts index 1cc1dea97bbb..c37ab2699215 100644 --- a/packages/taro/types/api/media/voip.d.ts +++ b/packages/taro/types/api/media/voip.d.ts @@ -320,7 +320,7 @@ declare module '../../index' { * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.setEnable1v1Chat.html */ - setEnable1v1Chat(option: subscribeVoIPVideoMembers.Option): Promise + setEnable1v1Chat(option: setEnable1v1Chat.Option): Promise /** 监听实时语音通话成员视频状态变化事件 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.onVoIPVideoMembersChanged.html @@ -373,7 +373,7 @@ declare module '../../index' { */ offVoIPChatInterrupted(callback: onVoIPChatInterrupted.Callback): void /** 加入 (创建) 实时语音通话,更多信息可见 [实时语音指南](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/voip-chat.html) - * + * * 调用前需要用户授权 `scope.record`,若房间类型为视频房间需要用户授权 `scope.camera`。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/media/voip/wx.joinVoIPChat.html diff --git a/packages/taro/types/api/network/download.d.ts b/packages/taro/types/api/network/download.d.ts index 1fbd846ee5be..77d91ce333d1 100644 --- a/packages/taro/types/api/network/download.d.ts +++ b/packages/taro/types/api/network/download.d.ts @@ -151,7 +151,7 @@ declare module '../../index' { /** 下载文件资源到本地。客户端直接发起一个 HTTPS GET 请求,返回文件的本地临时路径,单次下载允许的最大文件为 50MB。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 * * 注意:请在服务端响应的 header 中指定合理的 `Content-Type` 字段,以保证客户端正确处理文件类型。 - * @supported weapp, h5, alipay, swan, rn, tt, harmony_hybrid + * @supported weapp, h5, alipay, swan, rn, tt, harmony_hybrid, harmony * @example * ```tsx * Taro.downloadFile({ diff --git a/packages/taro/types/api/network/upload.d.ts b/packages/taro/types/api/network/upload.d.ts index 4fa7167d7cd6..8794c86d81a6 100644 --- a/packages/taro/types/api/network/upload.d.ts +++ b/packages/taro/types/api/network/upload.d.ts @@ -152,7 +152,7 @@ declare module '../../index' { interface TaroStatic { /** 将本地资源上传到服务器。客户端发起一个 HTTPS POST 请求,其中 `content-type` 为 `multipart/form-data`。使用前请注意阅读[相关说明](https://developers.weixin.qq.com/miniprogram/dev/framework/ability/network.html)。 - * @supported weapp, swan, alipay, h5, rn, tt, harmony_hybrid + * @supported weapp, swan, alipay, h5, rn, tt, harmony_hybrid, harmony * @example * ```tsx * Taro.chooseImage({ diff --git a/packages/taro/types/api/route/index.d.ts b/packages/taro/types/api/route/index.d.ts index 8bc89d4b8b42..c2d1bec63830 100644 --- a/packages/taro/types/api/route/index.d.ts +++ b/packages/taro/types/api/route/index.d.ts @@ -220,7 +220,7 @@ declare module '../../index' { interface TaroStatic { /** 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```json * { diff --git a/packages/taro/types/api/storage/index.d.ts b/packages/taro/types/api/storage/index.d.ts index 120b4227e090..ad1ae1d8b168 100644 --- a/packages/taro/types/api/storage/index.d.ts +++ b/packages/taro/types/api/storage/index.d.ts @@ -327,7 +327,7 @@ declare module '../../index' { clearStorageSync(): void /** 清理本地数据缓存 - * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony, harmony_hybrid + * @supported weapp, alipay, swan, jd, qq, tt, h5, rn, harmony_hybrid * @example * ```tsx * Taro.clearStorage() diff --git a/packages/taro/types/api/taro.hooks.d.ts b/packages/taro/types/api/taro.hooks.d.ts index 6b07e06c7978..b55c8e0ddd25 100644 --- a/packages/taro/types/api/taro.hooks.d.ts +++ b/packages/taro/types/api/taro.hooks.d.ts @@ -98,20 +98,20 @@ declare module '../index' { /** * 页面加载完成时的回调。 - * @supported weapp, h5, harmony_hybrid + * @supported weapp, h5, harmony_hybrid, harmony */ useLoad>(callback: (param: T) => void): void /** * 页面卸载时的回调。 - * @supported weapp, h5, harmony_hybrid + * @supported weapp, h5, harmony_hybrid, harmony */ useUnload(callback: () => void): void /** * 页面初次渲染完成的回调。 * 此时页面已经准备妥当,可以和视图层进行交互。 - * @supported weapp, h5, harmony_hybrid + * @supported weapp, h5, harmony_hybrid, harmony */ useReady(callback: () => void): void diff --git a/packages/taro/types/api/ui/tab-bar.d.ts b/packages/taro/types/api/ui/tab-bar.d.ts index 57e3be1292b6..afca2e227aa8 100644 --- a/packages/taro/types/api/ui/tab-bar.d.ts +++ b/packages/taro/types/api/ui/tab-bar.d.ts @@ -121,13 +121,13 @@ declare module '../../index' { interface TaroStatic { /** 显示 tabBar 某一项的右上角的红点 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBarRedDot.html */ showTabBarRedDot(option: showTabBarRedDot.Option): Promise /** 显示 tabBar - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.showTabBar.html */ showTabBar(option?: showTabBar.Option): Promise @@ -148,7 +148,7 @@ declare module '../../index' { setTabBarStyle(option?: setTabBarStyle.Option): Promise /** 动态设置 tabBar 某一项的内容,`2.7.0` 起图片支持临时文件和网络文件。 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.setTabBarItem({ @@ -163,7 +163,7 @@ declare module '../../index' { setTabBarItem(option: setTabBarItem.Option): Promise /** 为 tabBar 某一项的右上角添加文本 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @example * ```tsx * Taro.setTabBarBadge({ @@ -176,19 +176,19 @@ declare module '../../index' { setTabBarBadge(option: setTabBarBadge.Option): Promise /** 移除 tabBar 某一项右上角的文本 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.removeTabBarBadge.html */ removeTabBarBadge(option: removeTabBarBadge.Option): Promise /** 隐藏 tabBar 某一项的右上角的红点 - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBarRedDot.html */ hideTabBarRedDot(option: hideTabBarRedDot.Option): Promise /** 隐藏 tabBar - * @supported weapp, h5, rn, tt, harmony, harmony_hybrid + * @supported weapp, h5, rn, tt, harmony_hybrid * @see https://developers.weixin.qq.com/miniprogram/dev/api/ui/tab-bar/wx.hideTabBar.html */ hideTabBar(option?: hideTabBar.Option): Promise diff --git a/packages/taro/types/compile/config/h5.d.ts b/packages/taro/types/compile/config/h5.d.ts index 088d4164c5c1..d0fb0ee7f538 100644 --- a/packages/taro/types/compile/config/h5.d.ts +++ b/packages/taro/types/compile/config/h5.d.ts @@ -119,8 +119,9 @@ export interface IH5Config { /** Web 编译过程的相关配置 */ compile?: { - exclude?: (string | RegExp)[] - include?: (string | RegExp)[] + exclude?: any[] + include?: any[] + /** 对应 @rollup/plugin-babel 插件的 filter 配置。只在 vite 编译模式下有效 */ filter?: (filename: string) => boolean } /** 生成的代码是否要兼容旧版浏览器,值为 true 时,会去读取 package.json 的 browserslist 字段。只在 vite 编译模式下有效 */ diff --git a/packages/taro/types/compile/config/mini.d.ts b/packages/taro/types/compile/config/mini.d.ts index 4bc69cc634c8..d7514669e3bf 100644 --- a/packages/taro/types/compile/config/mini.d.ts +++ b/packages/taro/types/compile/config/mini.d.ts @@ -91,8 +91,9 @@ export interface IMiniAppConfig /** 小程序编译过程的相关配置 */ compile?: { - exclude?: (string | RegExp)[] - include?: (string | RegExp)[] + exclude?: any[] + include?: any[] + /** 对应 @rollup/plugin-babel 插件的 filter 配置。只在 vite 编译模式下有效 */ filter?: (filename: string) => boolean } diff --git a/packages/taro/types/compile/viteCompilerContext.d.ts b/packages/taro/types/compile/viteCompilerContext.d.ts index 48f11ede8203..4513b36b54b1 100644 --- a/packages/taro/types/compile/viteCompilerContext.d.ts +++ b/packages/taro/types/compile/viteCompilerContext.d.ts @@ -9,6 +9,7 @@ import type { AppConfig, PageConfig } from '../index' export interface ViteNativeCompMeta { name: string + exportName: string scriptPath: string configPath: string config: PageConfig @@ -16,6 +17,7 @@ export interface ViteNativeCompMeta { templatePath: string cssPath?: string isPackage?: boolean + isGenerated?: boolean } export interface ViteFileType { @@ -57,6 +59,7 @@ export interface ViteHarmonyBuildConfig extends CommonBuildConfig, IHarmonyConfi runtimePath?: string | string[] isPure?: boolean taroComponentsPath: string + cssVariables?: boolean // 是否动态解析css变量 } export interface CommonBuildConfig extends IProjectConfig<'vite'> { @@ -109,6 +112,7 @@ export interface ViteCompilerContext { configFileList: string[] compilePage: (pageName: string) => VitePageMeta watchConfigFile: (rollupCtx: PluginContext) => void + collectedDeps: (rollupCtx: PluginContext, id: string, filter, cache: Set = new Set()) => Promise> getAppScriptPath: () => string getApp: () => ViteAppMeta getPages: () => VitePageMeta[] @@ -140,7 +144,9 @@ export interface ViteHarmonyCompilerContext extends ViteCompilerContext string[] modifyHarmonyConfig: (config: Partial) => void modifyHostPackage: (deps?: Record, devDeps?: Record) => Exclude - collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => void + resolvePageImportPath: (scriptPath: string, pageName: string) => string + collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => ViteNativeCompMeta[] + generateNativeComponent: (rollupCtx: PluginContext, meta: ViteNativeCompMeta, implicitlyLoadedAfterOneOf: string[] = []) => void getScriptPath: (filePath: string) => string getStylePath: (filePath: string) => string getConfigPath: (filePath: string) => string @@ -151,7 +157,9 @@ export interface ViteMiniCompilerContext extends ViteCompilerContext getCommonChunks: () => string[] - collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => void + resolvePageImportPath: (scriptPath: string, pageName: string) => string + collectNativeComponents: (meta: ViteAppMeta | VitePageMeta | ViteNativeCompMeta) => ViteNativeCompMeta[] + generateNativeComponent: (rollupCtx: PluginContext, meta: ViteNativeCompMeta, implicitlyLoadedAfterOneOf: string[] = []) => void getScriptPath: (filePath: string) => string getTemplatePath: (filePath: string) => string getStylePath: (filePath: string) => string diff --git a/packages/taro/types/index.d.ts b/packages/taro/types/index.d.ts index da8ec8360884..de679c27cfe1 100644 --- a/packages/taro/types/index.d.ts +++ b/packages/taro/types/index.d.ts @@ -192,4 +192,5 @@ declare namespace Taro { declare global { const defineAppConfig: (config: Taro.AppConfig) => Taro.AppConfig const definePageConfig: (config: Taro.PageConfig) => Taro.Config + const importNativeComponent: (path: string, name = '', exportName = 'default') => Awaited } diff --git a/packages/taro/types/taro.config.d.ts b/packages/taro/types/taro.config.d.ts index 1bae7fbde63f..2e948de78331 100644 --- a/packages/taro/types/taro.config.d.ts +++ b/packages/taro/types/taro.config.d.ts @@ -193,7 +193,7 @@ declare module './index' { /** 页面自定义组件配置 * @see https://developers.weixin.qq.com/miniprogram/dev/framework/custom-component/ */ - usingComponents?: Record + usingComponents?: Record /** 指定使用升级后的 weui 样式 * - v2: 可表明启用新版的组件样式 * @default default @@ -581,7 +581,7 @@ declare module './index' { desc: string /** 在该场景下打开小程序时跳转页面 */ path: string - } + }[] /** 定制化型服务商票据 */ serviceProviderTicket?: string /** 半屏小程序 appId */