UNPKG

@bddh/starling-realtime-client

Version:

149 lines (148 loc) 4.28 kB
import { ChromaEffectOptions } from '@bddh/starling-cutout/es/interface'; import { RtcConnectionType } from './BrtcClient'; export interface ConnectDataType { action: string; body: string; code: number; message: string; } type AsrLanType = 'en-US' | 'ja-JP' | 'zh-CN' | 'pt-BR' | 'de-DE' | 'fr-FR' | 'ko-KR' | 'fil-PH' | 'ms-MY' | 'th-TH' | 'ar-SA'; export interface Mic3AType { echoCancellation?: boolean; noiseSuppression?: boolean; autoGainControl?: boolean; } export interface ConnectParamsType { figureId?: string | number; resolutionHeight: number; resolutionWidth: number; x264BitRate?: number; cameraId?: string | number; characterOffset?: string; pickAudioMode?: 'pressButton' | 'free'; autoChromaKey?: boolean; usingVideo?: boolean; ttsPer?: string | number; ttsPitch?: number; ttsSpeed?: number; ttsVolume?: number; ttsLan?: string; pullAudioFromRtc?: boolean; inactiveDisconnectSec?: number; preAlertSec?: 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; reConnect?: boolean; asrFormat?: 'pcm' | 'opus'; asrSample?: number; asrLan?: AsrLanType; asrDdc?: boolean; asrPunc?: boolean; asrItn?: boolean; asrNonStream?: boolean; asrSensitiveWord?: boolean; asrBoostingTable?: string; botParams?: { enabled: boolean; }; enableInterrupt?: boolean; asrVadPauseTime?: number; positionV2?: string; ttsModel?: string; autoAnimoji?: boolean; } export declare const CONNECT_MAIN_KEY: string[]; export interface RenderParamsType { chromaEffects?: object; autoChromaKey?: boolean; closeLog?: boolean; fullStatus?: boolean; audio3AConstraints?: Mic3AType; } 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", DH_LIB_MESSAGE = "DH_LIB_MESSAGE" } 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; checkHeartbeatMismatch?: boolean; rtcServerUrl?: string; rtcInternalIp?: string; appKey?: string; appId?: string; wrapperId?: string; connectParams?: ConnectParamsType; renderParams?: RenderParamsType; rtcConnectParams?: RtcConnectionType; brtcParams?: any; remoteAutoPlay?: boolean; mergeConnectRtcExtras?: boolean; emitRawStatusMessage?: boolean; resolveMediaServerByDomain?: (domain: string) => Promise<string>; isPreOpenSession?: boolean; isOpenWsOnly?: boolean; onDigitalHumanCallback: (data: CallbackMsgType) => void; } export interface EffectsType { chromaKey?: Partial<ChromaEffectOptions>; version?: number; } export interface DestroyOptions { keepLastFrame?: boolean; } export {};