@hyext/types-ext-sdk-hy 3.17.0-beta.2 → 3.17.0-beta.20

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 (2) hide show
  1. package/index.d.ts +379 -44
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -474,7 +474,7 @@ type DestroyAdReq = {
474
474
 
475
475
  /**
476
476
  * 关闭信息
477
- * @property isEnded - 是否看完
477
+ * @property isEnded - 是否看完, 1-看完, 0-未看完
478
478
  */
479
479
  type CloseInfo = {
480
480
  isEnded: boolean;
@@ -853,6 +853,12 @@ namespace advance {
853
853
  * @param params - 礼物信息
854
854
  */
855
855
  function sendGiftToUser(params: SendGiftTUInfo): Promise<void>;
856
+ /**
857
+ * 定制送礼接口
858
+ * @param params - 参数
859
+ * @returns 调用结果
860
+ */
861
+ function sendActivityGift(params: SendActivityGiftReq): Promise<SendActivityGiftRsp>;
856
862
  /**
857
863
  * 获取交友直播间上麦用户信息
858
864
  * @returns 上麦用户信息列表
@@ -992,6 +998,24 @@ namespace advance {
992
998
  * @returns 调用结果
993
999
  */
994
1000
  function offCommonQueueStatusChange(params: OffCommonQueueStatusChangeReq): Promise<void>;
1001
+ /**
1002
+ * 获取直播间当前特效状态
1003
+ * @param params - 参数
1004
+ * @returns 调用结果
1005
+ */
1006
+ function getLiveroomEffectStatus(params: GetLiveroomEffectStatusReq): Promise<GetLiveroomEffectStatusRsp>;
1007
+ /**
1008
+ * 监听直播间特效状态变化
1009
+ * @param params - 参数
1010
+ * @returns 调用结果
1011
+ */
1012
+ function onLiveroomEffectStatusChange(params: OnLiveroomEffectStatusChangeReq): Promise<void>;
1013
+ /**
1014
+ * 取消监听直播间特效状态变化
1015
+ * @param params - 参数
1016
+ * @returns 调用结果
1017
+ */
1018
+ function offLiveroomEffectStatusChange(params: OffLiveroomEffectStatusChangeReq): Promise<void>;
995
1019
  }
996
1020
 
997
1021
  /**
@@ -1309,6 +1333,38 @@ type SendGiftTUInfo = {
1309
1333
  mapParam?: any;
1310
1334
  };
1311
1335
 
1336
+ /**
1337
+ * 定制送礼接口结果
1338
+ * @property code - 端上送礼结果返回, 0-成功, 1-余额不足, 2-弹窗确认是否送出, 3-需要鉴权的礼物没有这个身份(比如守护、贵族), 4-断网
1339
+ * @property err - 错误信息
1340
+ * @property consumeRsp - 接口回包的base64字符串
1341
+ */
1342
+ type SendActivityGiftRsp = {
1343
+ code: number;
1344
+ err: string;
1345
+ consumeRsp: string;
1346
+ };
1347
+
1348
+ /**
1349
+ * 定制送礼接口参数
1350
+ * @property giftId - giftId
1351
+ * @property giftCount - giftCount
1352
+ * @property [useSelectMic] - useSelectMic
1353
+ * @property sourceType - sourceTyp
1354
+ * @property [mapParam] - mapParam
1355
+ * @property [uid] - uid
1356
+ * @property [secondConfirm] - secondConfirm
1357
+ */
1358
+ type SendActivityGiftReq = {
1359
+ giftId: number;
1360
+ giftCount: number;
1361
+ useSelectMic?: boolean;
1362
+ sourceType: string;
1363
+ mapParam?: any;
1364
+ uid?: string;
1365
+ secondConfirm?: boolean;
1366
+ };
1367
+
1312
1368
  /**
1313
1369
  * 上麦用户信息
1314
1370
  * @property uid - 用户的uid
@@ -1671,6 +1727,55 @@ type OffCommonQueueStatusChangeReq = {
1671
1727
  type: string;
1672
1728
  };
1673
1729
 
1730
+ /**
1731
+ * 获取直播间当前特效状态结果
1732
+ * @property id - 当前生效的特效,id为空则表示没有此类型的特效在播
1733
+ */
1734
+ type GetLiveroomEffectStatusRsp = {
1735
+ id: string;
1736
+ };
1737
+
1738
+ /**
1739
+ * 获取直播间当前特效状态参数
1740
+ * @property type - 类型
1741
+ */
1742
+ type GetLiveroomEffectStatusReq = {
1743
+ type: string;
1744
+ };
1745
+
1746
+ /**
1747
+ * 队列状态变化
1748
+ * @property id - 特效id
1749
+ * @property status - 状态, show-显示, hide-隐藏
1750
+ */
1751
+ type LiveroomEffectStatus = {
1752
+ id: string;
1753
+ status: string;
1754
+ };
1755
+
1756
+ /**
1757
+ * @param status - 回调参数
1758
+ */
1759
+ type LiveroomEffectStatusChange = (status: LiveroomEffectStatus) => void;
1760
+
1761
+ /**
1762
+ * 监听直播间特效状态变化参数
1763
+ * @property type - 类型
1764
+ * @property callback - 特效状态变化回调
1765
+ */
1766
+ type OnLiveroomEffectStatusChangeReq = {
1767
+ type: string;
1768
+ callback: LiveroomEffectStatusChange;
1769
+ };
1770
+
1771
+ /**
1772
+ * 取消监听直播间特效状态变化参数
1773
+ * @property type - 类型
1774
+ */
1775
+ type OffLiveroomEffectStatusChangeReq = {
1776
+ type: string;
1777
+ };
1778
+
1674
1779
  /**
1675
1780
  * app模块
1676
1781
  */
@@ -1724,6 +1829,129 @@ function onAppear(callback: LifeCallback): void;
1724
1829
  */
1725
1830
  function onDisappear(callback: LifeCallback): void;
1726
1831
 
1832
+ /**
1833
+ * audio模块
1834
+ */
1835
+ namespace audio {
1836
+ /**
1837
+ * 创建音频播放器
1838
+ * @param params - 传入参数
1839
+ * @returns 调用结果
1840
+ */
1841
+ function createAudio(params: CreateAudioReq): Promise<CreateAudioRsp>;
1842
+ /**
1843
+ * 监听音频播放器事件
1844
+ * @param params - 传入参数
1845
+ * @returns 调用结果
1846
+ */
1847
+ function onAudioNotices(params: OnAudioNoticesReq): Promise<void>;
1848
+ /**
1849
+ * 取消监听音频播放器事件
1850
+ * @param [params] - 传入参数
1851
+ * @returns 调用结果
1852
+ */
1853
+ function offAudioNotices(params?: OffAudioNoticesReq): Promise<void>;
1854
+ /**
1855
+ * 播放音频
1856
+ * @param params - 传入参数
1857
+ * @returns 调用结果
1858
+ */
1859
+ function playAudio(params: PlayAudioReq): Promise<void>;
1860
+ /**
1861
+ * 停止音频播放
1862
+ * @param params - 传入参数
1863
+ * @returns 调用结果
1864
+ */
1865
+ function stopAudio(params: StopAudioReq): Promise<void>;
1866
+ /**
1867
+ * 音频是否在播放中
1868
+ * @param params - 传入参数
1869
+ * @returns 调用结果
1870
+ */
1871
+ function isAudioPlaying(params: IsAudioPlayingReq): Promise<IsAudioPlayingRsp>;
1872
+ }
1873
+
1874
+ /**
1875
+ * 创建音频播放器参数
1876
+ * @property url - 音频地址
1877
+ */
1878
+ type CreateAudioReq = {
1879
+ url: string;
1880
+ };
1881
+
1882
+ /**
1883
+ * 创建音频播放器结果
1884
+ * @property audioId - 播放器实例播放器ID
1885
+ */
1886
+ type CreateAudioRsp = {
1887
+ audioId: string;
1888
+ };
1889
+
1890
+ /**
1891
+ * 音频播放器事件回调信息
1892
+ * @property audioId - 播放器实例ID
1893
+ * @property eventName - 事件名, ended-播放完毕, error-播放出错
1894
+ * @property data - 回调信息
1895
+ */
1896
+ type AudioEventInfo = {
1897
+ audioId: string;
1898
+ eventName: string;
1899
+ data: any;
1900
+ };
1901
+
1902
+ /**
1903
+ * @param info - 回调信息
1904
+ */
1905
+ type AudioEventCallback = (info: AudioEventInfo) => void;
1906
+
1907
+ /**
1908
+ * 监听音频播放器事件参数
1909
+ * @property callback - 音频播放器事件回调
1910
+ */
1911
+ type OnAudioNoticesReq = {
1912
+ callback: AudioEventCallback;
1913
+ };
1914
+
1915
+ /**
1916
+ * 取消监听音频播放器事件参数
1917
+ * @property [callback] - 音频播放器事件回调
1918
+ */
1919
+ type OffAudioNoticesReq = {
1920
+ callback?: AudioEventCallback;
1921
+ };
1922
+
1923
+ /**
1924
+ * 播放音频参数
1925
+ * @property audioId - 播放器实例ID
1926
+ */
1927
+ type PlayAudioReq = {
1928
+ audioId: string;
1929
+ };
1930
+
1931
+ /**
1932
+ * 停止播放参数
1933
+ * @property audioId - 播放器实例ID
1934
+ */
1935
+ type StopAudioReq = {
1936
+ audioId: string;
1937
+ };
1938
+
1939
+ /**
1940
+ * 音频是否在播放中参数
1941
+ * @property audioId - 播放器实例ID
1942
+ */
1943
+ type IsAudioPlayingReq = {
1944
+ audioId: string;
1945
+ };
1946
+
1947
+ /**
1948
+ * 音频是否在播放中结果
1949
+ * @property isPlaying - 是否在播放中
1950
+ */
1951
+ type IsAudioPlayingRsp = {
1952
+ isPlaying: boolean;
1953
+ };
1954
+
1727
1955
  /**
1728
1956
  * auth模块
1729
1957
  */
@@ -2608,6 +2836,7 @@ type ContextInfo = {
2608
2836
  * @property liveCompany - 交友陪玩直播间, 1-为交友陪玩直播间, 0-为非交友陪玩直播间
2609
2837
  * @property liveMode - 开播模式, kGame-【PC主播端】端游直播, kEntertainment-【PC主播端】娱乐直播, kMobile-【PC主播端】手游直播, kMakeFriends-【PC主播端】交友直播, kThirdParty-【PC主播端】第三方推流, kScreenCAP-【助手APP】录屏直播, kCamera-【助手APP】摄像头直播, kVoice-【助手APP】语音直播,
2610
2838
  * @property liveSubMode - 开播子模式, process-【PC主播端】端游直播-捕捉游戏画面, desktop-【PC主播端】端游直播-全屏捕捉, area-【PC主播端】端游直播-截取屏幕, window-【PC主播端】端游直播-窗口捕捉, adr-【PC主播端】手游直播-安卓手机, ios-【PC主播端】手游直播-苹果手机, audio-【PC主播端】交友直播-语音开播, video-【PC主播端】交友直播-视频开播, multiPlayersVideo-【PC主播端】派对模式,
2839
+ * @property liveId - 直播ID
2611
2840
  */
2612
2841
  type RespLiveInfo = {
2613
2842
  gameName: string;
@@ -2623,6 +2852,7 @@ type RespLiveInfo = {
2623
2852
  liveCompany: number;
2624
2853
  liveMode: string;
2625
2854
  liveSubMode: string;
2855
+ liveId: string;
2626
2856
  };
2627
2857
 
2628
2858
  /**
@@ -3329,7 +3559,7 @@ namespace device {
3329
3559
  /**
3330
3560
  * 获取窗口信息
3331
3561
  */
3332
- function getWindowInfo(): Promise<WindowInfo>;
3562
+ function getWindowInfo(): WindowInfo;
3333
3563
  }
3334
3564
 
3335
3565
  /**
@@ -4005,6 +4235,12 @@ namespace feedback {
4005
4235
  * @returns 返回结果
4006
4236
  */
4007
4237
  function openFeedbackForm(params: FeedbackParams): Promise<void>;
4238
+ /**
4239
+ * 反馈
4240
+ * @param params - 请求参数
4241
+ * @returns 返回结果
4242
+ */
4243
+ function sendFeedback(params: SendFeedbackReq): Promise<SendFeedbackRsp>;
4008
4244
  }
4009
4245
 
4010
4246
  /**
@@ -4032,6 +4268,24 @@ type FeedbackParams = {
4032
4268
  param: string;
4033
4269
  };
4034
4270
 
4271
+ /**
4272
+ * 反馈请求参数
4273
+ * @property fbType - 反馈类型
4274
+ * @property fbContent - 反馈详情
4275
+ */
4276
+ type SendFeedbackReq = {
4277
+ fbType: string;
4278
+ fbContent: string;
4279
+ };
4280
+
4281
+ /**
4282
+ * 反馈结果
4283
+ * @property feedbackId - 反馈日志id
4284
+ */
4285
+ type SendFeedbackRsp = {
4286
+ feedbackId: string;
4287
+ };
4288
+
4035
4289
  /**
4036
4290
  * 文件系统
4037
4291
  */
@@ -4123,7 +4377,7 @@ namespace fs {
4123
4377
  * @param params - 传入参数
4124
4378
  * @returns 调用结果
4125
4379
  */
4126
- function downloadFile(params: DownloadFileReq): Promise<void>;
4380
+ function downloadFile(params: DownloadFileReq): Promise<DownloadFileRsp>;
4127
4381
  /**
4128
4382
  * 判断文件/目录是否存在
4129
4383
  * @param params - 传入参数
@@ -4350,13 +4604,13 @@ namespace fs {
4350
4604
  * @param params - 传入参数
4351
4605
  * @returns 调用结果
4352
4606
  */
4353
- function write(params: WriteReq): Promise<void>;
4607
+ function write(params: WriteReq): Promise<WriteRsp>;
4354
4608
  /**
4355
4609
  * 同步写入文件
4356
4610
  * @param params - 传入参数
4357
4611
  * @returns 调用结果
4358
4612
  */
4359
- function writeSync(params: WriteReq): void;
4613
+ function writeSync(params: WriteReq): WriteRsp;
4360
4614
  /**
4361
4615
  * 写文件
4362
4616
  * @param params - 传入参数
@@ -4579,14 +4833,14 @@ type SaveFileInfo = {
4579
4833
  * @property fileList - 要保留的资源md5列表,至少传入一个
4580
4834
  * @property [authKeys] - 需要授权的场景值
4581
4835
  * @property callback - 单个文件保存结果回调
4582
- * @property progressCallback - 单个文件保存进度回调
4836
+ * @property [progressCallback] - 单个文件保存进度回调
4583
4837
  */
4584
4838
  type SaveFilesReq = {
4585
4839
  type: string;
4586
4840
  fileList: SaveFileInfo[];
4587
4841
  authKeys?: string[];
4588
4842
  callback: SaveFileCallback;
4589
- progressCallback: SaveFileProgressCallback;
4843
+ progressCallback?: SaveFileProgressCallback;
4590
4844
  };
4591
4845
 
4592
4846
  /**
@@ -4719,6 +4973,18 @@ type DownloadFileReq = {
4719
4973
  filePath?: string;
4720
4974
  };
4721
4975
 
4976
+ /**
4977
+ * 下载文件结果
4978
+ * @property tempFilePath - 临时文件路径 (本地路径)
4979
+ * @property filePath - 用户文件路径 (本地路径),跟传入的 filePath 一致
4980
+ * @property statusCode - 状态码
4981
+ */
4982
+ type DownloadFileRsp = {
4983
+ tempFilePath: string;
4984
+ filePath: string;
4985
+ statusCode: number;
4986
+ };
4987
+
4722
4988
  /**
4723
4989
  * 判断文件/目录是否存在参数
4724
4990
  * @property path - 要判断是否存在的文件/目录路径 (本地路径)
@@ -4731,11 +4997,13 @@ type AccessReq = {
4731
4997
  * 在文件结尾追加内容参数
4732
4998
  * @property filePath - 要追加内容的文件路径 (本地路径)
4733
4999
  * @property data - 要追加的文本或二进制数据
4734
- * @property [encoding] - 指定读取文件的字符编码, base64-base64, utf8-utf8
5000
+ * @property [dataType] - 追加数据类型, string-string, ArrayBuffer-ArrayBuffer
5001
+ * @property [encoding] - 指定读取文件的字符编码, base64-base64, utf8-utf8, binary-二进制
4735
5002
  */
4736
5003
  type AppendFileReq = {
4737
5004
  filePath: string;
4738
- data: string;
5005
+ data: string | ArrayBuffer;
5006
+ dataType?: string;
4739
5007
  encoding?: string;
4740
5008
  };
4741
5009
 
@@ -4770,7 +5038,7 @@ type GetFileInfoRsp = {
4770
5038
  /**
4771
5039
  * 获取文件信息参数
4772
5040
  * @property filePath - 要读取的文件路径 (本地路径)
4773
- * @property [digestAlgorithm] - 计算文件摘要的算法, md5-md5算法, sha1-sha1算法
5041
+ * @property [digestAlgorithm] - 计算文件摘要的算法, md5-md5算法, sha1-sha1算法, sha256-sha256算法
4774
5042
  */
4775
5043
  type GetFileInfoReq = {
4776
5044
  filePath: string;
@@ -4828,11 +5096,13 @@ type OpenReq = {
4828
5096
  /**
4829
5097
  * 文件信息
4830
5098
  * @property bytesRead - 实际读取的字节数
4831
- * @property ArrayBuffer - 被写入的缓存区的对象
5099
+ * @property arrayBuffer - 被写入的缓存区的对象
5100
+ * @property originData - 原始数据
4832
5101
  */
4833
5102
  type ReadRsp = {
4834
5103
  bytesRead: number;
4835
- ArrayBuffer: any;
5104
+ arrayBuffer: ArrayBuffer;
5105
+ originData: string;
4836
5106
  };
4837
5107
 
4838
5108
  /**
@@ -4845,7 +5115,7 @@ type ReadRsp = {
4845
5115
  */
4846
5116
  type ReadReq = {
4847
5117
  fd: string;
4848
- arrayBuffer: any;
5118
+ arrayBuffer: ArrayBuffer;
4849
5119
  offset?: number;
4850
5120
  length?: number;
4851
5121
  position?: number;
@@ -4854,17 +5124,21 @@ type ReadReq = {
4854
5124
  /**
4855
5125
  * 压缩类型的本地文件内容
4856
5126
  * @property data - 文件内容
5127
+ * @property originData - 原始数据
4857
5128
  */
4858
5129
  type ReadCompressedFileRsp = {
4859
- data: any;
5130
+ data: ArrayBuffer;
5131
+ originData: string;
4860
5132
  };
4861
5133
 
4862
5134
  /**
4863
5135
  * 读取指定压缩类型的本地文件内容参数
4864
5136
  * @property filePath - 要读取的文件的路径 (本地用户文件或代码包文件)
5137
+ * @property compressionAlgorithm - 文件压缩类型, br-brotli压缩文件
4865
5138
  */
4866
5139
  type ReadCompressedFileReq = {
4867
5140
  filePath: string;
5141
+ compressionAlgorithm: string;
4868
5142
  };
4869
5143
 
4870
5144
  /**
@@ -4888,13 +5162,13 @@ type ReaddirReq = {
4888
5162
  * @property data - 文件数据
4889
5163
  */
4890
5164
  type ReadFileRsp = {
4891
- data: any;
5165
+ data: string | ArrayBuffer;
4892
5166
  };
4893
5167
 
4894
5168
  /**
4895
5169
  * 读取文件参数
4896
5170
  * @property filePath - 要读取的文件的路径 (本地路径)
4897
- * @property [encoding] - 指定读取文件的字符编码, base64-base64, utf8-utf8
5171
+ * @property [encoding] - 指定读取文件的字符编码, base64-base64, utf8-utf8, binary-二进制
4898
5172
  * @property [position] - 从文件指定位置开始读,如果不指定,则从文件头开始读
4899
5173
  * @property [length] - 指定文件的长度,如果不指定,则读到文件末尾。
4900
5174
  */
@@ -4905,24 +5179,48 @@ type ReadFileReq = {
4905
5179
  length?: number;
4906
5180
  };
4907
5181
 
5182
+ /**
5183
+ * 文件信息
5184
+ * @property data - 文件内容string|ArrayBuffer
5185
+ * @property errMsg - 错误信息
5186
+ */
5187
+ type FileItem = {
5188
+ data: string | ArrayBuffer;
5189
+ errMsg: string;
5190
+ };
5191
+
4908
5192
  /**
4909
5193
  * 读取压缩包内的文件
4910
- * @property entries - 文件读取结果,key是文件路径,value是一个对象 FileItem ,表示该文件的读取结果。每个 FileItem 包含 data (文件内容) 和 errMsg (错误信息) 属性。
5194
+ * @property entries - 文件读取结果,key是文件路径,value是一个对象FileItem,表示该文件的读取结果。每个FileItem包含data(文件内容)和errMsg(错误信息)属性
4911
5195
  */
4912
5196
  type ReadZipEntryRsp = {
4913
5197
  entries: any;
4914
5198
  };
4915
5199
 
5200
+ /**
5201
+ * 读取压缩包内的文件参数
5202
+ * @property path - 压缩包内文件路径
5203
+ * @property [encoding] - 指定读取文件的字符编码, base64-base64, utf8-utf8, binary-二进制
5204
+ * @property [position] - 从文件指定位置开始读,如果不指定,则从文件头开始读
5205
+ * @property [length] - 指定文件的长度,如果不指定,则读到文件末尾
5206
+ */
5207
+ type EntrieInfo = {
5208
+ path: string;
5209
+ encoding?: string;
5210
+ position?: number;
5211
+ length?: number;
5212
+ };
5213
+
4916
5214
  /**
4917
5215
  * 读取压缩包内的文件参数
4918
5216
  * @property filePath - 要读取的文件的路径 (本地路径)
4919
- * @property [encoding] - 指定读取文件的字符编码, base64-base64, utf8-utf8
5217
+ * @property [encoding] - 统一指定读取文件的字符编码,只在entries值为"all"时有效,entries值为"all"时不传默认返回二进制内容
4920
5218
  * @property entries - 要读取的压缩包内的文件列表(当传入"all" 时表示读取压缩包内所有文件)
4921
5219
  */
4922
5220
  type ReadZipEntryReq = {
4923
5221
  filePath: string;
4924
5222
  encoding?: string;
4925
- entries: any;
5223
+ entries: EntrieInfo[] | 'all';
4926
5224
  };
4927
5225
 
4928
5226
  /**
@@ -4981,12 +5279,30 @@ type SaveFileReq = {
4981
5279
  filePath?: string;
4982
5280
  };
4983
5281
 
5282
+ /**
5283
+ * 文件状态
5284
+ * @property mode - 文件的类型和存取的权限
5285
+ * @property size - 文件大小,单位:B
5286
+ * @property lastAccessedTime - 文件最近一次被存取或被执行的时间戳
5287
+ * @property lastModifiedTime - 文件最后一次被修改的时间戳
5288
+ * @property isDirectory - 判断当前文件是否一个目录
5289
+ * @property isFile - 判断当前文件是否一个普通文件
5290
+ */
5291
+ type FileStats = {
5292
+ mode: number;
5293
+ size: number;
5294
+ lastAccessedTime: number;
5295
+ lastModifiedTime: number;
5296
+ isDirectory: boolean;
5297
+ isFile: boolean;
5298
+ };
5299
+
4984
5300
  /**
4985
5301
  * 文件Stats对象结果
4986
5302
  * @property stats - 当recursive为false时,res.stats是一个Stats对象。当recursive为true且path是一个目录的路径时,res.stats是一个Array,数组的每一项是一个对象,每个对象包含path和stats
4987
5303
  */
4988
5304
  type StatRsp = {
4989
- stats: any;
5305
+ stats: FileStats[] | FileStats;
4990
5306
  };
4991
5307
 
4992
5308
  /**
@@ -5021,50 +5337,44 @@ type UnlinkReq = {
5021
5337
  * 写文件参数
5022
5338
  * @property fd - 文件描述符
5023
5339
  * @property data - 要写入的文本或二进制数据
5340
+ * @property [dataType] - 追加数据类型, string-string, ArrayBuffer-ArrayBuffer
5024
5341
  * @property [offset] - 在 data 是 ArrayBuffer 时要写入的 arrayBuffer 中的索引,默认0
5025
5342
  * @property [length] - 在 data 是 ArrayBuffer 时指定要写入的字节数
5026
- * @property [encoding] - 指定写入文件的字符编码, base64-base64, utf8-utf8
5343
+ * @property [encoding] - 指定写入文件的字符编码, base64-base64, utf8-utf8, binary-二进制
5027
5344
  * @property [position] - 指定文件开头的偏移量,即数据要被写入的位置
5028
5345
  */
5029
5346
  type WriteReq = {
5030
5347
  fd: string;
5031
- data: string;
5348
+ data: string | ArrayBuffer;
5349
+ dataType?: string;
5032
5350
  offset?: number;
5033
5351
  length?: number;
5034
5352
  encoding?: string;
5035
5353
  position?: number;
5036
5354
  };
5037
5355
 
5356
+ /**
5357
+ * 写文件结果
5358
+ * @property bytesWritten - 实际被写入到文件中的字节数
5359
+ */
5360
+ type WriteRsp = {
5361
+ bytesWritten: number;
5362
+ };
5363
+
5038
5364
  /**
5039
5365
  * 写文件参数
5040
5366
  * @property filePath - 要写入的文件路径 (本地路径)
5041
5367
  * @property data - 要写入的文本或二进制数据
5042
- * @property [encoding] - 指定写入文件的字符编码, base64-base64, utf8-utf8
5368
+ * @property [dataType] - 追加数据类型, string-string, ArrayBuffer-ArrayBuffer
5369
+ * @property [encoding] - 指定写入文件的字符编码, base64-base64, utf8-utf8, binary-二进制
5043
5370
  */
5044
5371
  type WriteFileReq = {
5045
5372
  filePath: string;
5046
- data: string;
5373
+ data: string | ArrayBuffer;
5374
+ dataType?: string;
5047
5375
  encoding?: string;
5048
5376
  };
5049
5377
 
5050
- /**
5051
- * 文件状态
5052
- * @property mode - 文件的类型和存取的权限
5053
- * @property size - 文件大小,单位:B
5054
- * @property lastAccessedTime - 文件最近一次被存取或被执行的时间戳
5055
- * @property lastModifiedTime - 文件最后一次被修改的时间戳
5056
- * @property isDirectory - 判断当前文件是否一个目录
5057
- * @property isFile - 判断当前文件是否一个普通文件
5058
- */
5059
- type FileStats = {
5060
- mode: number;
5061
- size: number;
5062
- lastAccessedTime: number;
5063
- lastModifiedTime: number;
5064
- isDirectory: boolean;
5065
- isFile: boolean;
5066
- };
5067
-
5068
5378
  /**
5069
5379
  * 获取文件的状态信息参数
5070
5380
  * @property stats - 文件状态
@@ -9569,6 +9879,11 @@ namespace yyb {
9569
9879
  * @returns 调用结果
9570
9880
  */
9571
9881
  function offCloudGameMsgFromYYB(): Promise<void>;
9882
+ /**
9883
+ * 获取云游分配的服务器节点信息
9884
+ * @returns 节点数据
9885
+ */
9886
+ function getYYBCloudGameServerSource(): Promise<CloudGameServerSourceInfo>;
9572
9887
  }
9573
9888
 
9574
9889
  /**
@@ -9590,8 +9905,13 @@ type LaunchYYBCloudGameReq = {
9590
9905
  * @property cloudGameSource - 游戏来源
9591
9906
  * @property cloudGamePackageName - 游戏包名
9592
9907
  * @property entranceId - 游戏ID
9593
- * @property needShowFloatingWindow - 是否需要显示悬浮球
9908
+ * @property needShowFloatingWindow - 是否需要显示悬浮球, 1-显示, 0-不显示
9594
9909
  * @property gameIconUrl - 游戏图标链接
9910
+ * @property [needUseCustomLoadingUI] - 是否使用自定义加载页面, 1-是, 0-否
9911
+ * @property [loadBgUrl] - 加载过程的背景url
9912
+ * @property [loadMsg] - 加载过程的文案
9913
+ * @property [needObserPerformance] - 是否需要监听性能数据, 1-是, 0-否
9914
+ * @property [performanceFrequency] - 性能数据回调频控,单位秒
9595
9915
  */
9596
9916
  type StartYYBCloudGameReq = {
9597
9917
  bizIdDev: string;
@@ -9599,8 +9919,13 @@ type StartYYBCloudGameReq = {
9599
9919
  cloudGameSource: string;
9600
9920
  cloudGamePackageName: string;
9601
9921
  entranceId: string;
9602
- needShowFloatingWindow: boolean;
9922
+ needShowFloatingWindow: number;
9603
9923
  gameIconUrl: string;
9924
+ needUseCustomLoadingUI?: number;
9925
+ loadBgUrl?: string;
9926
+ loadMsg?: string;
9927
+ needObserPerformance?: number;
9928
+ performanceFrequency?: number;
9604
9929
  };
9605
9930
 
9606
9931
  /**
@@ -9626,5 +9951,15 @@ type OnYYBCloudGameMsgReq = {
9626
9951
  callback: YYBCloudGameMsgCallback;
9627
9952
  };
9628
9953
 
9954
+ /**
9955
+ * 节点数据
9956
+ * @property deviceArea - 节点信息,如guangzhou、shenzhen等
9957
+ * @property deviceId - 节点id
9958
+ */
9959
+ type CloudGameServerSourceInfo = {
9960
+ deviceArea: string;
9961
+ deviceId: string;
9962
+ };
9963
+
9629
9964
 
9630
9965
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyext/types-ext-sdk-hy",
3
- "version": "3.17.0-beta.2",
3
+ "version": "3.17.0-beta.20",
4
4
  "description": "TypeScript definitions for sdk",
5
5
  "types": "./index.d.ts",
6
6
  "main": "",