@bddh/starling-realtime-client
Version:
106 lines (105 loc) • 2.88 kB
TypeScript
import { RtcConnectionType } from './BrtcClient';
export interface ConnectDataType {
action: string;
body: string;
code: number;
message: string;
}
export interface ConnectParamsType {
figureId: string | number;
resolutionHeight: number;
resolutionWidth: number;
cameraId?: string | number;
characterOffset?: string;
pickAudioMode?: string;
autoChromaKey?: boolean;
usingVideo?: boolean;
ttsPer?: string | number;
ttsPitch?: number;
ttsSpeed?: number;
ttsVolume?: number;
ttsLan?: string;
pullAudioFromRtc?: boolean;
inactiveDisconnectSec?: number;
preAlertSec?: number;
x264BitRate?: number;
backgroundImageUrl?: string;
projectId?: string;
characterConfigId?: string;
selectors?: any;
figureName?: string;
configVersion?: string;
extraInfo?: any;
roomName?: string;
paintSubtitleOnPicture?: boolean;
h5Embedded?: boolean;
paintWidgetOnPicture?: boolean;
extraParameters?: any;
parameters?: any;
}
export declare const CONNECT_MAIN_KEY: string[];
export interface RenderParamsType {
chromaEffects?: object;
autoChromaKey?: boolean;
closeLog?: boolean;
fullStatus?: boolean;
}
export declare enum statusEnum {
DH_LIB_INIT = "DH_LIB_INIT",
DH_LIB_WS_SUCCESS = "DH_LIB_WS_SUCCESS",
DH_LIB_OPEN = "DH_LIB_OPEN",
DH_LIB_STATUS = "DH_LIB_STATUS",
DH_LIB_CLOSE = "DH_LIB_CLOSE",
DH_LIB_ERROR = "DH_LIB_ERROR",
DH_LIB_WARNING = "DH_LIB_WARNING",
DH_LIB_FULL_STATUS = "DH_LIB_FULL_STATUS"
}
export declare enum errorTypeEnum {
CONNECT_ERROR = "CONNECT_ERROR",
DISCONNECT_ALERT = "DISCONNECT_ALERT",
TIMEOUT_EXIT = "TIMEOUT_EXIT",
LOCAL_VIDEO_MUTED = "LOCAL_VIDEO_MUTED",
LOCAL_VIDEO_ERROR = "LOCAL_VIDEO_ERROR",
RTC_ERROR = "RTC_ERROR"
}
export interface ErrorType {
type: errorTypeEnum;
msg?: {
code: string | number;
errMsg: string;
};
}
export interface RtcStateType {
action: string;
type: string;
body: any;
}
export declare const WS_STATUS_MAP: {
'-1': string;
'0': string;
'1': string;
'2': string;
'3': string;
};
export interface WsStateType {
readyState: number;
type: string;
body: string;
}
export interface CallbackMsgType {
status: statusEnum;
content?: ErrorType | WsStateType | RtcStateType | ConnectDataType;
}
export interface DhRealtimeHumanType {
token: string;
wsUrl?: string;
rtcServerUrl?: string;
appKey?: string;
appId?: string;
wrapperId: string;
connectParams: ConnectParamsType;
renderParams: RenderParamsType;
rtcConnectParams?: RtcConnectionType;
brtcParams?: any;
onDigitalHumanCallback: (data: CallbackMsgType) => void;
}