import type { ILocalAudioTrack, ILocalVideoTrack } from 'agora-rtc-sdk-ng'; import { IBaseProcessor } from 'agora-rte-extension'; import { IExtension } from 'agora-rte-extension'; import { AgoraRteDualVideoStreamConfig } from '../../../type'; import { AgoraRteBeautyOptions, AgoraRteVirtualBackgroundOptions } from '../../../core/media/type'; import { AgoraRtcAiDenoiseLevel, AgoraRtcAudioSourceType, AgoraRtcClientObserver, AgoraRtcLatencyLevelType, AgoraRtcRegion, AgoraRtcSourceManagerObserver, AgoraRtcStreamPublishPoolItem, AgoraRtcVideoSourceType } from '../../../core/rtc/type'; export interface AgoraRtcLocalTrackEventsObserver { onLocalVideoTrackBeforeCreate?(sourceId: string, sourceType: AgoraRtcVideoSourceType): void; onLocalVideoTrackCreated?(sourceId: string, sourceType: AgoraRtcVideoSourceType, localTrack: ILocalVideoTrack): void; onLocalVideoTrackBeforeDestroy?(sourceId: string, sourceType: AgoraRtcVideoSourceType, localTrack: ILocalVideoTrack): void; onLocalVideoTrackFailedToCreate?(sourceId: string, sourceType: AgoraRtcVideoSourceType, error?: Error): void; onLocalAudioTrackBeforeCreate?(sourceId: string, sourceType: AgoraRtcAudioSourceType): void; onLocalAudioTrackCreated?(sourceId: string, sourceType: AgoraRtcAudioSourceType, localTrack: ILocalAudioTrack): void; onLocalAudioTrackBeforeDestroy?(sourceId: string, sourceType: AgoraRtcAudioSourceType, localTrack: ILocalAudioTrack): void; onLocalAudioTrackFailedToCreate?(sourceId: string, sourceType: AgoraRtcAudioSourceType, error?: Error): void; /** * 当摄像头设备调用start或stop时触发 * @param deviceId * @param stateFlag */ onVideoDeviceStateFlagUpdated?(deviceId: string, stateFlag: number): void; /** * 当麦克风设备调用start或stop时触发 * @param deviceId * @param stateFlag */ onAudioDeviceStateFlagUpdated?(deviceId: string, stateFlag: number): void; } export type AgoraWebRtcClientInitConfig = { appId: string; region: AgoraRtcRegion; dualCameraVideoStreamConfig: AgoraRteDualVideoStreamConfig; dualScreenVideoStreamConfig: AgoraRteDualVideoStreamConfig; cloudProxy?: boolean; cloudProxyType?: number; options?: AgoraWebRtcClientInitOptions; }; export type AgoraWebRtcPrivateOptions = { cdsHostname?: string[]; cdsPort?: number; logHostname?: string[]; logPort?: number; reportHostname?: string[]; reportPort?: number; serverList?: string[]; serverPort?: number; serverDomain?: string; }; export type AgoraWebRtcClientInitOptions = { uploadLog?: boolean; codec?: 'h264' | 'vp8'; mode?: 'rtc' | 'live'; }; export type AgoraWebRtcChannelClientInitConfig = { appId: string; channelId: string; localUserId: string; region: AgoraRtcRegion; latencyLevel: AgoraRtcLatencyLevelType; dualCameraVideoStreamConfig: AgoraRteDualVideoStreamConfig; dualScreenVideoStreamConfig: AgoraRteDualVideoStreamConfig; cloudProxy?: boolean; cloudProxyType?: number; audioVolumeIndicationConfig: AudioVolumeIndicationConfig; options?: AgoraWebRtcChannelClientInitOptions; }; export type AgoraWebRtcChannelClientInitOptions = { uploadLog?: boolean; codec?: 'h264' | 'vp8'; mode?: 'rtc' | 'live'; } & AgoraWebRtcPrivateOptions; export interface AgoraWebRtcExtensionDelegate { getExtensions(): IExtension[]; createCameraProcessors(): Promise; createMicrophoneProcessors(): Promise; } export interface AgoraWebRtcExtensionManager { addCameraPreprocessors(deviceId: string, canvasId: string, preprocessors: IBaseProcessor[]): void; removeCameraPreprocessors(deviceId: string, canvasId: string, preprocessors: IBaseProcessor[]): void; addMicrophonePreprocessors(deviceId: string, canvasId: string, preprocessors: IBaseProcessor[]): void; removeMicrophonePreprocessors(deviceId: string, canvasId: string, preprocessors: IBaseProcessor[]): void; } export type AudioVolumeIndicationConfig = { interval: number; }; export type AgoraEffectState = { get beautyEnabled(): boolean; get virtualBackgroundEnabled(): boolean; get beautyOptions(): AgoraRteBeautyOptions | undefined; get virtualBackgroundOptions(): AgoraRteVirtualBackgroundOptions | undefined; get aiDenoiseLevel(): AgoraRtcAiDenoiseLevel | undefined; }; export type AgoraDeviceManagerObserver = AgoraRtcSourceManagerObserver & Pick & { onSpeakerDeviceChanged?(deviceId: string): void; onOutputVolumeAdjusted?(volume: number): void; }; export interface AgoraRtcWebStreamPublishPoolItem extends AgoraRtcStreamPublishPoolItem { }