@dcloudio/uni-app-x 0.7.37 → 0.7.38

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 (105) hide show
  1. package/package.json +1 -1
  2. package/types/UniPage.d.ts +44 -9
  3. package/types/app.d.ts +8 -5
  4. package/types/native/AsyncApiResult.d.ts +1 -0
  5. package/types/native/IUniElement.d.ts +34 -0
  6. package/types/native/UniElement.d.ts +2 -1
  7. package/types/native/UniTextElement.d.ts +1 -0
  8. package/types/native/global.d.ts +10 -0
  9. package/types/page.d.ts +5 -5
  10. package/types/uni/env/index.d.ts +15 -1
  11. package/types/uni/global.d.ts +1 -0
  12. package/types/uni/index.d.ts +1 -0
  13. package/types/uni/uni-map-tencent-global.d.ts +33 -0
  14. package/types/uni/uni-map-tencent-map.d.ts +52 -0
  15. package/types/uni/uts-plugin-api/global.d.ts +3 -0
  16. package/types/uni/uts-plugin-api/index.d.ts +3 -0
  17. package/types/uni/uts-plugin-api/lib/uni-actionSheet/utssdk/global.d.ts +24 -0
  18. package/types/uni/uts-plugin-api/lib/uni-actionSheet/utssdk/index.d.ts +11 -0
  19. package/types/uni/uts-plugin-api/lib/uni-actionSheet/utssdk/interface.d.ts +217 -0
  20. package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/global.d.ts +0 -2
  21. package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/index.d.ts +0 -1
  22. package/types/uni/uts-plugin-api/lib/uni-addPhoneContact/utssdk/interface.d.ts +212 -219
  23. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +1 -1
  24. package/types/uni/uts-plugin-api/lib/uni-authentication/utssdk/interface.d.ts +130 -4
  25. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +1 -1
  26. package/types/uni/uts-plugin-api/lib/uni-canvas/utssdk/interface.d.ts +647 -7
  27. package/types/uni/uts-plugin-api/lib/uni-chooseLocation/utssdk/global.d.ts +20 -0
  28. package/types/uni/uts-plugin-api/lib/uni-chooseLocation/utssdk/index.d.ts +9 -0
  29. package/types/uni/uts-plugin-api/lib/uni-chooseLocation/utssdk/interface.d.ts +153 -0
  30. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/interface.d.ts +2 -2
  31. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/global.d.ts +4 -0
  32. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/index.d.ts +2 -0
  33. package/types/uni/uts-plugin-api/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +1995 -1726
  34. package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/interface.d.ts +1 -1
  35. package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/interface.d.ts +102 -18
  36. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +2 -2
  37. package/types/uni/uts-plugin-api/lib/uni-dialogPage/utssdk/interface.d.ts +1123 -1044
  38. package/types/uni/uts-plugin-api/lib/uni-event/utssdk/interface.d.ts +327 -296
  39. package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/interface.d.ts +33 -28
  40. package/types/uni/uts-plugin-api/lib/uni-file/utssdk/interface.d.ts +210 -0
  41. package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/interface.d.ts +2687 -13
  42. package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +42 -0
  43. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +1178 -2
  44. package/types/uni/uts-plugin-api/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +1 -1
  45. package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +882 -0
  46. package/types/uni/uts-plugin-api/lib/uni-getEnterOptionsSync/utssdk/interface.d.ts +152 -12
  47. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +152 -12
  48. package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/interface.d.ts +760 -4
  49. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent-uni1/utssdk/global.d.ts +0 -2
  50. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent-uni1/utssdk/interface.d.ts +0 -45
  51. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +126 -0
  52. package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/interface.d.ts +38 -3
  53. package/types/uni/uts-plugin-api/lib/uni-getRecorderManager/utssdk/interface.d.ts +13 -13
  54. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +3119 -1
  55. package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +300 -6
  56. package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/interface.d.ts +2 -2
  57. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/interface.d.ts +42 -0
  58. package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/interface.d.ts +8 -8
  59. package/types/uni/uts-plugin-api/lib/uni-makePhoneCall/utssdk/interface.d.ts +1 -1
  60. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/global.d.ts +8 -0
  61. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/index.d.ts +4 -0
  62. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +1686 -266
  63. package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/interface.d.ts +15 -15
  64. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +3618 -1675
  65. package/types/uni/uts-plugin-api/lib/uni-oauth/utssdk/interface.d.ts +11 -11
  66. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/interface.d.ts +42 -0
  67. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/interface.d.ts +9 -9
  68. package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/interface.d.ts +252 -0
  69. package/types/uni/uts-plugin-api/lib/uni-payment-huawei/utssdk/global.d.ts +8 -0
  70. package/types/uni/uts-plugin-api/lib/uni-payment-huawei/utssdk/index.d.ts +4 -0
  71. package/types/uni/uts-plugin-api/lib/uni-payment-huawei/utssdk/interface.d.ts +1 -0
  72. package/types/uni/uts-plugin-api/lib/uni-privacy/utssdk/interface.d.ts +532 -245
  73. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/interface.d.ts +1260 -0
  74. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/interface.d.ts +2 -2
  75. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +58 -58
  76. package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/interface.d.ts +42 -0
  77. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/interface.d.ts +42 -0
  78. package/types/uni/uts-plugin-api/lib/uni-shareWithSystem/utssdk/global.d.ts +4 -0
  79. package/types/uni/uts-plugin-api/lib/uni-shareWithSystem/utssdk/index.d.ts +2 -0
  80. package/types/uni/uts-plugin-api/lib/uni-shareWithSystem/utssdk/interface.d.ts +614 -15
  81. package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/interface.d.ts +420 -0
  82. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +50 -8
  83. package/types/uni/uts-plugin-api/lib/uni-virtualPayment/utssdk/interface.d.ts +267 -99
  84. package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +978 -12
  85. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +1 -1
  86. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/global.d.ts +2 -0
  87. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/index.d.ts +1 -0
  88. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/interface.d.ts +37 -5
  89. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +379 -1
  90. package/types/uni/uts-plugin-extend/README.md +3 -0
  91. package/types/uni/uts-plugin-extend/lib/uni-accelerometer/utssdk/interface.d.ts +4 -4
  92. package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/interface.d.ts +4 -4
  93. package/types/uni/uts-plugin-extend/lib/uni-chooseLocation/utssdk/interface.d.ts +73 -73
  94. package/types/uni/uts-plugin-extend/lib/uni-compass/utssdk/interface.d.ts +302 -302
  95. package/types/uni/uts-plugin-extend/lib/uni-createInnerAudioContext/utssdk/interface.d.ts +1 -1
  96. package/types/uni/uts-plugin-extend/lib/uni-createMapContext/utssdk/interface.d.ts +1 -1
  97. package/types/uni/uts-plugin-extend/lib/uni-createMediaQueryObserver/utssdk/interface.d.ts +1 -1
  98. package/types/uni/uts-plugin-extend/lib/uni-getBackgroundAudioManager/utssdk/interface.d.ts +431 -11
  99. package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/interface.d.ts +3 -3
  100. package/types/uni/uts-plugin-extend/lib/uni-localeChange/utssdk/interface.d.ts +6 -6
  101. package/types/uni/uts-plugin-extend/lib/uni-memory/utssdk/interface.d.ts +2 -2
  102. package/types/uni/uts-plugin-extend/lib/uni-openLocation/utssdk/interface.d.ts +73 -73
  103. package/types/uni/uts-plugin-extend/lib/uni-theme/utssdk/interface.d.ts +2 -2
  104. package/types/uni-cloud/interface.d.ts +91 -0
  105. package/uts-plugin.d.ts +3 -1
