UNPKG

react-agora

Version:
28 lines (27 loc) 1.31 kB
import { IAgoraRTCClient, IAgoraRTCRemoteUser, ILocalAudioTrack, ILocalVideoTrack, IMicrophoneAudioTrack } from 'agora-rtc-sdk-ng'; declare class Stream { selfMuted: boolean; joined: boolean; client: IAgoraRTCClient; screenClient: IAgoraRTCClient; appId: string; appCertificate: string; channelId: string; token: string; userId: number; localAudioTrack: IMicrophoneAudioTrack | null; localVideoTrack: ILocalVideoTrack | null; localScreenTrack: ILocalVideoTrack | [ILocalVideoTrack, ILocalAudioTrack] | null; activeStreamId: string | null; constructor(appId: string, appCertificate: string, channelId: string, userId: number, token: string); join: () => Promise<void>; leave: () => Promise<void>; onUserPublished: (user: IAgoraRTCRemoteUser, mediaType: 'video' | 'audio') => Promise<void>; startScreenShare: () => Promise<ILocalVideoTrack | [ILocalVideoTrack, ILocalAudioTrack]>; stopScreenShare: () => Promise<void>; onUserUnpublished: (user: IAgoraRTCRemoteUser) => void; toggleMuteSelf: () => void; changeActiveStream: (id: string) => void; } declare const generateToken: (appId: string, appCertificate: string, roomId: string, userId: number) => string | null; export { Stream, generateToken };