@dcloudio/uni-app-x 0.7.14 → 0.7.15

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 (126) hide show
  1. package/options.d.ts +1 -1
  2. package/package.json +1 -1
  3. package/types/native/CSSStyleDeclaration.d.ts +0 -72
  4. package/types/native/CanvasRenderingContext2D.d.ts +378 -0
  5. package/types/native/DOMRect.d.ts +0 -180
  6. package/types/native/DrawableContext.d.ts +161 -628
  7. package/types/native/IUniElement.d.ts +335 -1919
  8. package/types/native/Path2D.d.ts +74 -0
  9. package/types/native/SnapshotOptions.d.ts +1 -0
  10. package/types/native/UniCanvasElement.d.ts +9 -0
  11. package/types/native/UniNativePage.d.ts +27 -1
  12. package/types/native/UniPageManager.d.ts +4 -1
  13. package/types/native/UniResizeObserver.d.ts +9 -99
  14. package/types/native/UniScrollEvent.d.ts +1 -1
  15. package/types/native/UniSwiperAnimationFinishEvent.d.ts +1 -1
  16. package/types/native/UniSwiperChangeEvent.d.ts +1 -1
  17. package/types/native/global.d.ts +21 -0
  18. package/types/native/index.d.ts +3 -0
  19. package/types/shim-uts-basic.d.ts +4495 -0
  20. package/types/uni/env/index.d.ts +21 -0
  21. package/types/uni/uts-plugin-api/global.d.ts +12 -1
  22. package/types/uni/uts-plugin-api/index.d.ts +12 -1
  23. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/global.d.ts +10 -0
  24. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/index.d.ts +4 -0
  25. package/types/uni/uts-plugin-api/lib/uni-arrayBufferToBase64/utssdk/interface.d.ts +77 -0
  26. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/global.d.ts +10 -0
  27. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/index.d.ts +4 -0
  28. package/types/uni/uts-plugin-api/lib/uni-base64ToArrayBuffer/utssdk/interface.d.ts +77 -0
  29. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/global.d.ts +40 -0
  30. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/index.d.ts +19 -0
  31. package/types/uni/uts-plugin-api/lib/uni-clipboard/utssdk/interface.d.ts +203 -0
  32. package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/global.d.ts +20 -0
  33. package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/index.d.ts +9 -0
  34. package/types/uni/uts-plugin-api/lib/uni-createIntersectionObserver/utssdk/interface.d.ts +152 -0
  35. package/types/uni/uts-plugin-api/lib/uni-createRequestPermissionListener/utssdk/interface.d.ts +20 -3
  36. package/types/uni/uts-plugin-api/lib/uni-createSelectorQuery/utssdk/interface.d.ts +19 -8
  37. package/types/uni/uts-plugin-api/lib/uni-createWebviewContext/utssdk/interface.d.ts +13 -6
  38. package/types/uni/uts-plugin-api/lib/uni-event/utssdk/interface.d.ts +28 -0
  39. package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/interface.d.ts +6 -1
  40. package/types/uni/uts-plugin-api/lib/uni-fileSystemManager/utssdk/interface.d.ts +8 -1
  41. package/types/uni/uts-plugin-api/lib/uni-getAccessibilityInfo/utssdk/interface.d.ts +20 -17
  42. package/types/uni/uts-plugin-api/lib/uni-getAppAuthorizeSetting/utssdk/interface.d.ts +26 -18
  43. package/types/uni/uts-plugin-api/lib/uni-getAppBaseInfo/utssdk/interface.d.ts +201 -64
  44. package/types/uni/uts-plugin-api/lib/uni-getDeviceInfo/utssdk/interface.d.ts +180 -59
  45. package/types/uni/uts-plugin-api/lib/uni-getElementById/utssdk/interface.d.ts +7 -1
  46. package/types/uni/uts-plugin-api/lib/uni-getLaunchOptionsSync/utssdk/interface.d.ts +10 -1
  47. package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/global.d.ts +24 -0
  48. package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/index.d.ts +11 -0
  49. package/types/uni/uts-plugin-api/lib/uni-getLocation/utssdk/interface.d.ts +173 -0
  50. package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/global.d.ts +2 -14
  51. package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/index.d.ts +1 -6
  52. package/types/uni/uts-plugin-api/lib/uni-getLocation-system/utssdk/interface.d.ts +1 -151
  53. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/global.d.ts +8 -0
  54. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/index.d.ts +4 -0
  55. package/types/uni/uts-plugin-api/lib/uni-getLocation-tencent/utssdk/interface.d.ts +1 -0
  56. package/types/uni/uts-plugin-api/lib/uni-getNetworkType/utssdk/interface.d.ts +10 -3
  57. package/types/uni/uts-plugin-api/lib/uni-getPerformance/utssdk/interface.d.ts +7 -1
  58. package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/global.d.ts +8 -0
  59. package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/index.d.ts +4 -0
  60. package/types/uni/uts-plugin-api/lib/uni-getProvider/utssdk/interface.d.ts +113 -23
  61. package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +500 -149
  62. package/types/uni/uts-plugin-api/lib/uni-getSystemSetting/utssdk/interface.d.ts +123 -112
  63. package/types/uni/uts-plugin-api/lib/uni-installApk/utssdk/interface.d.ts +9 -6
  64. package/types/uni/uts-plugin-api/lib/uni-interceptor/utssdk/interface.d.ts +18 -2
  65. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/global.d.ts +22 -0
  66. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/index.d.ts +10 -0
  67. package/types/uni/uts-plugin-api/lib/uni-keyboard/utssdk/interface.d.ts +60 -0
  68. package/types/uni/uts-plugin-api/lib/uni-loadFontFace/utssdk/interface.d.ts +8 -1
  69. package/types/uni/{uts-plugin-extend → uts-plugin-api}/lib/uni-makePhoneCall/utssdk/global.d.ts +9 -6
  70. package/types/uni/{uts-plugin-extend → uts-plugin-api}/lib/uni-makePhoneCall/utssdk/index.d.ts +4 -2
  71. package/types/uni/{uts-plugin-extend → uts-plugin-api}/lib/uni-makePhoneCall/utssdk/interface.d.ts +40 -61
  72. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/global.d.ts +2 -0
  73. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/index.d.ts +1 -0
  74. package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +312 -58
  75. package/types/uni/uts-plugin-api/lib/uni-navigationBar/utssdk/interface.d.ts +34 -5
  76. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/interface.d.ts +280 -92
  77. package/types/uni/uts-plugin-api/lib/uni-openAppAuthorizeSetting/utssdk/interface.d.ts +20 -15
  78. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/global.d.ts +24 -0
  79. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/index.d.ts +11 -0
  80. package/types/uni/uts-plugin-api/lib/uni-openDocument/utssdk/interface.d.ts +70 -0
  81. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/global.d.ts +2 -0
  82. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/index.d.ts +1 -0
  83. package/types/uni/uts-plugin-api/lib/uni-pageScrollTo/utssdk/interface.d.ts +16 -6
  84. package/types/uni/uts-plugin-api/lib/uni-payment/utssdk/interface.d.ts +17 -10
  85. package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/global.d.ts +8 -0
  86. package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/index.d.ts +4 -0
  87. package/types/uni/uts-plugin-api/lib/uni-payment-alipay/utssdk/interface.d.ts +1 -0
  88. package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/global.d.ts +8 -0
  89. package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/index.d.ts +4 -0
  90. package/types/uni/uts-plugin-api/lib/uni-payment-wxpay/utssdk/interface.d.ts +3 -0
  91. package/types/uni/uts-plugin-api/lib/uni-prompt/utssdk/interface.d.ts +120 -42
  92. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/global.d.ts +2 -0
  93. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/index.d.ts +1 -0
  94. package/types/uni/uts-plugin-api/lib/uni-pullDownRefresh/utssdk/interface.d.ts +16 -1
  95. package/types/uni/uts-plugin-api/lib/uni-route/utssdk/interface.d.ts +241 -32
  96. package/types/uni/uts-plugin-api/lib/uni-rpx2px/utssdk/interface.d.ts +7 -2
  97. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/global.d.ts +24 -0
  98. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/index.d.ts +11 -0
  99. package/types/uni/uts-plugin-api/lib/uni-scanCode/utssdk/interface.d.ts +73 -0
  100. package/types/uni/uts-plugin-api/lib/uni-storage/utssdk/interface.d.ts +112 -43
  101. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/global.d.ts +16 -0
  102. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/index.d.ts +8 -0
  103. package/types/uni/uts-plugin-api/lib/uni-tabBar/utssdk/interface.d.ts +78 -1
  104. package/types/uni/uts-plugin-api/lib/uni-theme/utssdk/interface.d.ts +199 -149
  105. package/types/uni/uts-plugin-api/lib/uni-websocket/utssdk/interface.d.ts +170 -83
  106. package/types/uni/uts-plugin-biz/lib/uni-ad/utssdk/interface.d.ts +11 -7
  107. package/types/uni/uts-plugin-biz/lib/uni-facialRecognitionVerify/utssdk/interface.d.ts +33 -15
  108. package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/global.d.ts +4 -0
  109. package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/index.d.ts +2 -0
  110. package/types/uni/uts-plugin-biz/lib/uni-push/utssdk/interface.d.ts +777 -568
  111. package/types/uni/uts-plugin-biz/lib/uni-verify/utssdk/interface.d.ts +10 -6
  112. package/types/uni/uts-plugin-component/lib/uni-video/utssdk/interface.d.ts +132 -15
  113. package/types/uni/uts-plugin-extend/global.d.ts +0 -1
  114. package/types/uni/uts-plugin-extend/index.d.ts +0 -3
  115. package/types/uni/uts-plugin-extend/lib/uni-canvas/utssdk/interface.d.ts +4 -4
  116. package/types/uni/uts-plugin-extend/lib/uni-locale/utssdk/interface.d.ts +3 -3
  117. package/types/uni-cloud/interface.d.ts +57 -3
  118. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/app-ios/global.d.ts +0 -78
  119. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/app-ios/index.d.ts +0 -38
  120. package/types/uni/uts-plugin-api/lib/uni-network/utssdk/app-ios/interface.d.ts +0 -642
  121. package/types/uni/uts-plugin-extend/lib/uni-getClipboardData/utssdk/global.d.ts +0 -21
  122. package/types/uni/uts-plugin-extend/lib/uni-getClipboardData/utssdk/index.d.ts +0 -9
  123. package/types/uni/uts-plugin-extend/lib/uni-getClipboardData/utssdk/interface.d.ts +0 -119
  124. package/types/uni/uts-plugin-extend/lib/uni-setClipboardData/utssdk/global.d.ts +0 -21
  125. package/types/uni/uts-plugin-extend/lib/uni-setClipboardData/utssdk/index.d.ts +0 -9
  126. package/types/uni/uts-plugin-extend/lib/uni-setClipboardData/utssdk/interface.d.ts +0 -122