@@ -6,302 +6,333 @@ export type $Once = (eventName: string, callback: $OnceCallback) => number
6
6
 
7
7
  export type $Off = (eventName: string, callback?: any | null) => void
8
8
 
9
- export type $Emit = (eventName: string, args: any | null) => void
9
+ export type $Emit = (eventName: string, ...args: Array<any | null>) => void
10
10
 
11
11
  export interface Uni {
12
- /**
13
- * 监听自定义事件。事件可以由 uni.$emit 触发。回调函数会接收 uni.$emit 传递的参数。
14
- * 4.31+ 开始支持返回事件监听器 id, 用于 off 事件监听器。
15
- *
16
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#on
17
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#on
18
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/window/communication.html#on
19
- * @uniPlatform {
20
- * "app": {
21
- * "android": {
22
- * "osVer": "5.0",
23
- * "uniVer": "",
24
- * "unixVer": "3.91"
25
- * },
26
- * "ios": {
27
- * "osVer": "12.0",
28
- * "uniVer": "√",
29
- * "unixVer": "4.11"
30
- * },
31
- * "harmony": {
32
- * "osVer": "3.0",
33
- * "uniVer": "4.23",
34
- * "unixVer": "x"
35
- * }
36
- * },
37
- * "mp": {
38
- * "weixin": {
39
- * "hostVer": "",
40
- * "uniVer": "√",
41
- * "unixVer": "x"
42
- * },
43
- * "alipay": {
44
- * "hostVer": "√",
45
- * "uniVer": "√",
46
- * "unixVer": "x"
47
- * },
48
- * "baidu": {
49
- * "hostVer": "√",
50
- * "uniVer": "√",
51
- * "unixVer": "x"
52
- * },
53
- * "toutiao": {
54
- * "hostVer": "√",
55
- * "uniVer": "√",
56
- * "unixVer": "x"
57
- * },
58
- * "lark": {
59
- * "hostVer": "√",
60
- * "uniVer": "√",
61
- * "unixVer": "x"
62
- * },
63
- * "qq": {
64
- * "hostVer": "√",
65
- * "uniVer": "√",
66
- * "unixVer": "x"
67
- * },
68
- * "kuaishou": {
69
- * "hostVer": "√",
70
- * "uniVer": "√",
71
- * "unixVer": "x"
72
- * },
73
- * "jd": {
74
- * "hostVer": "√",
75
- * "uniVer": "√",
76
- * "unixVer": "x"
77
- * }
78
- * },
79
- * "web": {
80
- * "uniVer": "√",
81
- * "unixVer": "4.0"
82
- * }
83
- * }
84
- */
85
- $on(eventName: string, callback: $OnCallback): number
86
- /**
87
- * 移除自定义事件监听器。如果提供了事件名和回调,则只移除这个回调的监听器。
88
- * 4.13+ 开始支持第二个参数为可选,如果仅提供事件名,则移除该事件的所有监听器。
89
- * 4.31+ 开始支持第二个参数传入 `uni.$on`、`uni.$once` 返回的事件监听器 id, 移除指定事件监听器。
90
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#off
91
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#off
92
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/window/communication.html#off
93
- * @uniPlatform {
94
- * "app": {
95
- * "android": {
96
- * "osVer": "5.0",
97
- * "uniVer": "√",
98
- * "unixVer": "3.91"
99
- * },
100
- * "ios": {
101
- * "osVer": "12.0",
102
- * "uniVer": "√",
103
- * "unixVer": "4.11"
104
- * },
105
- * "harmony": {
106
- * "osVer": "3.0",
107
- * "uniVer": "4.23",
108
- * "unixVer": "x"
109
- * }
110
- * },
111
- * "mp": {
112
- * "weixin": {
113
- * "hostVer": "√",
114
- * "uniVer": "",
115
- * "unixVer": "x"
116
- * },
117
- * "alipay": {
118
- * "hostVer": "√",
119
- * "uniVer": "",
120
- * "unixVer": "x"
121
- * },
122
- * "baidu": {
123
- * "hostVer": "√",
124
- * "uniVer": "√",
125
- * "unixVer": "x"
126
- * },
127
- * "toutiao": {
128
- * "hostVer": "",
129
- * "uniVer": "√",
130
- * "unixVer": "x"
131
- * },
132
- * "lark": {
133
- * "hostVer": "",
134
- * "uniVer": "√",
135
- * "unixVer": "x"
136
- * },
137
- * "qq": {
138
- * "hostVer": "",
139
- * "uniVer": "√",
140
- * "unixVer": "x"
141
- * },
142
- * "kuaishou": {
143
- * "hostVer": "",
144
- * "uniVer": "√",
145
- * "unixVer": "x"
146
- * },
147
- * "jd": {
148
- * "hostVer": "",
149
- * "uniVer": "√",
150
- * "unixVer": "x"
151
- * }
152
- * },
153
- * "web": {
154
- * "uniVer": "√",
155
- * "unixVer": "4.0"
156
- * }
157
- * }
158
- */
159
- $off(eventName: string, callback?: any | null): void
160
- /**
161
- * 监听一个自定义事件。事件只触发一次,在第一次触发之后移除事件监听器。
162
- * 4.31+ 开始支持返回事件监听器 id, 用于 off 事件监听器。
163
- *
164
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#once
165
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#once
166
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/window/communication.html#once
167
- * @uniPlatform {
168
- * "app": {
169
- * "android": {
170
- * "osVer": "5.0",
171
- * "uniVer": "√",
172
- * "unixVer": "3.91"
173
- * },
174
- * "ios": {
175
- * "osVer": "12.0",
176
- * "uniVer": "√",
177
- * "unixVer": "4.11"
178
- * },
179
- * "harmony": {
180
- * "osVer": "3.0",
181
- * "uniVer": "4.23",
182
- * "unixVer": "x"
183
- * }
184
- * },
185
- * "mp": {
186
- * "weixin": {
187
- * "hostVer": "",
188
- * "uniVer": "√",
189
- * "unixVer": "x"
190
- * },
191
- * "alipay": {
192
- * "hostVer": "√",
193
- * "uniVer": "√",
194
- * "unixVer": "x"
195
- * },
196
- * "baidu": {
197
- * "hostVer": "",
198
- * "uniVer": "",
199
- * "unixVer": "x"
200
- * },
201
- * "toutiao": {
202
- * "hostVer": "",
203
- * "uniVer": "",
204
- * "unixVer": "x"
205
- * },
206
- * "lark": {
207
- * "hostVer": "√",
208
- * "uniVer": "√",
209
- * "unixVer": "x"
210
- * },
211
- * "qq": {
212
- * "hostVer": "√",
213
- * "uniVer": "√",
214
- * "unixVer": "x"
215
- * },
216
- * "kuaishou": {
217
- * "hostVer": "√",
218
- * "uniVer": "√",
219
- * "unixVer": "x"
220
- * },
221
- * "jd": {
222
- * "hostVer": "√",
223
- * "uniVer": "√",
224
- * "unixVer": "x"
225
- * }
226
- * },
227
- * "web": {
228
- * "uniVer": "√",
229
- * "unixVer": "4.0"
230
- * }
231
- * }
232
- */
233
- $once(eventName: string, callback: $OnceCallback): number
234
- /**
235
- * 触发自定义事件,附加的参数会传递给事件监听器。
236
- *
237
- * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#emit
238
- * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#emit
239
- * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/window/communication.html#emit
240
- * @uniPlatform {
241
- * "app": {
242
- * "android": {
243
- * "osVer": "5.0",
244
- * "uniVer": "√",
245
- * "unixVer": "3.91"
246
- * },
247
- * "ios": {
248
- * "osVer": "12.0",
249
- * "uniVer": "√",
250
- * "unixVer": "4.11"
251
- * },
252
- * "harmony": {
253
- * "osVer": "3.0",
254
- * "uniVer": "4.23",
255
- * "unixVer": "x"
256
- * }
257
- * },
258
- * "mp": {
259
- * "weixin": {
260
- * "hostVer": "√",
261
- * "uniVer": "√",
262
- * "unixVer": "x"
263
- * },
264
- * "alipay": {
265
- * "hostVer": "√",
266
- * "uniVer": "√",
267
- * "unixVer": "x"
268
- * },
269
- * "baidu": {
270
- * "hostVer": "",
271
- * "uniVer": "",
272
- * "unixVer": "x"
273
- * },
274
- * "toutiao": {
275
- * "hostVer": "",
276
- * "uniVer": "√",
277
- * "unixVer": "x"
278
- * },
279
- * "lark": {
280
- * "hostVer": "√",
281
- * "uniVer": "√",
282
- * "unixVer": "x"
283
- * },
284
- * "qq": {
285
- * "hostVer": "√",
286
- * "uniVer": "√",
287
- * "unixVer": "x"
288
- * },
289
- * "kuaishou": {
290
- * "hostVer": "√",
291
- * "uniVer": "",
292
- * "unixVer": "x"
293
- * },
294
- * "jd": {
295
- * "hostVer": "√",
296
- * "uniVer": "",
297
- * "unixVer": "x"
298
- * }
299
- * },
300
- * "web": {
301
- * "uniVer": "",
302
- * "unixVer": "4.0"
303
- * }
304
- * }
305
- */
306
- $emit(eventName: string, args: any | null): void
12
+ /**
13
+ * 监听自定义事件。事件可以由 uni.$emit 触发。回调函数会接收 uni.$emit 传递的参数。
14
+ * 4.31+ 开始支持返回事件监听器 id, 用于 off 事件监听器。
15
+ *
16
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#on
17
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#on
18
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/window/communication.html#on
19
+ * @uniPlatform
20
+ {
21
+ "app": {
22
+ "android": {
23
+ "osVer": "5.0",
24
+ "uniVer": "",
25
+ "uniUtsPlugin": "x",
26
+ "unixVer": "3.91",
27
+ "unixUtsPlugin": "3.91"
28
+ },
29
+ "ios": {
30
+ "osVer": "12.0",
31
+ "uniVer": "√",
32
+ "uniUtsPlugin": "x",
33
+ "unixVer": "4.11",
34
+ "unixUtsPlugin": "4.31"
35
+ },
36
+ "harmony": {
37
+ "osVer": "3.0",
38
+ "uniVer": "4.23",
39
+ "unixVer": "x"
40
+ }
41
+ },
42
+ "mp": {
43
+ "weixin": {
44
+ "hostVer": "√",
45
+ "uniVer": "√",
46
+ "unixVer": "4.35"
47
+ },
48
+ "alipay": {
49
+ "hostVer": "√",
50
+ "uniVer": "√",
51
+ "unixVer": "x"
52
+ },
53
+ "baidu": {
54
+ "hostVer": "√",
55
+ "uniVer": "√",
56
+ "unixVer": "x"
57
+ },
58
+ "toutiao": {
59
+ "hostVer": "√",
60
+ "uniVer": "√",
61
+ "unixVer": "x"
62
+ },
63
+ "lark": {
64
+ "hostVer": "√",
65
+ "uniVer": "√",
66
+ "unixVer": "x"
67
+ },
68
+ "qq": {
69
+ "hostVer": "√",
70
+ "uniVer": "√",
71
+ "unixVer": "x"
72
+ },
73
+ "kuaishou": {
74
+ "hostVer": "√",
75
+ "uniVer": "√",
76
+ "unixVer": "x"
77
+ },
78
+ "jd": {
79
+ "hostVer": "√",
80
+ "uniVer": "√",
81
+ "unixVer": "x"
82
+ }
83
+ },
84
+ "web": {
85
+ "uniVer": "√",
86
+ "unixVer": "4.0"
87
+ }
88
+ }
89
+ * @param eventName 事件名称
90
+ * @param callback 事件回调
91
+ */
92
+ $on(eventName: string, callback: $OnCallback): number
93
+
94
+ /**
95
+ * 移除自定义事件监听器。如果提供了事件名和回调,则只移除这个回调的监听器。
96
+ * 4.13+ 开始支持第二个参数为可选,如果仅提供事件名,则移除该事件的所有监听器。
97
+ * 4.31+ 开始第二个参数的类型由 `Function | null` 调整为 `any | null`, 支持传入 `uni.$on`、`uni.$once` 返回的事件监听器 id, 移除指定事件监听器。
98
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#off
99
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#off
100
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/window/communication.html#off
101
+ * @uniPlatform
102
+ {
103
+ "app": {
104
+ "android": {
105
+ "osVer": "5.0",
106
+ "uniVer": "",
107
+ "uniUtsPlugin": "x",
108
+ "unixVer": "3.91",
109
+ "unixUtsPlugin": "3.91"
110
+ },
111
+ "ios": {
112
+ "osVer": "12.0",
113
+ "uniVer": "√",
114
+ "uniUtsPlugin": "x",
115
+ "unixVer": "4.11",
116
+ "unixUtsPlugin": "4.31"
117
+ },
118
+ "harmony": {
119
+ "osVer": "3.0",
120
+ "uniVer": "4.23",
121
+ "unixVer": "x"
122
+ }
123
+ },
124
+ "mp": {
125
+ "weixin": {
126
+ "hostVer": "√",
127
+ "uniVer": "√",
128
+ "unixVer": "4.35"
129
+ },
130
+ "alipay": {
131
+ "hostVer": "√",
132
+ "uniVer": "√",
133
+ "unixVer": "x"
134
+ },
135
+ "baidu": {
136
+ "hostVer": "√",
137
+ "uniVer": "√",
138
+ "unixVer": "x"
139
+ },
140
+ "toutiao": {
141
+ "hostVer": "√",
142
+ "uniVer": "√",
143
+ "unixVer": "x"
144
+ },
145
+ "lark": {
146
+ "hostVer": "√",
147
+ "uniVer": "√",
148
+ "unixVer": "x"
149
+ },
150
+ "qq": {
151
+ "hostVer": "√",
152
+ "uniVer": "√",
153
+ "unixVer": "x"
154
+ },
155
+ "kuaishou": {
156
+ "hostVer": "√",
157
+ "uniVer": "√",
158
+ "unixVer": "x"
159
+ },
160
+ "jd": {
161
+ "hostVer": "√",
162
+ "uniVer": "√",
163
+ "unixVer": "x"
164
+ }
165
+ },
166
+ "web": {
167
+ "uniVer": "√",
168
+ "unixVer": "4.0"
169
+ }
170
+ }
171
+ * @param eventName 事件名称
172
+ * @param callback 要移除的事件回调或事件监听器 id
173
+ */
174
+ $off(eventName: string, callback?: any | null): void
175
+
176
+ /**
177
+ * 监听一个自定义事件。事件只触发一次,在第一次触发之后移除事件监听器。
178
+ * 4.31+ 开始支持返回事件监听器 id, 用于 off 事件监听器。
179
+ *
180
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#once
181
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#once
182
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/window/communication.html#once
183
+ * @uniPlatform
184
+ {
185
+ "app": {
186
+ "android": {
187
+ "osVer": "5.0",
188
+ "uniVer": "√",
189
+ "uniUtsPlugin": "x",
190
+ "unixVer": "3.91",
191
+ "unixUtsPlugin": "3.91"
192
+ },
193
+ "ios": {
194
+ "osVer": "12.0",
195
+ "uniVer": "√",
196
+ "uniUtsPlugin": "x",
197
+ "unixVer": "4.11",
198
+ "unixUtsPlugin": "4.31"
199
+ },
200
+ "harmony": {
201
+ "osVer": "3.0",
202
+ "uniVer": "4.23",
203
+ "unixVer": "x"
204
+ }
205
+ },
206
+ "mp": {
207
+ "weixin": {
208
+ "hostVer": "√",
209
+ "uniVer": "",
210
+ "unixVer": "4.35"
211
+ },
212
+ "alipay": {
213
+ "hostVer": "√",
214
+ "uniVer": "",
215
+ "unixVer": "x"
216
+ },
217
+ "baidu": {
218
+ "hostVer": "√",
219
+ "uniVer": "",
220
+ "unixVer": "x"
221
+ },
222
+ "toutiao": {
223
+ "hostVer": "√",
224
+ "uniVer": "",
225
+ "unixVer": "x"
226
+ },
227
+ "lark": {
228
+ "hostVer": "√",
229
+ "uniVer": "",
230
+ "unixVer": "x"
231
+ },
232
+ "qq": {
233
+ "hostVer": "√",
234
+ "uniVer": "√",
235
+ "unixVer": "x"
236
+ },
237
+ "kuaishou": {
238
+ "hostVer": "√",
239
+ "uniVer": "√",
240
+ "unixVer": "x"
241
+ },
242
+ "jd": {
243
+ "hostVer": "",
244
+ "uniVer": "√",
245
+ "unixVer": "x"
246
+ }
247
+ },
248
+ "web": {
249
+ "uniVer": "√",
250
+ "unixVer": "4.0"
251
+ }
252
+ }
253
+ * @param eventName 事件名称
254
+ * @param callback 事件回调
255
+ */
256
+ $once(eventName: string, callback: $OnceCallback): number
257
+
258
+ /**
259
+ * 触发自定义事件,附加的参数会传递给事件监听器。
260
+ *
261
+ * @tutorial-uni-app-x https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#emit
262
+ * @tutorial https://doc.dcloud.net.cn/uni-app-x/api/event-bus.html#emit
263
+ * @tutorial-uni-app https://uniapp.dcloud.net.cn/api/window/communication.html#emit
264
+ * @uniPlatform
265
+ {
266
+ "app": {
267
+ "android": {
268
+ "osVer": "5.0",
269
+ "uniVer": "√",
270
+ "uniUtsPlugin": "x",
271
+ "unixVer": "3.91",
272
+ "unixUtsPlugin": "3.91"
273
+ },
274
+ "ios": {
275
+ "osVer": "12.0",
276
+ "uniVer": "√",
277
+ "uniUtsPlugin": "x",
278
+ "unixVer": "4.11",
279
+ "unixUtsPlugin": "4.31"
280
+ },
281
+ "harmony": {
282
+ "osVer": "3.0",
283
+ "uniVer": "4.23",
284
+ "unixVer": "x"
285
+ }
286
+ },
287
+ "mp": {
288
+ "weixin": {
289
+ "hostVer": "√",
290
+ "uniVer": "√",
291
+ "unixVer": "4.35"
292
+ },
293
+ "alipay": {
294
+ "hostVer": "√",
295
+ "uniVer": "√",
296
+ "unixVer": "x"
297
+ },
298
+ "baidu": {
299
+ "hostVer": "√",
300
+ "uniVer": "√",
301
+ "unixVer": "x"
302
+ },
303
+ "toutiao": {
304
+ "hostVer": "√",
305
+ "uniVer": "√",
306
+ "unixVer": "x"
307
+ },
308
+ "lark": {
309
+ "hostVer": "√",
310
+ "uniVer": "√",
311
+ "unixVer": "x"
312
+ },
313
+ "qq": {
314
+ "hostVer": "√",
315
+ "uniVer": "√",
316
+ "unixVer": "x"
317
+ },
318
+ "kuaishou": {
319
+ "hostVer": "√",
320
+ "uniVer": "√",
321
+ "unixVer": "x"
322
+ },
323
+ "jd": {
324
+ "hostVer": "√",
325
+ "uniVer": "√",
326
+ "unixVer": "x"
327
+ }
328
+ },
329
+ "web": {
330
+ "uniVer": "√",
331
+ "unixVer": "4.0"
332
+ }
333
+ }
334
+ * @param eventName 事件名称
335
+ * @param args 触发事件时传递的参数
336
+ */
337
+ $emit(eventName: string, ...args: Array<any | null>): void
307
338
  }