@tarojs/taro 3.6.15 → 3.6.16-alpha.1

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.6.15",
3
+ "version": "3.6.16-alpha.1",
4
4
  "description": "Taro framework",
5
5
  "homepage": "https://github.com/nervjs/taro/tree/master/packages/taro#readme",
6
6
  "main": "index.js",
@@ -21,11 +21,11 @@
21
21
  "author": "O2Team",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@tarojs/api": "3.6.15",
25
- "@tarojs/runtime": "3.6.15"
24
+ "@tarojs/api": "3.6.16-alpha.1",
25
+ "@tarojs/runtime": "3.6.16-alpha.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@tarojs/helper": "3.6.15"
28
+ "@tarojs/helper": "3.6.16-alpha.1"
29
29
  },
30
30
  "peerDependenciesMeta": {
31
31
  "@types/react": {
@@ -0,0 +1,90 @@
1
+ import Taro from '../../index'
2
+
3
+ declare module '../../index' {
4
+ namespace getPrivacySetting {
5
+ interface Option {
6
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
7
+ complete?: (res: TaroGeneral.CallbackResult) => void;
8
+ /** 接口调用失败的回调函数 */
9
+ fail?: (res: TaroGeneral.CallbackResult) => void;
10
+ /** 接口调用成功的回调函数 */
11
+ success?: (result: SuccessCallbackResult) => void;
12
+ }
13
+ interface SuccessCallbackResult extends TaroGeneral.CallbackResult {
14
+ /** 是否需要用户授权隐私协议(如果开发者没有在[mp后台-设置-服务内容声明-用户隐私保护指引]中声明隐私收集类型则会返回false;如果开发者声明了隐私收集,且用户之前同意过隐私协议则会返回false;如果开发者声明了隐私收集,且用户还没同意过则返回true;如果用户之前同意过、但后来小程序又新增了隐私收集类型也会返回true) */
15
+ needAuthorization: boolean;
16
+ /** 隐私授权协议的名称 */
17
+ privacyContractName: string;
18
+ }
19
+ }
20
+
21
+ namespace requirePrivacyAuthorize {
22
+ interface Option {
23
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
24
+ complete?: (res: TaroGeneral.CallbackResult) => void;
25
+ /** 接口调用失败的回调函数 */
26
+ fail?: (res: TaroGeneral.CallbackResult) => void;
27
+ /** 接口调用成功的回调函数 */
28
+ success?: (result: TaroGeneral.CallbackResult) => void;
29
+ }
30
+ }
31
+
32
+ namespace openPrivacyContract {
33
+ interface Option {
34
+ /** 接口调用结束的回调函数(调用成功、失败都会执行) */
35
+ complete?: (res: TaroGeneral.CallbackResult) => void;
36
+ /** 接口调用失败的回调函数 */
37
+ fail?: (res: TaroGeneral.CallbackResult) => void;
38
+ /** 接口调用成功的回调函数 */
39
+ success?: (result: TaroGeneral.CallbackResult) => void;
40
+ }
41
+ }
42
+
43
+ namespace onNeedPrivacyAuthorization {
44
+ /**
45
+ * resolve 是 onNeedPrivacyAuthorization 的回调参数,是一个接口函数。
46
+ * 当触发 needPrivacyAuthorization 事件时,触发该事件的隐私接口或组件会处于 pending 状态。
47
+ * 如果调用 resolve({ buttonId: 'disagree-btn', event:'agree' }),则触发当前 needPrivacyAuthorization 事件的原隐私接口或组件会继续执行。其中 buttonId 为隐私同意授权按钮的id,为确保用户有同意的操作,基础库会检查对应的同意按钮是否被点击过。
48
+ * 如果调用 resolve({ event: 'disagree' }),则触发当前 needPrivacyAuthorization 事件的原隐私接口或组件会失败并返回 API:fail privacy permission is not authorized 的错误信息。
49
+ * 在调用 resolve({ event: 'agree'/'disagree' }) 之前,开发者可以调用 resolve({ event: 'exposureAuthorization' }) 把隐私弹窗曝光告知平台。
50
+ */
51
+ interface ResolveOption {
52
+ /** 用户操作类型 */
53
+ event: 'exposureAuthorization' | 'agree' | 'disagree';
54
+ /** 同意授权按钮的id (仅event=agree时必填) */
55
+ buttonId?: string;
56
+ }
57
+ /**
58
+ * 触发本次 onNeedPrivacyAuthorization 事件的关联信息
59
+ */
60
+ interface EventInfo {
61
+ referrer: string
62
+ }
63
+
64
+ type Resolve = (option: ResolveOption) => void;
65
+ type Listener = (resolve: Resolve, eventInfo: EventInfo) => void;
66
+ }
67
+
68
+ interface TaroStatic {
69
+ /**
70
+ * 查询隐私授权情况。隐私合规开发指南详情可见《小程序隐私协议开发指南》
71
+ * @supported weapp
72
+ */
73
+ getPrivacySetting: (option?: getPrivacySetting.Option) => void;
74
+ /**
75
+ * 跳转至隐私协议页面。隐私合规开发指南详情可见《小程序隐私协议开发指南》
76
+ * @supported weapp
77
+ */
78
+ openPrivacyContract: (option?: openPrivacyContract.Option) => void;
79
+ /**
80
+ * 模拟隐私接口调用,并触发隐私弹窗逻辑。隐私合规开发指南详情可见《小程序隐私协议开发指南》
81
+ * @supported weapp
82
+ */
83
+ requirePrivacyAuthorize: (option?: requirePrivacyAuthorize.Option) => void;
84
+ /**
85
+ * 监听隐私接口需要用户授权事件。当需要用户进行隐私授权时会触发。触发该事件时,开发者需要弹出隐私协议说明,并在用户同意或拒绝授权后调用回调接口 resolve 触发原隐私接口或组件继续执行。隐私合规开发指南详情可见《小程序隐私协议开发指南》
86
+ * @supported weapp
87
+ */
88
+ onNeedPrivacyAuthorization: (listener: onNeedPrivacyAuthorization.Listener) => void;
89
+ }
90
+ }
@@ -83,7 +83,7 @@ declare module '../index' {
83
83
  /** 尺寸转换
84
84
  * @supported global
85
85
  */
86
- pxTransform(size: number, designWidth?: number): string
86
+ pxTransform(size: number): string
87
87
 
88
88
  /** 尺寸转换初始化
89
89
  * @supported global
@@ -107,6 +107,7 @@
107
107
  /// <reference path="api/wxml/index.d.ts" />
108
108
  /// <reference path="api/ext/index.d.ts" />
109
109
  /// <reference path="api/ad/index.d.ts" />
110
+ /// <reference path="api/privacy/index.d.ts" />
110
111
 
111
112
  /// <reference path="api/cloud/index.d.ts" />
112
113
  /// <reference path="api/open-api/facial.d.ts" />
@@ -622,6 +622,12 @@ declare module './index' {
622
622
  */
623
623
  useAuthorizePage: boolean
624
624
  }
625
+ /**
626
+ * 在 2023年9月15号之前,在 app.json 中配置 __usePrivacyCheck__: true 后,会启用隐私相关功能,如果不配置或者配置为 false 则不会启用。
627
+ * 在 2023年9月15号之后,不论 app.json 中是否有配置 __usePrivacyCheck__,隐私相关功能都会启用
628
+ * @supported wx
629
+ */
630
+ __usePrivacyCheck__?: boolean
625
631
  /**
626
632
  * 正常情况下默认所有资源文件都被打包发布到所有平台,可以通过 static 字段配置特定每个目录/文件只能发布到特定的平台(多端场景)
627
633
  * @see https://dev.weixin.qq.com/docs/framework/guideline/devtools/condition-compile.html#%E8%B5%84%E6%BA%90