@@ -1,570 +1,779 @@
1
- export interface Uni {
2
- /**
3
- * getPushClientId()
4
- * @description
5
- * 获取客户端唯一的推送标识
6
- * @param {GetPushClientIdOptions}
7
- * @return {void}
8
- * @tutorial http://uniapp.dcloud.io/api/plugins/push.html#getpushclientid
9
- * @uniPlatform {
10
- * "app": {
11
- * "android": {
12
- * "osVer": "4.4",
13
- * "uniVer": "√",
14
- * "unixVer": "3.98"
15
- * },
16
- * "ios": {
17
- * "osVer": "12.0",
18
- * "uniVer": "√",
19
- * "unixVer": "4.18"
20
- * }
21
- * }
22
- * }
23
- * @example
24
- ```typescript
25
- uni.getPushClientId({
26
- complete: (res: any) => {
27
- console.log("getPushClientId complete => " + JSON.stringify(res));
28
- }
29
- });
30
- ```
31
- */
32
- getPushClientId(options : GetPushClientIdOptions) : void;
33
- /**
34
- * onPushMessage()
35
- * @description
36
- * 启动监听推送消息事件
37
- * @param {OnPushMessageCallback}
38
- * @return {void}
39
- * @tutorial http://uniapp.dcloud.io/api/plugins/push.html#onpushmessage
40
- * @uniPlatform {
41
- * "app": {
42
- * "android": {
43
- * "osVer": "4.4",
44
- * "uniVer": "√",
45
- * "unixVer": "3.98"
46
- * },
47
- * "ios": {
48
- * "osVer": "12.0",
49
- * "uniVer": "",
50
- * "unixVer": "4.18"
51
- * }
52
- * }
53
- * }
54
- * @example
55
- ```typescript
1
+ export interface Uni {
2
+ /**
3
+ * getPushClientId()
4
+ * @description
5
+ * 获取客户端唯一的推送标识
6
+ * @param {GetPushClientIdOptions}
7
+ * @return {void}
8
+ * @tutorial http://uniapp.dcloud.io/api/plugins/push.html#getpushclientid
9
+ * @uniPlatform {
10
+ * "app": {
11
+ * "android": {
12
+ * "osVer": "4.4",
13
+ * "uniVer": "√",
14
+ * "unixVer": "3.98"
15
+ * },
16
+ * "ios": {
17
+ * "osVer": "12.0",
18
+ * "uniVer": "√",
19
+ * "unixVer": "4.18"
20
+ * }
21
+ * },
22
+ * "web": {
23
+ * "uniVer": "x",
24
+ * "unixVer": "x"
25
+ * }
26
+ * }
27
+ * @example
28
+ ```typescript
29
+ uni.getPushClientId({
30
+ complete: (res: any) => {
31
+ console.log("getPushClientId complete => " + JSON.stringify(res));
32
+ }
33
+ });
34
+ ```
35
+ */
36
+ getPushClientId(options : GetPushClientIdOptions) : void;
37
+ /**
38
+ * onPushMessage()
39
+ * @description
40
+ * 启动监听推送消息事件
41
+ * @param {OnPushMessageCallback}
42
+ * @return {void}
43
+ * @tutorial http://uniapp.dcloud.io/api/plugins/push.html#onpushmessage
44
+ * @uniPlatform {
45
+ * "app": {
46
+ * "android": {
47
+ * "osVer": "4.4",
48
+ * "uniVer": "",
49
+ * "unixVer": "3.98"
50
+ * },
51
+ * "ios": {
52
+ * "osVer": "12.0",
53
+ * "uniVer": "√",
54
+ * "unixVer": "4.18"
55
+ * }
56
+ * },
57
+ * "web": {
58
+ * "uniVer": "x",
59
+ * "unixVer": "x"
60
+ * }
61
+ * }
62
+ * @example
63
+ ```typescript
56
64
  uni.onPushMessage((res : OnPushMessageCallbackResult) => {
57
65
  console.log("onPushMessage => " + JSON.stringify(res))
58
- });
59
- ```
60
- */
61
- onPushMessage(callback : OnPushMessageCallback) : void;
62
- /**
63
- * offPushMessage()
64
- * @description
65
- * 关闭推送消息监听事件,iOS端调用会关闭所有监听。
66
- * @param {OnPushMessageCallback}
67
- * @return {void}
68
- * @tutorial http://uniapp.dcloud.io/api/plugins/push.html#offpushmessage
69
- * @uniPlatform {
70
- * "app": {
71
- * "android": {
72
- * "osVer": "4.4",
73
- * "uniVer": "√",
74
- * "unixVer": "3.98"
75
- * },
76
- * "ios": {
77
- * "osVer": "12.0",
78
- * "uniVer": "√",
79
- * "unixVer": "4.18"
80
- * }
81
- * }
82
- * }
83
- * @example
84
- ```typescript
85
- const cb = (res : OnPushMessageCallbackResult) => {
86
- console.log("onPushMessage => " + JSON.stringify(res))
87
- }
88
- uni.offPushMessage(cb);
89
- ```
90
- */
91
- offPushMessage(callback : OnPushMessageCallback) : void;
92
- /**
93
- * getChannelManager()
94
- * @description
95
- * 获取通知渠道管理器,Android 8系统以上才可以设置通知渠道,Android 8系统以下返回null。
96
- * @param {void}
97
- * @return {ChannelManager}
98
- * @uniPlatform {
99
- * "app": {
100
- * "android": {
101
- * "osVer": "4.4",
102
- * "uniVer": "3.98",
103
- * "unixVer": "3.98"
104
- * },
105
- * "ios": {
106
- * "osVer": "12.0",
107
- * "uniVer": "x",
108
- * "unixVer": "x"
109
- * }
110
- * }
111
- * }
112
- * @example
113
- ```typescript
114
- const channelManager = uni.getChannelManager();
115
- channelManager.setPushChannel({
116
- channelId: "test1",
117
- channelDesc: "test1 desc",
118
- soundName: "pushsound"
119
- })
120
- const channels = channelManager.getAllChannels() as string[]
121
- console.log("channels : " + channels);
122
- ```
123
- */
124
- getChannelManager() : ChannelManager;
125
-
126
- /**
127
- * createPushMessage()
128
- * @description
129
- * 创建本地通知栏消息
130
- * @param {CreatePushMessageOptions}
131
- * @return {void}
132
- * @tutorial http://uniapp.dcloud.io/api/plugins/push.html#createpushmessage
133
- * @uniPlatform {
134
- * "app": {
135
- * "android": {
136
- * "osVer": "4.4",
137
- * "uniVer": "√",
138
- * "unixVer": "3.98"
139
- * },
140
- * "ios": {
141
- * "osVer": "12.0",
142
- * "uniVer": "√",
143
- * "unixVer": "4.18"
144
- * }
145
- * }
146
- * }
147
- * @example
148
- ```typescript
149
- uni.createPushMessage({
150
- title:"hello",
151
- content: "content"
152
- });
153
- ```
154
- */
155
- createPushMessage(options : CreatePushMessageOptions) : void;
156
- }
157
-
158
- export type GetPushClientId = (options : GetPushClientIdOptions) => void;
159
- export type GetPushClientIdSuccess = {
160
- /**
161
- * 个推客户端推送id,对应uni-id-device表的push_clientid
162
- *
163
- * @uniPlatform {
164
- * "app": {
165
- * "android": {
166
- * "osVer": "4.4",
167
- * "uniVer": "√",
168
- * "unixVer": "3.98"
169
- * },
170
- * "ios": {
171
- * "osVer": "12.0",
172
- * "uniVer": "√",
173
- * "unixVer": "4.18"
174
- * }
175
- * }
176
- * }
177
- */
178
- cid : string,
179
- /**
180
- * 错误描述
181
- *
182
- * @uniPlatform {
183
- * "app": {
184
- * "android": {
185
- * "osVer": "4.4",
186
- * "uniVer": "√",
187
- * "unixVer": "3.98"
188
- * },
189
- * "ios": {
190
- * "osVer": "12.0",
191
- * "uniVer": "√",
192
- * "unixVer": "4.18"
193
- * }
194
- * }
195
- * }
196
- */
197
- errMsg : string
198
- };
199
- export type GetPushClientIdSuccessCallback = (result : GetPushClientIdSuccess) => void;
200
- export type GetPushClientIdFail = UniError;
201
- export type GetPushClientIdFailCallback = (result : GetPushClientIdFail) => void;
202
- export type GetPushClientIdComplete = any;
203
- export type GetPushClientIdCompleteCallback = (result : GetPushClientIdComplete) => void;
204
- export type GetPushClientIdOptions = {
205
- /**
206
- * 接口调用成功的回调函数
207
- * @defaultValue null
208
- */
209
- success : GetPushClientIdSuccessCallback | null,
210
- /**
211
- * 接口调用失败的回调函数
212
- * @defaultValue null
213
- */
214
- fail : GetPushClientIdFailCallback | null,
215
- /**
216
- * 接口调用结束的回调函数(调用成功、失败都会执行)
217
- * @defaultValue null
218
- */
219
- complete : GetPushClientIdCompleteCallback | null
220
- };
221
- /**
222
- * 事件类型
223
- * - click 从系统推送服务点击消息启动应用事件
224
- * - receive 应用从推送服务器接收到推送消息事件
225
- */
226
- export type OnPushMessageType = "click" | "receive";
227
-
228
- export type OnPushMessageCallbackResult= {
229
- /**
230
- * 事件类型
231
- * @type{OnPushMessageType}
232
- *
233
- * @uniPlatform {
234
- * "app": {
235
- * "android": {
236
- * "osVer": "4.4",
237
- * "uniVer": "√",
238
- * "unixVer": "3.98"
239
- * },
240
- * "ios": {
241
- * "osVer": "12.0",
242
- * "uniVer": "√",
243
- * "unixVer": "4.18"
244
- * }
245
- * }
246
- * }
247
- */
248
- type : OnPushMessageType,
249
- /**
250
- * 消息内容
251
- *
252
- * @uniPlatform {
253
- * "app": {
254
- * "android": {
255
- * "osVer": "4.4",
256
- * "uniVer": "",
257
- * "unixVer": "3.98"
258
- * },
259
- * "ios": {
260
- * "osVer": "12.0",
261
- * "uniVer": "",
262
- * "unixVer": "4.18"
263
- * }
264
- * }
265
- * }
266
- */
267
- data : UTSJSONObject
268
- };
269
-
270
- export type OnPushMessageCallback = (result : OnPushMessageCallbackResult) => void;
271
- export type OnPushMessage = (callback : OnPushMessageCallback) => void;
272
- export type OffPushMessage = (callback : OnPushMessageCallback) => void;
273
-
274
-
275
- export type GetChannelManager = () => ChannelManager;
276
- export type SetPushChannelOptions = {
277
- /**
278
- * 添加的声音文件,注意raw目录下必须要有 ,不传此字段将使用默认铃音。
279
- * @defaultValue null
280
- */
281
- soundName? : string | null,
282
- /**
283
- * 通知渠道id
284
- */
285
- channelId : string,
286
- /**
287
- * 通知渠道描述
288
- */
289
- channelDesc : string,
290
- /**
291
- * 呼吸灯闪烁
292
- * @defaultValue false
293
- */
294
- enableLights? : boolean | null,
295
- /**
296
- * 震动
297
- * @defaultValue false
298
- */
299
- enableVibration? : boolean | null,
300
- /**
301
- * 通知的重要性级别,可选范围IMPORTANCE_LOW:2、IMPORTANCE_DEFAULT:3、IMPORTANCE_HIGH:4 。
302
- * @defaultValue 3
303
- */
304
- importance? : number | null,
305
- /**
306
- * 锁屏可见性,可选范围VISIBILITY_PRIVATE:0、VISIBILITY_PUBLIC:1、VISIBILITY_SECRET:-1、VISIBILITY_NO_OVERRIDE:-1000。
307
- * @defaultValue -1000
308
- */
309
- lockscreenVisibility? : number | null
310
- }
311
- export interface ChannelManager {
312
- /**
313
- * 设置推送渠道
314
- *
315
- * @uniPlatform {
316
- * "app": {
317
- * "android": {
318
- * "osVer": "4.4",
319
- * "uniVer": "√",
320
- * "unixVer": "3.98"
321
- * },
322
- * "ios": {
323
- * "osVer": "12.0",
324
- * "uniVer": "x",
325
- * "unixVer": "x"
326
- * }
327
- * }
328
- * }
329
- */
330
- setPushChannel(options : SetPushChannelOptions) : void;
331
- /**
332
- * 获取当前应用注册的所有的通知渠道。
333
- *
334
- * @uniPlatform {
335
- * "app": {
336
- * "android": {
337
- * "osVer": "4.4",
338
- * "uniVer": "",
339
- * "unixVer": "3.98"
340
- * },
341
- * "ios": {
342
- * "osVer": "12.0",
343
- * "uniVer": "x",
344
- * "unixVer": "x"
345
- * }
346
- * }
347
- * }
348
- */
349
- getAllChannels() : Array<string>;
350
- }
351
-
352
- export type CreatePushMessage = (options : CreatePushMessageOptions) => void;
353
- export type CreatePushMessageSuccess = {};
354
- export type CreatePushMessageSuccessCallback = (result : CreatePushMessageSuccess) => void;
355
- export type CreatePushMessageFail = UniError;
356
- export type CreatePushMessageFailCallback = (result : CreatePushMessageFail) => void;
357
- export type CreatePushMessageComplete = any;
358
- export type CreatePushMessageCompleteCallback = (result : CreatePushMessageComplete) => void;
359
- export type CreatePushMessageOptions = {
360
- /**
361
- * 是否覆盖上一次提示的消息
362
- * @type boolean
363
- * @defaultValue false
364
- * @uniPlatform {
365
- * "app": {
366
- * "android": {
367
- * "osVer": "4.4",
368
- * "uniVer": "√",
369
- * "unixVer": "3.98"
370
- * },
371
- * "ios": {
372
- * "osVer": "12.0",
373
- * "uniVer": "√",
374
- * "unixVer": "4.18"
375
- * }
376
- * }
377
- * }
378
- */
379
- cover? : boolean | null,
380
- /**
381
- * 提示消息延迟显示的时间,单位为s
382
- * @defaultValue 0
383
- * @uniPlatform {
384
- * "app": {
385
- * "android": {
386
- * "osVer": "4.4",
387
- * "uniVer": "√",
388
- * "unixVer": "3.98"
389
- * },
390
- * "ios": {
391
- * "osVer": "12.0",
392
- * "uniVer": "√",
393
- * "unixVer": "4.18"
394
- * }
395
- * }
396
- * }
397
- */
398
- delay? : number | null,
399
- /**
400
- * 推送消息的图标
401
- * @defaultValue null
402
- * @uniPlatform {
403
- * "app": {
404
- * "android": {
405
- * "osVer": "4.4",
406
- * "uniVer": "√",
407
- * "unixVer": "3.98"
408
- * },
409
- * "ios": {
410
- * "osVer": "12.0",
411
- * "uniVer": "x",
412
- * "unixVer": "x"
413
- * }
414
- * }
415
- * }
416
- */
417
- icon? : string | null,
418
- /**
419
- * 推送消息的提示音
420
- * - system: 使用系统通知提示音(默认值)
421
- * - none: 不使用提示音
422
- * @type 'system' | 'none'
423
- * @defaultValue "system"
424
- * @uniPlatform {
425
- * "app": {
426
- * "android": {
427
- * "osVer": "4.4",
428
- * "uniVer": "√",
429
- * "unixVer": "3.98"
430
- * },
431
- * "ios": {
432
- * "osVer": "12.0",
433
- * "uniVer": "√",
434
- * "unixVer": "4.18"
435
- * }
436
- * }
437
- * }
438
- */
439
- sound? : string | null,
440
- /**
441
- * 推送消息的标题
442
- * @defaultValue App的名称
443
- * @uniPlatform {
444
- * "app": {
445
- * "android": {
446
- * "osVer": "4.4",
447
- * "uniVer": "",
448
- * "unixVer": "3.98"
449
- * },
450
- * "ios": {
451
- * "osVer": "12.0",
452
- * "uniVer": "",
453
- * "unixVer": "4.18"
454
- * }
455
- * }
456
- * }
457
- */
458
- title? : string | null,
459
- /**
460
- * 消息显示的内容,在系统通知中心中显示的文本内容
461
- *
462
- * @uniPlatform {
463
- * "app": {
464
- * "android": {
465
- * "osVer": "4.4",
466
- * "uniVer": "√",
467
- * "unixVer": "3.98"
468
- * },
469
- * "ios": {
470
- * "osVer": "12.0",
471
- * "uniVer": "√",
472
- * "unixVer": "4.18"
473
- * }
474
- * }
475
- * }
476
- */
477
- content : string,
478
- /**
479
- * 消息承载的数据,可根据业务逻辑自定义数据格式
480
- * @defaultValue null
481
- * @uniPlatform {
482
- * "app": {
483
- * "android": {
484
- * "osVer": "4.4",
485
- * "uniVer": "",
486
- * "unixVer": "3.98"
487
- * },
488
- * "ios": {
489
- * "osVer": "12.0",
490
- * "uniVer": "",
491
- * "unixVer": "4.18"
492
- * }
493
- * }
494
- * }
495
- */
496
- payload? : any | null,
497
- /**
498
- * 消息上显示的提示时间
499
- * @defaultValue 当前时间
500
- *
501
- * @uniPlatform {
502
- * "app": {
503
- * "android": {
504
- * "osVer": "4.4",
505
- * "uniVer": "√",
506
- * "unixVer": "3.98"
507
- * },
508
- * "ios": {
509
- * "osVer": "12.0",
510
- * "uniVer": "x",
511
- * "unixVer": "x"
512
- * }
513
- * }
514
- * }
515
- */
516
- when? : number | null,
517
- /**
518
- * 渠道id
519
- * @defaultValue "DcloudChannelID"
520
- * @uniPlatform {
521
- * "app": {
522
- * "android": {
523
- * "osVer": "4.4",
524
- * "uniVer": "",
525
- * "unixVer": "3.98"
526
- * },
527
- * "ios": {
528
- * "osVer": "12.0",
529
- * "uniVer": "x",
530
- * "unixVer": "x"
531
- * }
532
- * }
533
- * }
534
- */
535
- channelId? : string | null,
536
- /**
537
- * 通知类别
538
- * @defaultValue null
539
- * @uniPlatform {
540
- * "app": {
541
- * "android": {
542
- * "osVer": "4.4",
543
- * "uniVer": "√",
544
- * "unixVer": "3.98"
545
- * },
546
- * "ios": {
547
- * "osVer": "12.0",
548
- * "uniVer": "x",
549
- * "unixVer": "x"
550
- * }
551
- * }
552
- * }
553
- */
554
- category? : string | null,
555
- /**
556
- * 接口调用成功的回调函数
557
- * @defaultValue null
558
- */
559
- success : CreatePushMessageSuccessCallback | null,
560
- /**
561
- * 接口调用失败的回调函数
562
- * @defaultValue null
563
- */
564
- fail : CreatePushMessageFailCallback | null,
565
- /**
566
- * 接口调用结束的回调函数(调用成功、失败都会执行)
567
- * @defaultValue null
568
- */
569
- complete : CreatePushMessageCompleteCallback | null
570
- };
66
+ });
67
+ ```
68
+ */
69
+ onPushMessage(callback : OnPushMessageCallback) : void;
70
+ /**
71
+ * offPushMessage()
72
+ * @description
73
+ * 关闭推送消息监听事件,iOS端调用会关闭所有监听。
74
+ * @param {OnPushMessageCallback}
75
+ * @return {void}
76
+ * @tutorial http://uniapp.dcloud.io/api/plugins/push.html#offpushmessage
77
+ * @uniPlatform {
78
+ * "app": {
79
+ * "android": {
80
+ * "osVer": "4.4",
81
+ * "uniVer": "√",
82
+ * "unixVer": "3.98"
83
+ * },
84
+ * "ios": {
85
+ * "osVer": "12.0",
86
+ * "uniVer": "√",
87
+ * "unixVer": "4.18"
88
+ * }
89
+ * },
90
+ * "web": {
91
+ * "uniVer": "x",
92
+ * "unixVer": "x"
93
+ * }
94
+ * }
95
+ * @example
96
+ ```typescript
97
+ const cb = (res : OnPushMessageCallbackResult) => {
98
+ console.log("onPushMessage => " + JSON.stringify(res))
99
+ }
100
+ uni.offPushMessage(cb);
101
+ ```
102
+ */
103
+ offPushMessage(callback : OnPushMessageCallback) : void;
104
+ /**
105
+ * getChannelManager()
106
+ * @description
107
+ * 获取通知渠道管理器,Android 8系统以上才可以设置通知渠道,Android 8系统以下返回null。
108
+ * @deprecated 已废弃,仅为了向下兼容保留,建议使用`getPushChannelManager`。
109
+ * @param {void}
110
+ * @return {ChannelManager}
111
+ * @uniPlatform {
112
+ * "app": {
113
+ * "android": {
114
+ * "osVer": "4.4",
115
+ * "uniVer": "3.98",
116
+ * "unixVer": "3.98"
117
+ * },
118
+ * "ios": {
119
+ * "osVer": "12.0",
120
+ * "uniVer": "x",
121
+ * "unixVer": "x"
122
+ * }
123
+ * },
124
+ * "web": {
125
+ * "uniVer": "x",
126
+ * "unixVer": "x"
127
+ * }
128
+ * }
129
+ * @example
130
+ ```typescript
131
+ const channelManager = uni.getChannelManager();
132
+ channelManager.setPushChannel({
133
+ channelId: "test1",
134
+ channelDesc: "test1 desc",
135
+ soundName: "pushsound"
136
+ })
137
+ const channels = channelManager.getAllChannels() as string[]
138
+ console.log("channels : " + channels);
139
+ ```
140
+ */
141
+ getChannelManager() : ChannelManager;
142
+
143
+ /**
144
+ * getPushChannelManager()
145
+ * @description
146
+ * 获取通知渠道管理器,Android 8系统以上才可以设置通知渠道,Android 8系统以下返回null。
147
+ * @param {void}
148
+ * @return {PushChannelManager}
149
+ * @uniPlatform {
150
+ * "app": {
151
+ * "android": {
152
+ * "osVer": "4.4",
153
+ * "uniVer": "4.24",
154
+ * "unixVer": "4.24"
155
+ * },
156
+ * "ios": {
157
+ * "osVer": "12.0",
158
+ * "uniVer": "x",
159
+ * "unixVer": "x"
160
+ * }
161
+ * },
162
+ * "web": {
163
+ * "uniVer": "x",
164
+ * "unixVer": "x"
165
+ * }
166
+ * }
167
+ * @example
168
+ ```typescript
169
+ const channelManager = uni.getPushChannelManager();
170
+ channelManager.setPushChannel({
171
+ channelId: "test1",
172
+ channelDesc: "test1 desc",
173
+ soundName: "pushsound"
174
+ })
175
+ const channels = channelManager.getAllChannels() as string[]
176
+ console.log("channels : " + channels);
177
+ ```
178
+ */
179
+ getPushChannelManager() : PushChannelManager;
180
+
181
+ /**
182
+ * createPushMessage()
183
+ * @description
184
+ * 创建本地通知栏消息
185
+ * @param {CreatePushMessageOptions}
186
+ * @return {void}
187
+ * @tutorial http://uniapp.dcloud.io/api/plugins/push.html#createpushmessage
188
+ * @uniPlatform {
189
+ * "app": {
190
+ * "android": {
191
+ * "osVer": "4.4",
192
+ * "uniVer": "√",
193
+ * "unixVer": "3.98"
194
+ * },
195
+ * "ios": {
196
+ * "osVer": "12.0",
197
+ * "uniVer": "√",
198
+ * "unixVer": "4.18"
199
+ * }
200
+ * },
201
+ * "web": {
202
+ * "uniVer": "x",
203
+ * "unixVer": "x"
204
+ * }
205
+ * }
206
+ * @example
207
+ ```typescript
208
+ uni.createPushMessage({
209
+ title:"hello",
210
+ content: "content"
211
+ });
212
+ ```
213
+ */
214
+ createPushMessage(options : CreatePushMessageOptions) : void;
215
+
216
+ /**
217
+ * setAppBadgeNumber()
218
+ * @description 设置应用图标上显示的角标数字
219
+ * @param num - 要显示的角标数字值,参数为0则表示清除角标数字。
220
+ * @param options - 小米手机显示角标需要在系统消息中心显示一条通知,此参数用于设置通知的标题(title)和内容(content)。
221
+ * @return {void}
222
+ * @uniPlatform {
223
+ * "app": {
224
+ * "android": {
225
+ * "osVer": "5.0",
226
+ * "uniVer": "x",
227
+ * "unixVer": "4.24"
228
+ * },
229
+ * "ios": {
230
+ * "osVer": "12.0",
231
+ * "uniVer": "x",
232
+ * "unixVer": "4.24"
233
+ * }
234
+ * },
235
+ * "web": {
236
+ * "uniVer": "x",
237
+ * "unixVer": "x"
238
+ * }
239
+ * }
240
+ *
241
+ * @example
242
+ ```typescript
243
+ uni.setAppBadgeNumber(1);
244
+ ```
245
+ */
246
+ setAppBadgeNumber(num : number, options ?: BadgeOptions | null) : void;
247
+ }
248
+
249
+ export type GetPushClientId = (options : GetPushClientIdOptions) => void;
250
+ export type GetPushClientIdSuccess = {
251
+ /**
252
+ * 个推客户端推送id,对应uni-id-device表的push_clientid
253
+ *
254
+ * @uniPlatform {
255
+ * "app": {
256
+ * "android": {
257
+ * "osVer": "4.4",
258
+ * "uniVer": "√",
259
+ * "unixVer": "3.98"
260
+ * },
261
+ * "ios": {
262
+ * "osVer": "12.0",
263
+ * "uniVer": "",
264
+ * "unixVer": "4.18"
265
+ * }
266
+ * },
267
+ * "web": {
268
+ * "uniVer": "x",
269
+ * "unixVer": "x"
270
+ * }
271
+ * }
272
+ */
273
+ cid : string,
274
+ /**
275
+ * 错误描述
276
+ *
277
+ * @uniPlatform {
278
+ * "app": {
279
+ * "android": {
280
+ * "osVer": "4.4",
281
+ * "uniVer": "√",
282
+ * "unixVer": "3.98"
283
+ * },
284
+ * "ios": {
285
+ * "osVer": "12.0",
286
+ * "uniVer": "√",
287
+ * "unixVer": "4.18"
288
+ * }
289
+ * },
290
+ * "web": {
291
+ * "uniVer": "x",
292
+ * "unixVer": "x"
293
+ * }
294
+ * }
295
+ */
296
+ errMsg : string
297
+ };
298
+ export type GetPushClientIdSuccessCallback = (result : GetPushClientIdSuccess) => void;
299
+ export type GetPushClientIdFail = UniError;
300
+ export type GetPushClientIdFailCallback = (result : GetPushClientIdFail) => void;
301
+ export type GetPushClientIdComplete = any;
302
+ export type GetPushClientIdCompleteCallback = (result : GetPushClientIdComplete) => void;
303
+ export type GetPushClientIdOptions = {
304
+ /**
305
+ * 接口调用成功的回调函数
306
+ * @defaultValue null
307
+ */
308
+ success : GetPushClientIdSuccessCallback | null,
309
+ /**
310
+ * 接口调用失败的回调函数
311
+ * @defaultValue null
312
+ */
313
+ fail : GetPushClientIdFailCallback | null,
314
+ /**
315
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
316
+ * @defaultValue null
317
+ */
318
+ complete : GetPushClientIdCompleteCallback | null
319
+ };
320
+ /**
321
+ * 事件类型
322
+ * - click 从系统推送服务点击消息启动应用事件
323
+ * - receive 应用从推送服务器接收到推送消息事件
324
+ */
325
+ export type OnPushMessageType = "click" | "receive";
326
+
327
+ export type OnPushMessageCallbackResult= {
328
+ /**
329
+ * 事件类型
330
+ * @type{OnPushMessageType}
331
+ *
332
+ * @uniPlatform {
333
+ * "app": {
334
+ * "android": {
335
+ * "osVer": "4.4",
336
+ * "uniVer": "√",
337
+ * "unixVer": "3.98"
338
+ * },
339
+ * "ios": {
340
+ * "osVer": "12.0",
341
+ * "uniVer": "√",
342
+ * "unixVer": "4.18"
343
+ * }
344
+ * },
345
+ * "web": {
346
+ * "uniVer": "x",
347
+ * "unixVer": "x"
348
+ * }
349
+ * }
350
+ */
351
+ type : OnPushMessageType,
352
+ /**
353
+ * 消息内容
354
+ *
355
+ * @uniPlatform {
356
+ * "app": {
357
+ * "android": {
358
+ * "osVer": "4.4",
359
+ * "uniVer": "√",
360
+ * "unixVer": "3.98"
361
+ * },
362
+ * "ios": {
363
+ * "osVer": "12.0",
364
+ * "uniVer": "√",
365
+ * "unixVer": "4.18"
366
+ * }
367
+ * },
368
+ * "web": {
369
+ * "uniVer": "x",
370
+ * "unixVer": "x"
371
+ * }
372
+ * }
373
+ */
374
+ data : UTSJSONObject
375
+ };
376
+
377
+ export type OnPushMessageCallback = (result : OnPushMessageCallbackResult) => void;
378
+ export type OnPushMessage = (callback : OnPushMessageCallback) => void;
379
+ export type OffPushMessage = (callback : OnPushMessageCallback) => void;
380
+
381
+
382
+ export type GetChannelManager = () => ChannelManager;
383
+ export type SetPushChannelOptions = {
384
+ /**
385
+ * 添加的声音文件,注意raw目录下必须要有 ,不传此字段将使用默认铃音。
386
+ * @defaultValue null
387
+ */
388
+ soundName? : string | null,
389
+ /**
390
+ * 通知渠道id
391
+ */
392
+ channelId : string,
393
+ /**
394
+ * 通知渠道描述
395
+ */
396
+ channelDesc : string,
397
+ /**
398
+ * 呼吸灯闪烁
399
+ * @defaultValue false
400
+ */
401
+ enableLights? : boolean | null,
402
+ /**
403
+ * 震动
404
+ * @defaultValue false
405
+ */
406
+ enableVibration? : boolean | null,
407
+ /**
408
+ * 通知的重要性级别,可选范围IMPORTANCE_LOW:2、IMPORTANCE_DEFAULT:3、IMPORTANCE_HIGH:4 。
409
+ * @defaultValue 3
410
+ */
411
+ importance? : number | null,
412
+ /**
413
+ * 锁屏可见性,可选范围VISIBILITY_PRIVATE:0、VISIBILITY_PUBLIC:1、VISIBILITY_SECRET:-1、VISIBILITY_NO_OVERRIDE:-1000。
414
+ * @defaultValue -1000
415
+ */
416
+ lockscreenVisibility? : number | null
417
+ }
418
+
419
+ export interface ChannelManager {
420
+ /**
421
+ * 设置推送渠道
422
+ *
423
+ * @uniPlatform {
424
+ * "app": {
425
+ * "android": {
426
+ * "osVer": "4.4",
427
+ * "uniVer": "√",
428
+ * "unixVer": "3.98"
429
+ * },
430
+ * "ios": {
431
+ * "osVer": "12.0",
432
+ * "uniVer": "x",
433
+ * "unixVer": "x"
434
+ * }
435
+ * },
436
+ * "web": {
437
+ * "uniVer": "x",
438
+ * "unixVer": "x"
439
+ * }
440
+ * }
441
+ */
442
+ setPushChannel(options : SetPushChannelOptions) : void;
443
+ /**
444
+ * 获取当前应用注册的所有的通知渠道。
445
+ *
446
+ * @uniPlatform {
447
+ * "app": {
448
+ * "android": {
449
+ * "osVer": "4.4",
450
+ * "uniVer": "√",
451
+ * "unixVer": "3.98"
452
+ * },
453
+ * "ios": {
454
+ * "osVer": "12.0",
455
+ * "uniVer": "x",
456
+ * "unixVer": "x"
457
+ * }
458
+ * },
459
+ * "web": {
460
+ * "uniVer": "x",
461
+ * "unixVer": "x"
462
+ * }
463
+ * }
464
+ */
465
+ getAllChannels() : Array<string>;
466
+ }
467
+
468
+ export type PushChannelManager = ChannelManager
469
+
470
+
471
+ export type CreatePushMessage = (options : CreatePushMessageOptions) => void;
472
+ export type CreatePushMessageSuccess = {};
473
+ export type CreatePushMessageSuccessCallback = (result : CreatePushMessageSuccess) => void;
474
+ export type CreatePushMessageFail = UniError;
475
+ export type CreatePushMessageFailCallback = (result : CreatePushMessageFail) => void;
476
+ export type CreatePushMessageComplete = any;
477
+ export type CreatePushMessageCompleteCallback = (result : CreatePushMessageComplete) => void;
478
+ export type CreatePushMessageOptions = {
479
+ /**
480
+ * 是否覆盖上一次提示的消息
481
+ * @type boolean
482
+ * @defaultValue false
483
+ * @uniPlatform {
484
+ * "app": {
485
+ * "android": {
486
+ * "osVer": "4.4",
487
+ * "uniVer": "√",
488
+ * "unixVer": "3.98"
489
+ * },
490
+ * "ios": {
491
+ * "osVer": "12.0",
492
+ * "uniVer": "",
493
+ * "unixVer": "4.18"
494
+ * }
495
+ * },
496
+ * "web": {
497
+ * "uniVer": "x",
498
+ * "unixVer": "x"
499
+ * }
500
+ * }
501
+ */
502
+ cover? : boolean | null,
503
+ /**
504
+ * 提示消息延迟显示的时间,单位为s
505
+ * @defaultValue 0
506
+ * @uniPlatform {
507
+ * "app": {
508
+ * "android": {
509
+ * "osVer": "4.4",
510
+ * "uniVer": "√",
511
+ * "unixVer": "3.98"
512
+ * },
513
+ * "ios": {
514
+ * "osVer": "12.0",
515
+ * "uniVer": "√",
516
+ * "unixVer": "4.18"
517
+ * }
518
+ * },
519
+ * "web": {
520
+ * "uniVer": "x",
521
+ * "unixVer": "x"
522
+ * }
523
+ * }
524
+ */
525
+ delay? : number | null,
526
+ /**
527
+ * 推送消息的图标
528
+ * @defaultValue null
529
+ * @uniPlatform {
530
+ * "app": {
531
+ * "android": {
532
+ * "osVer": "4.4",
533
+ * "uniVer": "",
534
+ * "unixVer": "3.98"
535
+ * },
536
+ * "ios": {
537
+ * "osVer": "12.0",
538
+ * "uniVer": "x",
539
+ * "unixVer": "x"
540
+ * }
541
+ * },
542
+ * "web": {
543
+ * "uniVer": "x",
544
+ * "unixVer": "x"
545
+ * }
546
+ * }
547
+ */
548
+ icon? : string | null,
549
+ /**
550
+ * 推送消息的提示音
551
+ * - system: 使用系统通知提示音(默认值)
552
+ * - none: 不使用提示音
553
+ * @type 'system' | 'none'
554
+ * @defaultValue "system"
555
+ * @uniPlatform {
556
+ * "app": {
557
+ * "android": {
558
+ * "osVer": "4.4",
559
+ * "uniVer": "√",
560
+ * "unixVer": "3.98"
561
+ * },
562
+ * "ios": {
563
+ * "osVer": "12.0",
564
+ * "uniVer": "√",
565
+ * "unixVer": "4.18"
566
+ * }
567
+ * },
568
+ * "web": {
569
+ * "uniVer": "x",
570
+ * "unixVer": "x"
571
+ * }
572
+ * }
573
+ */
574
+ sound? : string | null,
575
+ /**
576
+ * 推送消息的标题
577
+ * @defaultValue App的名称
578
+ * @uniPlatform {
579
+ * "app": {
580
+ * "android": {
581
+ * "osVer": "4.4",
582
+ * "uniVer": "√",
583
+ * "unixVer": "3.98"
584
+ * },
585
+ * "ios": {
586
+ * "osVer": "12.0",
587
+ * "uniVer": "√",
588
+ * "unixVer": "4.18"
589
+ * }
590
+ * },
591
+ * "web": {
592
+ * "uniVer": "x",
593
+ * "unixVer": "x"
594
+ * }
595
+ * }
596
+ */
597
+ title? : string | null,
598
+ /**
599
+ * 消息显示的内容,在系统通知中心中显示的文本内容
600
+ *
601
+ * @uniPlatform {
602
+ * "app": {
603
+ * "android": {
604
+ * "osVer": "4.4",
605
+ * "uniVer": "√",
606
+ * "unixVer": "3.98"
607
+ * },
608
+ * "ios": {
609
+ * "osVer": "12.0",
610
+ * "uniVer": "√",
611
+ * "unixVer": "4.18"
612
+ * }
613
+ * },
614
+ * "web": {
615
+ * "uniVer": "x",
616
+ * "unixVer": "x"
617
+ * }
618
+ * }
619
+ */
620
+ content : string,
621
+ /**
622
+ * 消息承载的数据,可根据业务逻辑自定义数据格式
623
+ * @defaultValue null
624
+ * @uniPlatform {
625
+ * "app": {
626
+ * "android": {
627
+ * "osVer": "4.4",
628
+ * "uniVer": "√",
629
+ * "unixVer": "3.98"
630
+ * },
631
+ * "ios": {
632
+ * "osVer": "12.0",
633
+ * "uniVer": "√",
634
+ * "unixVer": "4.18"
635
+ * }
636
+ * },
637
+ * "web": {
638
+ * "uniVer": "x",
639
+ * "unixVer": "x"
640
+ * }
641
+ * }
642
+ */
643
+ payload? : any | null,
644
+ /**
645
+ * 消息上显示的提示时间
646
+ * @defaultValue 当前时间
647
+ *
648
+ * @uniPlatform {
649
+ * "app": {
650
+ * "android": {
651
+ * "osVer": "4.4",
652
+ * "uniVer": "√",
653
+ * "unixVer": "3.98"
654
+ * },
655
+ * "ios": {
656
+ * "osVer": "12.0",
657
+ * "uniVer": "x",
658
+ * "unixVer": "x"
659
+ * }
660
+ * },
661
+ * "web": {
662
+ * "uniVer": "x",
663
+ * "unixVer": "x"
664
+ * }
665
+ * }
666
+ */
667
+ when? : number | null,
668
+ /**
669
+ * 渠道id
670
+ * @defaultValue "DcloudChannelID"
671
+ * @uniPlatform {
672
+ * "app": {
673
+ * "android": {
674
+ * "osVer": "4.4",
675
+ * "uniVer": "√",
676
+ * "unixVer": "3.98"
677
+ * },
678
+ * "ios": {
679
+ * "osVer": "12.0",
680
+ * "uniVer": "x",
681
+ * "unixVer": "x"
682
+ * }
683
+ * },
684
+ * "web": {
685
+ * "uniVer": "x",
686
+ * "unixVer": "x"
687
+ * }
688
+ * }
689
+ */
690
+ channelId? : string | null,
691
+ /**
692
+ * 通知类别
693
+ * @defaultValue null
694
+ * @uniPlatform {
695
+ * "app": {
696
+ * "android": {
697
+ * "osVer": "4.4",
698
+ * "uniVer": "√",
699
+ * "unixVer": "3.98"
700
+ * },
701
+ * "ios": {
702
+ * "osVer": "12.0",
703
+ * "uniVer": "x",
704
+ * "unixVer": "x"
705
+ * }
706
+ * },
707
+ * "web": {
708
+ * "uniVer": "x",
709
+ * "unixVer": "x"
710
+ * }
711
+ * }
712
+ */
713
+ category? : string | null,
714
+ /**
715
+ * 接口调用成功的回调函数
716
+ * @defaultValue null
717
+ */
718
+ success : CreatePushMessageSuccessCallback | null,
719
+ /**
720
+ * 接口调用失败的回调函数
721
+ * @defaultValue null
722
+ */
723
+ fail : CreatePushMessageFailCallback | null,
724
+ /**
725
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
726
+ * @defaultValue null
727
+ */
728
+ complete : CreatePushMessageCompleteCallback | null
729
+ };
730
+
731
+
732
+ export type BadgeOptions = {
733
+ /**
734
+ * 消息的标题
735
+ * @defaultValue 应用的名称
736
+ * @uniPlatform {
737
+ * "app": {
738
+ * "android": {
739
+ * "osVer": "4.4",
740
+ * "uniVer": "x",
741
+ * "unixVer": "4.24"
742
+ * },
743
+ * "ios": {
744
+ * "osVer": "12.0",
745
+ * "uniVer": "x",
746
+ * "unixVer": "4.24"
747
+ * }
748
+ * },
749
+ * "web": {
750
+ * "uniVer": "x",
751
+ * "unixVer": "x"
752
+ * }
753
+ * }
754
+ */
755
+ title ?: string | null,
756
+ /**
757
+ * 消息的内容
758
+ * @defaultValue '您有x条未读消息',其中x未设置的角标数字值。
759
+ * @uniPlatform {
760
+ * "app": {
761
+ * "android": {
762
+ * "osVer": "4.4",
763
+ * "uniVer": "x",
764
+ * "unixVer": "4.24"
765
+ * },
766
+ * "ios": {
767
+ * "osVer": "12.0",
768
+ * "uniVer": "x",
769
+ * "unixVer": "4.24"
770
+ * }
771
+ * },
772
+ * "web": {
773
+ * "uniVer": "x",
774
+ * "unixVer": "x"
775
+ * }
776
+ * }
777
+ */
778
+ content ?: string | null
779
+ }