@dcloudio/uni-app-x 0.6.1 → 0.6.3

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": "@dcloudio/uni-app-x",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "uni-app x types",
5
5
  "typings": "index.d.ts",
6
6
  "author": "DCloud",
@@ -1,10 +1,11 @@
1
1
  import { IPageManager } from "./IPageManager"
2
+ import { NativeLoadFontFaceOptions } from "./NativeLoadFontFaceOptions"
2
3
 
3
4
  /**
4
5
  * @package io.dcloud.uniapp.runtime
5
6
  * @autodoc false
6
7
  */
7
- export class IApp {
8
+ export interface IApp {
8
9
  appid: string
9
10
  pageManager: IPageManager
10
11
 
@@ -21,7 +22,7 @@ export class IApp {
21
22
 
22
23
  getAppStartDuration(): number
23
24
 
24
- loadFontFace(options: LoadFontFaceOptions): void
25
+ loadFontFace(options: NativeLoadFontFaceOptions): void
25
26
 
26
27
  getRedirectInfo(): Map<string, any | null>
27
28
  }
@@ -0,0 +1,11 @@
1
+ import { UniError } from './UniError'
2
+
3
+ export class NativeLoadFontFaceFail extends UniError { }
4
+
5
+ export class NativeLoadFontFaceOptions {
6
+ family?: string | null
7
+ source?: string | null
8
+ success?: (res: any) => void
9
+ fail?: (res: NativeLoadFontFaceFail) => void
10
+ complete?: (res: any) => void
11
+ }
@@ -68,6 +68,8 @@ import {
68
68
  NodeData as NodeDataOrigin,
69
69
  INodeData as INodeDataOrigin,
70
70
  NestedPreScrollEvent as NestedPreScrollEventOrigin,
71
+ NativeLoadFontFaceFail as NativeLoadFontFaceFailOrigin,
72
+ NativeLoadFontFaceOptions as NativeLoadFontFaceOptionsOrigin,
71
73
  MouseEvent as MouseEventOrigin,
72
74
  InputKeyboardHeightChangeEvent as InputKeyboardHeightChangeEventOrigin,
73
75
  InputFocusEvent as InputFocusEventOrigin,
@@ -208,6 +210,10 @@ declare global {
208
210
  type INodeData = INodeDataOrigin
209
211
  const NestedPreScrollEvent: typeof NestedPreScrollEventOrigin
210
212
  type NestedPreScrollEvent = NestedPreScrollEventOrigin
213
+ const NativeLoadFontFaceFail: typeof NativeLoadFontFaceFailOrigin
214
+ type NativeLoadFontFaceFail = NativeLoadFontFaceFailOrigin
215
+ const NativeLoadFontFaceOptions: typeof NativeLoadFontFaceOptionsOrigin
216
+ type NativeLoadFontFaceOptions = NativeLoadFontFaceOptionsOrigin
211
217
  const MouseEvent: typeof MouseEventOrigin
212
218
  type MouseEvent = MouseEventOrigin
213
219
  const InputKeyboardHeightChangeEvent: typeof InputKeyboardHeightChangeEventOrigin
@@ -242,7 +248,6 @@ declare global {
242
248
  type INavigationBar = INavigationBarOrigin
243
249
  type IDocument = IDocumentOrigin
244
250
  type IComment = ICommentOrigin
245
- const IApp: typeof IAppOrigin
246
251
  type IApp = IAppOrigin
247
252
  const Event: typeof EventOrigin
248
253
  type Event = EventOrigin
@@ -36,6 +36,7 @@ export * from './PageScrollEvent'
36
36
  export * from './PageEvent'
37
37
  export * from './NodeData'
38
38
  export * from './NestedPreScrollEvent'
39
+ export * from './NativeLoadFontFaceOptions'
39
40
  export * from './MouseEvent'
40
41
  export * from './InputKeyboardHeightChangeEvent'
41
42
  export * from './InputFocusEvent'
package/types/page.d.ts CHANGED
@@ -168,7 +168,7 @@ interface OnResizeOptions {
168
168
  size: OnResizeSize
169
169
  }
170
170
 
171
- interface ShareAppMessageOption {
171
+ interface OnShareAppMessageOption {
172
172
  /**
173
173
  * 转发事件来源。
174
174
  * 可选值:
@@ -186,7 +186,7 @@ interface ShareAppMessageOption {
186
186
  webViewUrl?: string;
187
187
  }
188
188
 
189
- interface AddToFavoritesOption {
189
+ interface OnAddToFavoritesOption {
190
190
  /**
191
191
  * 转发事件来源。
192
192
  * 可选值:
@@ -215,7 +215,7 @@ interface CustomFavoritesContent {
215
215
  imageUrl?: string;
216
216
  }
217
217
 
218
- interface TabItemTapOption {
218
+ interface OnTabItemTapOption {
219
219
  /**
220
220
  * 被点击 tabItem 的序号,从0开始
221
221
  */
@@ -230,7 +230,7 @@ interface TabItemTapOption {
230
230
  text: string;
231
231
  }
232
232
 
233
- interface NavigationBarButtonTapOption {
233
+ interface OnNavigationBarButtonTapOption {
234
234
  /**
235
235
  * 原生标题栏按钮数组的下标
236
236
  */
@@ -246,15 +246,6 @@ type Record<K extends keyof any, T> = {
246
246
 
247
247
  type NativeMap<K extends string, V> = Map<K, V> & Record<K, V>
248
248
 
249
- type OnLoadOptions = NativeMap<string, any>
250
-
251
- interface OnBackPressOptions {
252
- /**
253
- * - backbutton 顶部导航栏左边的返回按钮或 Android 实体返回键
254
- * - navigateBack 返回 API,即 uni.navigateBack()
255
- */
256
- from: 'backbutton' | 'navigateBack';
257
- }
258
249
 
259
250
  interface NavigationBarSearchInputEvent {
260
251
  /**
@@ -268,10 +259,6 @@ interface PageInstanceBaseProps<D extends AnyObject = any> {
268
259
  * 到当前页面的路径,类型为 `String`
269
260
  */
270
261
  route?: string;
271
- /**
272
- * 获取当前页面的webview对象实例。仅 App 平台支持
273
- */
274
- $getAppWebview?: () => PlusWebviewWebviewObject;
275
262
  /**
276
263
  * 当前页面的 Vue 实例
277
264
  */
@@ -895,7 +882,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
895
882
  * }
896
883
  *}
897
884
  */
898
- onShareAppMessage?(options: ShareAppMessageOption): CustomShareContent | Promise<Omit<CustomShareContent, "promise">>;
885
+ onShareAppMessage?(options: OnShareAppMessageOption): CustomShareContent | Promise<Omit<CustomShareContent, "promise">>;
899
886
  /**
900
887
  * 用户点击右上角转发到朋友圈
901
888
  *
@@ -1031,7 +1018,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1031
1018
  * }
1032
1019
  *}
1033
1020
  */
1034
- onAddToFavorites?(options: AddToFavoritesOption): CustomFavoritesContent;
1021
+ onAddToFavorites?(options: OnAddToFavoritesOption): CustomFavoritesContent;
1035
1022
  /**
1036
1023
  * 页面滚动触发事件的处理函数
1037
1024
  *
@@ -1100,7 +1087,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1100
1087
  * }
1101
1088
  *}
1102
1089
  */
1103
- onPageScroll?(options: PageScrollOption): void;
1090
+ onPageScroll?(options: OnPageScrollOptions): void;
1104
1091
  /**
1105
1092
  * 页面尺寸改变时触发
1106
1093
  * @param options 页面滚动参数
@@ -1167,7 +1154,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1167
1154
  * }
1168
1155
  *}
1169
1156
  */
1170
- onResize?(options: ResizeOption): void;
1157
+ onResize?(options: OnResizeOptions): void;
1171
1158
  /**
1172
1159
  * 当前是 tab 页时,点击 tab 时触发
1173
1160
  * @param options tab 点击参数
@@ -1234,7 +1221,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1234
1221
  * }
1235
1222
  *}
1236
1223
  */
1237
- onTabItemTap?(options: TabItemTapOption): void;
1224
+ onTabItemTap?(options: OnTabItemTapOption): void;
1238
1225
  /**
1239
1226
  * 监听原生标题栏按钮点击事件
1240
1227
  * @param options tab 点击参数
@@ -1301,7 +1288,7 @@ interface PageInstance<D extends AnyObject = any, T extends AnyObject = any> ext
1301
1288
  * }
1302
1289
  *}
1303
1290
  */
1304
- onNavigationBarButtonTap?(options: NavigationBarButtonTapOption): void;
1291
+ onNavigationBarButtonTap?(options: OnNavigationBarButtonTapOption): void;
1305
1292
  /**
1306
1293
  * 监听页面返回
1307
1294
  * @param options tab 点击参数
@@ -1580,7 +1567,15 @@ declare global {
1580
1567
  * `getCurrentPages()` 函数用于获取当前页面栈的实例,以数组形式按栈的顺序给出,数组中的元素为页面实例,第一个元素为首页,最后一个元素为当前页面。
1581
1568
  * @tutorial https://uniapp.dcloud.net.cn/tutorial/page.html#getcurrentpages
1582
1569
  */
1583
- const getCurrentPages: () => BasePage[]
1570
+ const getCurrentPages: () => BasePage[]
1571
+ type OnLoadOptions = NativeMap<string, any>
1572
+ interface OnBackPressOptions {
1573
+ /**
1574
+ * - backbutton 顶部导航栏左边的返回按钮或 Android 实体返回键
1575
+ * - navigateBack 返回 API,即 uni.navigateBack()
1576
+ */
1577
+ from: 'backbutton' | 'navigateBack';
1578
+ }
1584
1579
  }
1585
1580
 
1586
1581
  declare module '@vue/runtime-core' {
@@ -4,11 +4,28 @@ export type ReadFileSuccessResult = {
4
4
  }
5
5
 
6
6
 
7
- export type ReadFileSuccessCallback = (res: ReadFileSuccessResult) => void
7
+ /**
8
+ * 通用的正确返回结果
9
+ */
10
+ export type FileManagerSuccessResult = {
11
+ errMsg: string,
12
+ }
13
+ /**
14
+ * 通用的正确返回结果回调
15
+ */
16
+ export type FileManagerSuccessCallback = (res: FileManagerSuccessResult) => void
17
+ /**
18
+ * 通用的错误返回结果回调
19
+ */
20
+ export type FileManagerFailCallback = (res: UniError) => void
21
+ /**
22
+ * 通用的结束返回结果回调
23
+ */
24
+ export type FileManagerCompleteCallback = (res: any) => void
8
25
 
9
- export type ReadFileFailCallback = (res: UniError) => void
10
26
 
11
- export type ReadFileCompleteCallback = (res: any) => void
27
+
28
+ export type ReadFileSuccessCallback = (res: ReadFileSuccessResult) => void
12
29
 
13
30
 
14
31
 
@@ -28,53 +45,275 @@ export type ReadFileOptions = {
28
45
  /**
29
46
  * 接口调用失败的回调函数
30
47
  */
31
- fail?: ReadFileFailCallback | null,
48
+ fail?: FileManagerFailCallback | null,
32
49
  /**
33
50
  * 接口调用结束的回调函数(调用成功、失败都会执行)
34
51
  */
35
- complete?: ReadFileCompleteCallback | null
52
+ complete?: FileManagerCompleteCallback | null
36
53
  }
37
54
 
38
55
 
39
- export type WriteFileSuccessResult = {
56
+
57
+
58
+
59
+ export type WriteFileOptions = {
60
+ /**
61
+ * 文件路径,只支持绝对地址
62
+ */
40
63
  filePath: string,
64
+ /**
65
+ * 写入的文本内容
66
+ */
67
+ data: string,
68
+ /**
69
+ * 接口调用的回调函数
70
+ */
71
+ success?: FileManagerSuccessCallback | null,
72
+ /**
73
+ * 接口调用失败的回调函数
74
+ */
75
+ fail?: FileManagerFailCallback | null,
76
+ /**
77
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
78
+ */
79
+ complete?: FileManagerCompleteCallback | null
41
80
  }
42
81
 
43
82
 
44
- export type WriteFileSuccessCallback = (res: WriteFileSuccessResult) => void
45
83
 
46
- export type WriteFileFailCallback = (res: UniError) => void
84
+ export type UnLinkSuccessCallback = (res: FileManagerSuccessResult) => void
47
85
 
48
- export type WriteFileCompleteCallback = (res: any) => void
49
86
 
50
87
 
51
- export type WriteFileOptions = {
88
+ export type UnLinkOptions = {
52
89
  /**
53
90
  * 文件路径,只支持绝对地址
54
91
  */
55
92
  filePath: string,
56
93
  /**
57
- * 写入的文本内容
94
+ * 接口调用的回调函数
58
95
  */
59
- data: string,
96
+ success?: UnLinkSuccessCallback | null,
97
+ /**
98
+ * 接口调用失败的回调函数
99
+ */
100
+ fail?: FileManagerFailCallback | null,
101
+ /**
102
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
103
+ */
104
+ complete?: FileManagerCompleteCallback | null
105
+ }
106
+
107
+ export type MkDirSuccessCallback = (res: FileManagerSuccessResult) => void
108
+
109
+
110
+
111
+
112
+ export type MkDirOptions = {
113
+ /**
114
+ * 创建的目录路径 (本地路径)
115
+ */
116
+ dirPath: string,
117
+ /**
118
+ *是否在递归创建该目录的上级目录后再创建该目录。如果对应的上级目录已经存在,则不创建该上级目录。如 dirPath 为 a/b/c/d 且 recursive 为 true,将创建 a 目录,再在 a 目录下创建 b 目录,以此类推直至创建 a/b/c 目录下的 d 目录。
119
+ */
120
+ recursive: boolean,
121
+ /**
122
+ * 接口调用的回调函数
123
+ */
124
+ success?: MkDirSuccessCallback | null,
125
+ /**
126
+ * 接口调用失败的回调函数
127
+ */
128
+ fail?: FileManagerFailCallback | null,
129
+ /**
130
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
131
+ */
132
+ complete?: FileManagerCompleteCallback | null
133
+ }
134
+
135
+
136
+ export type RmDirSuccessCallback = (res: FileManagerSuccessResult) => void
137
+
138
+
139
+
140
+
141
+ export type RmDirOptions = {
142
+ /**
143
+ * 要删除的目录路径 (本地路径)
144
+ */
145
+ dirPath: string,
146
+ /**
147
+ *是否递归删除目录。如果为 true,则删除该目录和该目录下的所有子目录以及文件。
148
+ */
149
+ recursive: boolean,
60
150
  /**
61
151
  * 接口调用的回调函数
62
152
  */
63
- success?: WriteFileSuccessCallback | null,
153
+ success?: MkDirSuccessCallback | null,
64
154
  /**
65
155
  * 接口调用失败的回调函数
66
156
  */
67
- fail?: WriteFileFailCallback | null,
157
+ fail?: FileManagerFailCallback | null,
68
158
  /**
69
159
  * 接口调用结束的回调函数(调用成功、失败都会执行)
70
160
  */
71
- complete?: WriteFileCompleteCallback | null
161
+ complete?: FileManagerCompleteCallback | null
72
162
  }
73
163
 
74
164
 
165
+ export type ReadDirSuccessResult = {
166
+ files: string[],
167
+ }
168
+
169
+ export type ReadDirSuccessCallback = (res: ReadDirSuccessResult) => void
170
+
171
+
172
+ export type ReadDirOptions = {
173
+ /**
174
+ * 要读取的目录路径 (本地路径)
175
+ */
176
+ dirPath: string,
177
+
178
+ /**
179
+ * 接口调用的回调函数
180
+ */
181
+ success?: ReadDirSuccessCallback | null,
182
+ /**
183
+ * 接口调用失败的回调函数
184
+ */
185
+ fail?: FileManagerFailCallback | null,
186
+ /**
187
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
188
+ */
189
+ complete?: FileManagerCompleteCallback | null
190
+ }
191
+
192
+
193
+
194
+
195
+ export type AccessOptions = {
196
+ /**
197
+ * 要删除的目录路径 (本地路径)
198
+ */
199
+ path: string,
200
+
201
+ /**
202
+ * 接口调用的回调函数
203
+ */
204
+ success?: FileManagerSuccessCallback | null,
205
+ /**
206
+ * 接口调用失败的回调函数
207
+ */
208
+ fail?: FileManagerFailCallback | null,
209
+ /**
210
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
211
+ */
212
+ complete?: FileManagerCompleteCallback | null
213
+ }
214
+
215
+ export type RenameOptions = {
216
+ /**
217
+ * 源文件路径,支持本地路径
218
+ */
219
+ oldPath: string,
220
+ /**
221
+ * 新文件路径,支持本地路径
222
+ */
223
+ newPath: string,
224
+
225
+ /**
226
+ * 接口调用的回调函数
227
+ */
228
+ success?: FileManagerSuccessCallback | null,
229
+ /**
230
+ * 接口调用失败的回调函数
231
+ */
232
+ fail?: FileManagerFailCallback | null,
233
+ /**
234
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
235
+ */
236
+ complete?: FileManagerCompleteCallback | null
237
+ }
238
+
239
+ export type CopyFileOptions = {
240
+ /**
241
+ * 源文件路径,支持本地路径
242
+ */
243
+ srcPath: string,
244
+ /**
245
+ * 新文件路径,支持本地路径
246
+ */
247
+ destPath: string,
248
+
249
+ /**
250
+ * 接口调用的回调函数
251
+ */
252
+ success?: FileManagerSuccessCallback | null,
253
+ /**
254
+ * 接口调用失败的回调函数
255
+ */
256
+ fail?: FileManagerFailCallback | null,
257
+ /**
258
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
259
+ */
260
+ complete?: FileManagerCompleteCallback | null
261
+ }
262
+
263
+
264
+ export type GetFileInfoSuccessResult = {
265
+ digest: string,
266
+ size:number,
267
+ errMsg:string
268
+ }
269
+
270
+ export type GetFileInfoSuccessCallback = (res: GetFileInfoSuccessResult) => void
271
+
272
+ export type GetFileInfoOptions = {
273
+ /**
274
+ * 要读取的文件路径 (本地路径)
275
+ */
276
+ filePath: string,
277
+ /**
278
+ * md5 / sha1
279
+ */
280
+ digestAlgorithm: string|null,
281
+ /**
282
+ * 接口调用的回调函数
283
+ */
284
+ success?: GetFileInfoSuccessCallback | null,
285
+ /**
286
+ * 接口调用失败的回调函数
287
+ */
288
+ fail?: FileManagerFailCallback | null,
289
+ /**
290
+ * 接口调用结束的回调函数(调用成功、失败都会执行)
291
+ */
292
+ complete?: FileManagerCompleteCallback | null
293
+ }
294
+
295
+
296
+
75
297
  export interface FileSystemManager {
76
298
  readFile(config: ReadFileOptions): void;
299
+ // readFileSync(filePath: string,encoding:string): string|null;
77
300
  writeFile(config: WriteFileOptions): void;
301
+ // writeFileSync(filePath: string,data:string): number;
302
+ unlink(config: UnLinkOptions): void;
303
+ // unlinkSync(filePath: string): number;
304
+ mkdir(config: MkDirOptions): void;
305
+ // mkdirSync(dirPath: string,recursive:boolean): number;
306
+ rmdir(config: RmDirOptions): void;
307
+ // rmdirSync(dirPath: string,recursive:boolean): number;
308
+ readdir(config: ReadDirOptions): void;
309
+ // readdirSync(dirPath: string): string[] | null;
310
+ access(config: AccessOptions): void;
311
+ // accessSync(path: string): number;
312
+ rename(config: RenameOptions): void;
313
+ // renameSync(oldPath:string,newPath:string): number;
314
+ copyFile(config: CopyFileOptions): void;
315
+ // copyFileSync(srcPath:string,destPath:string): number;
316
+ getFileInfo(config: GetFileInfoOptions): void;
78
317
  }
79
318
 
80
319
 
@@ -17,7 +17,6 @@ import {
17
17
  LoginComplete as LoginCompleteOrigin,
18
18
  LoginCompleteCallback as LoginCompleteCallbackOrigin,
19
19
  UniverifyErrorCode as UniverifyErrorCodeOrigin,
20
- UniverifyErrorCode as UniverifyErrorCodeOrigin,
21
20
  InternalResponse as InternalResponseOrigin,
22
21
  Uni as UniOrigin
23
22
  } from './interface'
@@ -40,7 +39,6 @@ declare global {
40
39
  type LoginComplete = LoginCompleteOrigin
41
40
  type LoginCompleteCallback = LoginCompleteCallbackOrigin
42
41
  type UniverifyErrorCode = UniverifyErrorCodeOrigin
43
- type UniverifyErrorCode = UniverifyErrorCodeOrigin
44
42
  type InternalResponse = InternalResponseOrigin
45
43
  interface Uni extends UniOrigin { }
46
44
  }
@@ -94,7 +94,7 @@ export interface UniverifyManager {
94
94
  * }
95
95
  * }
96
96
  */
97
- isPreLoginResultValid() : boolean
97
+ isPreLoginValid() : boolean
98
98
  }
99
99
 
100
100
  /**
@@ -150,7 +150,7 @@ export type LoginSuccess = {
150
150
  /**
151
151
  * 登录授权唯一标识
152
152
  */
153
- openid : string,
153
+ openId : string,
154
154
  /**
155
155
  * token
156
156
  */
@@ -171,7 +171,6 @@ export type LoginCompleteCallback = (res : LoginComplete) => void
171
171
  * 30005 预登录失败
172
172
  * 30006 一键登录失败
173
173
  */
174
- // export type UniverifyErrorCode = 30002 | 30003 | 30004 | 30005 | 30006;
175
174
  export type UniverifyErrorCode = 30004 | 30005 | 30006;
176
175
 
177
176
  /**
@@ -6,6 +6,8 @@ import {
6
6
  ConnectSocketFail as ConnectSocketFailOrigin,
7
7
  ConnectSocketOptions as ConnectSocketOptionsOrigin,
8
8
  GeneralCallbackResult as GeneralCallbackResultOrigin,
9
+ SendSocketMessageErrorCode as SendSocketMessageErrorCodeOrigin,
10
+ SendSocketMessageFail as SendSocketMessageFailOrigin,
9
11
  SendSocketMessageOptions as SendSocketMessageOptionsOrigin,
10
12
  CloseSocketOptions as CloseSocketOptionsOrigin,
11
13
  OnSocketOpenCallbackResult as OnSocketOpenCallbackResultOrigin,
@@ -33,6 +35,8 @@ declare global {
33
35
  type ConnectSocketFail = ConnectSocketFailOrigin
34
36
  type ConnectSocketOptions = ConnectSocketOptionsOrigin
35
37
  type GeneralCallbackResult = GeneralCallbackResultOrigin
38
+ type SendSocketMessageErrorCode = SendSocketMessageErrorCodeOrigin
39
+ type SendSocketMessageFail = SendSocketMessageFailOrigin
36
40
  type SendSocketMessageOptions = SendSocketMessageOptionsOrigin
37
41
  type CloseSocketOptions = CloseSocketOptionsOrigin
38
42
  type OnSocketOpenCallbackResult = OnSocketOpenCallbackResultOrigin
@@ -264,6 +264,19 @@ export type GeneralCallbackResult = {
264
264
  * 错误信息
265
265
  */
266
266
  errMsg: string
267
+ };
268
+ /**
269
+ * 错误码
270
+ * - 10001 发送数据超限,发送队列不能超过16M大小。
271
+ * - 10002 websocket未连接
272
+ * - 602001 websocket系统错误
273
+ */
274
+ export type SendSocketMessageErrorCode = 10001 | 10002 | 602001;
275
+ /**
276
+ * 发送失败的错误回调参数
277
+ */
278
+ export interface SendSocketMessageFail extends IUniError {
279
+ errCode: SendSocketMessageErrorCode;
267
280
  };
268
281
  export type SendSocketMessageOptions = {
269
282
  /**
@@ -281,12 +294,12 @@ export type SendSocketMessageOptions = {
281
294
  * 接口调用失败的回调函数
282
295
  * @defaultValue null
283
296
  */
284
- fail?: ((result: GeneralCallbackResult) => void) | null,
297
+ fail?: ((result: SendSocketMessageFail) => void) | null,
285
298
  /**
286
299
  * 接口调用结束的回调函数(调用成功、失败都会执行)
287
300
  * @defaultValue null
288
301
  */
289
- complete?: ((result: GeneralCallbackResult) => void) | null
302
+ complete?: ((result: any) => void) | null
290
303
  };
291
304
  export type CloseSocketOptions = {
292
305
  /**