@coze/realtime-api
Version:
A powerful real-time communication SDK for voice interactions with Coze AI bots | 扣子官方实时通信 SDK,用于与 Coze AI bots 进行语音交互
50 lines (49 loc) • 1.66 kB
TypeScript
/**
+ * Delays execution for the specified duration
+ * @param milliseconds The time to sleep in milliseconds
+ * @throws {Error} If milliseconds is negative
+ * @returns Promise that resolves after the specified duration
+ */
export declare const sleep: (milliseconds: number) => Promise<void>;
/**
* @deprecated use checkDevicePermission instead
* Check microphone permission,return boolean
*/
export declare const checkPermission: ({ audio, video, }?: {
audio?: boolean;
video?: boolean;
}) => Promise<boolean>;
/**
* Checks device permissions for audio and video
* @param checkVideo Whether to check video permissions (default: false)
* @returns Promise that resolves with the device permission status
*/
export declare const checkDevicePermission: (checkVideo?: boolean) => Promise<{
video: boolean;
audio: boolean;
videoExceptionError?: DOMException | undefined;
audioExceptionError?: DOMException | undefined;
}>;
/**
* Get audio devices
* @returns Promise<AudioDevices> Object containing arrays of audio input and output devices
*/
export declare const getAudioDevices: ({ video, }?: {
video?: boolean;
}) => Promise<{
audioInputs: MediaDeviceInfo[];
audioOutputs: MediaDeviceInfo[];
videoInputs: MediaDeviceInfo[];
}>;
export declare const isScreenShareDevice: (deviceId?: string) => boolean;
/**
* 判断是否前后置摄像头
* @param deviceId
* @returns
*/
export declare const isMobileVideoDevice: (deviceId?: string) => boolean;
/**
* Check if browser supports screen sharing
* 检查浏览器是否支持屏幕共享
*/
export declare function isScreenShareSupported(): boolean;