@hyext/types-ext-sdk-hy 3.20.0 → 4.0.0-beta.10
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/index.d.ts +43 -40
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2528,22 +2528,22 @@ type SafeAreaInfo = {
|
|
|
2528
2528
|
* @property screenWidth - 屏幕宽度
|
|
2529
2529
|
* @property screenHeight - 屏幕高度
|
|
2530
2530
|
* @property isLandscape - 屏幕是否是横屏高度
|
|
2531
|
-
* @property pixelRatio - 设备像素比
|
|
2531
|
+
* @property [pixelRatio] - 设备像素比
|
|
2532
2532
|
* @property windowWidth - 可使用窗口宽度,单位 px
|
|
2533
2533
|
* @property windowHeight - 可使用窗口高度,单位 px
|
|
2534
|
-
* @property statusBarHeight - 状态栏的高度,单位 px
|
|
2535
|
-
* @property screenTop - 窗口上边缘的 y 值
|
|
2534
|
+
* @property [statusBarHeight] - 状态栏的高度,单位 px
|
|
2535
|
+
* @property [screenTop] - 窗口上边缘的 y 值
|
|
2536
2536
|
* @property [safeArea] - 在竖屏正方向下的安全区域。部分机型没有安全区域概念,则不返回 safeArea 字段
|
|
2537
2537
|
*/
|
|
2538
2538
|
type Consts = {
|
|
2539
2539
|
screenWidth: number;
|
|
2540
2540
|
screenHeight: number;
|
|
2541
2541
|
isLandscape: boolean;
|
|
2542
|
-
pixelRatio
|
|
2542
|
+
pixelRatio?: number;
|
|
2543
2543
|
windowWidth: number;
|
|
2544
2544
|
windowHeight: number;
|
|
2545
|
-
statusBarHeight
|
|
2546
|
-
screenTop
|
|
2545
|
+
statusBarHeight?: number;
|
|
2546
|
+
screenTop?: number;
|
|
2547
2547
|
safeArea?: SafeAreaInfo;
|
|
2548
2548
|
};
|
|
2549
2549
|
|
|
@@ -2559,14 +2559,14 @@ namespace context {
|
|
|
2559
2559
|
* @param callback - 收到消息时回调 返回消息内容
|
|
2560
2560
|
* @returns 调用结果
|
|
2561
2561
|
*/
|
|
2562
|
-
function on(topic: string, callback: ContextOnCallback): void
|
|
2562
|
+
function on(topic: string, callback: ContextOnCallback): Promise<void>;
|
|
2563
2563
|
/**
|
|
2564
2564
|
* 取消监听直播间消息
|
|
2565
2565
|
* @param topic - 宿主消息名, activated-小程序激活, subscribeSubmit-【观众端】当前观众订阅状态发生变化, giftSubmit-【观众端】当前观众送礼, barrageSubmit-当前用户发送弹幕, unzipProgress-每个任务的解压进度, userInteract-用户交互信息, openCoinPanelClosed-能量豆弹窗关闭, uiVisibilityStateChange-工具栏状态
|
|
2566
2566
|
* @param [callback] - 收到消息时回调 返回消息内容
|
|
2567
2567
|
* @returns 调用结果
|
|
2568
2568
|
*/
|
|
2569
|
-
function off(topic: string, callback?: ContextOnCallback): void
|
|
2569
|
+
function off(topic: string, callback?: ContextOnCallback): Promise<void>;
|
|
2570
2570
|
/**
|
|
2571
2571
|
* 显示互动通道入口红点
|
|
2572
2572
|
* @returns 返回是否显示成功
|
|
@@ -3115,7 +3115,7 @@ type StreamerInfo = {
|
|
|
3115
3115
|
streamerNick: string;
|
|
3116
3116
|
streamerAvatarUrl: string;
|
|
3117
3117
|
streamerSex: number;
|
|
3118
|
-
streamerRoomId:
|
|
3118
|
+
streamerRoomId: number;
|
|
3119
3119
|
streamerLevel: number;
|
|
3120
3120
|
streamerUnionId: string;
|
|
3121
3121
|
};
|
|
@@ -3142,10 +3142,10 @@ type ContextInfo = {
|
|
|
3142
3142
|
* @property template - 直播间模版, MobileLiveRoom-颜值, FMLiveRoom-多人语音, MatchLiveRoom-赛事, TVLiveRoom-虎牙电视台, GameRoom-游戏, ImmerseRoom-沉浸式, MultiLinkVideoRoom-派对
|
|
3143
3143
|
* @property sourceType - 直播间来源
|
|
3144
3144
|
* @property liveImmersion - 沉浸式直播间, 1-为沉浸式直播间, 0-为非沉浸式直播间
|
|
3145
|
-
* @property liveCompany - 交友陪玩直播间, 1-为交友陪玩直播间, 0-为非交友陪玩直播间
|
|
3146
|
-
* @property liveMode - 开播模式, kGame-【PC主播端】端游直播, kEntertainment-【PC主播端】娱乐直播, kMobile-【PC主播端】手游直播, kMakeFriends-【PC主播端】交友直播, kThirdParty-【PC主播端】第三方推流, kScreenCAP-【助手APP】录屏直播, kCamera-【助手APP】摄像头直播, kVoice-【助手APP】语音直播,
|
|
3147
|
-
* @property liveSubMode - 开播子模式, process-【PC主播端】端游直播-捕捉游戏画面, desktop-【PC主播端】端游直播-全屏捕捉, area-【PC主播端】端游直播-截取屏幕, window-【PC主播端】端游直播-窗口捕捉, adr-【PC主播端】手游直播-安卓手机, ios-【PC主播端】手游直播-苹果手机, audio-【PC主播端】交友直播-语音开播, video-【PC主播端】交友直播-视频开播, multiPlayersVideo-【PC主播端】派对模式,
|
|
3148
|
-
* @property liveId - 直播ID
|
|
3145
|
+
* @property [liveCompany] - 交友陪玩直播间, 1-为交友陪玩直播间, 0-为非交友陪玩直播间
|
|
3146
|
+
* @property [liveMode] - 开播模式, kGame-【PC主播端】端游直播, kEntertainment-【PC主播端】娱乐直播, kMobile-【PC主播端】手游直播, kMakeFriends-【PC主播端】交友直播, kThirdParty-【PC主播端】第三方推流, kScreenCAP-【助手APP】录屏直播, kCamera-【助手APP】摄像头直播, kVoice-【助手APP】语音直播,
|
|
3147
|
+
* @property [liveSubMode] - 开播子模式, process-【PC主播端】端游直播-捕捉游戏画面, desktop-【PC主播端】端游直播-全屏捕捉, area-【PC主播端】端游直播-截取屏幕, window-【PC主播端】端游直播-窗口捕捉, adr-【PC主播端】手游直播-安卓手机, ios-【PC主播端】手游直播-苹果手机, audio-【PC主播端】交友直播-语音开播, video-【PC主播端】交友直播-视频开播, multiPlayersVideo-【PC主播端】派对模式,
|
|
3148
|
+
* @property [liveId] - 直播ID
|
|
3149
3149
|
*/
|
|
3150
3150
|
type RespLiveInfo = {
|
|
3151
3151
|
gameName: string;
|
|
@@ -3158,10 +3158,10 @@ type RespLiveInfo = {
|
|
|
3158
3158
|
template: string;
|
|
3159
3159
|
sourceType: number;
|
|
3160
3160
|
liveImmersion: number;
|
|
3161
|
-
liveCompany
|
|
3162
|
-
liveMode
|
|
3163
|
-
liveSubMode
|
|
3164
|
-
liveId
|
|
3161
|
+
liveCompany?: number;
|
|
3162
|
+
liveMode?: string;
|
|
3163
|
+
liveSubMode?: string;
|
|
3164
|
+
liveId?: string;
|
|
3165
3165
|
};
|
|
3166
3166
|
|
|
3167
3167
|
/**
|
|
@@ -4188,22 +4188,22 @@ type SafeArea = {
|
|
|
4188
4188
|
* @property screenWidth - 屏幕宽度
|
|
4189
4189
|
* @property screenHeight - 屏幕高度
|
|
4190
4190
|
* @property isLandscape - 屏幕是否是横屏高度
|
|
4191
|
-
* @property pixelRatio - 设备像素比
|
|
4191
|
+
* @property [pixelRatio] - 设备像素比
|
|
4192
4192
|
* @property windowWidth - 可使用窗口宽度,单位 px
|
|
4193
4193
|
* @property windowHeight - 可使用窗口高度,单位 px
|
|
4194
|
-
* @property statusBarHeight - 状态栏的高度,单位 px
|
|
4195
|
-
* @property screenTop - 窗口上边缘的 y 值
|
|
4194
|
+
* @property [statusBarHeight] - 状态栏的高度,单位 px
|
|
4195
|
+
* @property [screenTop] - 窗口上边缘的 y 值
|
|
4196
4196
|
* @property [safeArea] - 在竖屏正方向下的安全区域。部分机型没有安全区域概念,则不返回 safeArea 字段
|
|
4197
4197
|
*/
|
|
4198
4198
|
type WindowInfo = {
|
|
4199
4199
|
screenWidth: number;
|
|
4200
4200
|
screenHeight: number;
|
|
4201
4201
|
isLandscape: boolean;
|
|
4202
|
-
pixelRatio
|
|
4202
|
+
pixelRatio?: number;
|
|
4203
4203
|
windowWidth: number;
|
|
4204
4204
|
windowHeight: number;
|
|
4205
|
-
statusBarHeight
|
|
4206
|
-
screenTop
|
|
4205
|
+
statusBarHeight?: number;
|
|
4206
|
+
screenTop?: number;
|
|
4207
4207
|
safeArea?: SafeArea;
|
|
4208
4208
|
};
|
|
4209
4209
|
|
|
@@ -6521,21 +6521,24 @@ namespace ob {
|
|
|
6521
6521
|
* @param callback - 收到消息时回调
|
|
6522
6522
|
* @returns 调用结果
|
|
6523
6523
|
*/
|
|
6524
|
-
function on(topic: string, callback: OBCallback): void
|
|
6524
|
+
function on(topic: string, callback: OBCallback): Promise<void>;
|
|
6525
6525
|
/**
|
|
6526
6526
|
* 取消监听ob消息
|
|
6527
6527
|
* @param topic - 消息名 matchStatusChange-比赛状态改变(默认), perspectiveChange-当前视角改变
|
|
6528
6528
|
* @param [callback] - 调用ob.on()时传入的函数的引用
|
|
6529
6529
|
* @returns 调用结果
|
|
6530
6530
|
*/
|
|
6531
|
-
function off(topic: string, callback?: OBCallback): void
|
|
6531
|
+
function off(topic: string, callback?: OBCallback): Promise<void>;
|
|
6532
6532
|
}
|
|
6533
6533
|
|
|
6534
6534
|
/**
|
|
6535
|
-
*
|
|
6535
|
+
* 比赛状态信息
|
|
6536
|
+
* @property [state] - 状态值
|
|
6537
|
+
* @property status - 状态值
|
|
6536
6538
|
*/
|
|
6537
|
-
type
|
|
6538
|
-
state
|
|
6539
|
+
type MatchInfoRsp = {
|
|
6540
|
+
state?: string;
|
|
6541
|
+
status: string;
|
|
6539
6542
|
};
|
|
6540
6543
|
|
|
6541
6544
|
/**
|
|
@@ -6562,12 +6565,12 @@ type PerspectiveParams = {
|
|
|
6562
6565
|
|
|
6563
6566
|
/**
|
|
6564
6567
|
* 视角信息
|
|
6565
|
-
* @property pid - 视角id
|
|
6566
|
-
* @property name - 视角名称
|
|
6568
|
+
* @property [pid] - 视角id
|
|
6569
|
+
* @property [name] - 视角名称
|
|
6567
6570
|
*/
|
|
6568
6571
|
type PerspectiveInfo = {
|
|
6569
|
-
pid
|
|
6570
|
-
name
|
|
6572
|
+
pid?: number;
|
|
6573
|
+
name?: string;
|
|
6571
6574
|
};
|
|
6572
6575
|
|
|
6573
6576
|
/**
|
|
@@ -6586,14 +6589,14 @@ namespace observer {
|
|
|
6586
6589
|
* @param callback - 收到消息时回调 返回对应消息名的后台消息content
|
|
6587
6590
|
* @returns 调用结果
|
|
6588
6591
|
*/
|
|
6589
|
-
function on(topic: string, callback: ObserverCallback): void
|
|
6592
|
+
function on(topic: string, callback: ObserverCallback): Promise<void>;
|
|
6590
6593
|
/**
|
|
6591
6594
|
* 取消监听后台消息
|
|
6592
6595
|
* @param topic - 消息名
|
|
6593
6596
|
* @param [callback] - 消息回调
|
|
6594
6597
|
* @returns 调用结果
|
|
6595
6598
|
*/
|
|
6596
|
-
function off(topic: string, callback?: ObserverCallback): void
|
|
6599
|
+
function off(topic: string, callback?: ObserverCallback): Promise<void>;
|
|
6597
6600
|
/**
|
|
6598
6601
|
* 触发小程序消息
|
|
6599
6602
|
* @param topic - 小程序消息名
|
|
@@ -7157,14 +7160,14 @@ namespace player {
|
|
|
7157
7160
|
* @param callback - 事件回调
|
|
7158
7161
|
* @returns 调用结果
|
|
7159
7162
|
*/
|
|
7160
|
-
function on(topic: string, callback: (...params: any[]) => any): void
|
|
7163
|
+
function on(topic: string, callback: (...params: any[]) => any): Promise<void>;
|
|
7161
7164
|
/**
|
|
7162
7165
|
* 取消事件监听
|
|
7163
7166
|
* @param topic - 事件名 waiting-waiting, seeking-seeking, seeked-seeked, playing-playing, ended-ended, canplay-canplay, loadedmetadata-loadedmetadata, pause-pause, play-play, timeupdate-timeupdate, videoFrameReduceStart-videoFrameReduceStart, videoFrameGrowEnd-videoFrameGrowEnd
|
|
7164
7167
|
* @param [callback] - 事件回调
|
|
7165
7168
|
* @returns 调用结果
|
|
7166
7169
|
*/
|
|
7167
|
-
function off(topic: string, callback?: (...params: any[]) => any): void
|
|
7170
|
+
function off(topic: string, callback?: (...params: any[]) => any): Promise<void>;
|
|
7168
7171
|
/**
|
|
7169
7172
|
* 切换当前直播间线路
|
|
7170
7173
|
* @param params - 切换线路参数
|
|
@@ -7345,13 +7348,13 @@ type CurrentLineInfo = {
|
|
|
7345
7348
|
|
|
7346
7349
|
/**
|
|
7347
7350
|
* 视频信息
|
|
7348
|
-
* @property duration - 视频时长
|
|
7349
|
-
* @property currentTime - 当前播放时间
|
|
7351
|
+
* @property [duration] - 视频时长
|
|
7352
|
+
* @property [currentTime] - 当前播放时间
|
|
7350
7353
|
* @property isPlaying - 是否正在播放
|
|
7351
7354
|
*/
|
|
7352
7355
|
type VideoInfo = {
|
|
7353
|
-
duration
|
|
7354
|
-
currentTime
|
|
7356
|
+
duration?: number;
|
|
7357
|
+
currentTime?: number;
|
|
7355
7358
|
isPlaying: boolean;
|
|
7356
7359
|
};
|
|
7357
7360
|
|