UNPKG

fcr-core

Version:

Core APIs for building online scenes

255 lines (254 loc) 7.95 kB
import { AgoraRtcNetworkStats, AgoraRteNetworkQualityEvent, AgoraRtcDeviceInfo, AgoraRtcDisplayInfo, AgoraRtcWindowInfo, AgoraRtePerformanceInfo, AgoraRteScenePropertiesDeletedEvent, AgoraRteStreamEncryptionConfig, AgoraRteStreamJoinConfig, AgoraRteDualVideoStreamConfig, AgoraRteMessage, AgoraRteConnectionState, AgoraRteScenePropertiesUpdatedEvent, AgoraRteOperatCause, AgoraRteRenderView, AgoraRteVideoEncoderConfig, AgoraRteLatencyLevel } from './imports'; import { FcrSharePermissionState } from './room-control/whiteboard-control/enums'; import { FcrUserLeftReason } from './room-control/user-control/type'; import { FcrAudioSourceType, FcrMediaSourceState, FcrRegion, FcrRoomConnectorType, FcrStreamType, FcrVideoRenderMode, FcrVideoSourceType } from '.'; import { FcrRoomJoinOptions, FcrRoomType } from './room-control/type'; export type FcrCoreEngineConfig = { appId: string; token: string; userId: string; region: FcrRegion; dualCameraVideoStreamConfig: FcrDualVideoStreamConfig; dualScreenVideoStreamConfig: FcrDualVideoStreamConfig; parameters?: Record<string, string | number | object>; }; export type FcrStreamLatencyLevel = AgoraRteLatencyLevel; export type FcrDualVideoStreamConfig = AgoraRteDualVideoStreamConfig; export declare enum FcrRoomState { Initialized = 0, Started = 1, Ended = 2, Closed = 3 } export declare enum FcrRecordingState { Starting = 1, Started = 2, Paused = 3, Stopped = 4 } export type FcrRoomInfo = { readonly roomId: string; readonly roomName: string; readonly roomType: FcrRoomType; readonly password?: string; readonly inviteLink?: string; }; export type FcrUserInfo = { readonly userId: string; readonly userName: string; readonly userRole: FcrUserRole; readonly connectorType: FcrRoomConnectorType; }; export type FcrStreamInfo = { readonly streamId: string; readonly streamName?: string; readonly owner: FcrUserInfo; readonly streamType: FcrStreamType; readonly videoSourceType: FcrVideoSourceType; readonly audioSourceType: FcrAudioSourceType; readonly videoSourceState: FcrMediaSourceState; readonly audioSourceState: FcrMediaSourceState; readonly videoSourceId?: string; readonly audioSourceId?: string; readonly connectorType: FcrRoomConnectorType; }; export type FcrRoomSchedule = { /** * The start time of the schedule, in milliseconds. */ readonly duration: number; /** * The start time of the schedule, in milliseconds. */ readonly startTime: number; }; export type FcrRecordInfo = { /** * The state of cloud recording. */ readonly state: FcrRecordingState; }; export type FcrMessage = AgoraRteMessage; type FcrConnectionState = AgoraRteConnectionState; export type FcrCoreEngineObserver = { onConnectionStateUpdated?(state: FcrConnectionState): void; onPeerMessageReceived?(message: FcrMessage): void; }; export type FcrSessionBase = { sessionId: string; sessionKey: string; timestamp: number; duration: number; payload: Record<string, unknown>; senderId: string; interval: number; }; export type FcrSessionResponse = { sessionId: string; sessionKey: string; responderId: string; payload: Record<string, unknown>; cause: Record<string, unknown>; }; export type FcrStreamEncryptionConfig = AgoraRteStreamEncryptionConfig; export declare enum FcrDeviceType { Camera = "camera", Microphone = "microphone", Speaker = "speaker" } export type FcrVideoEncoderConfig = AgoraRteVideoEncoderConfig; export type FcrDeviceInfo = AgoraRtcDeviceInfo; export type FcrWindowInfo = AgoraRtcWindowInfo; export type FcrDisplayInfo = AgoraRtcDisplayInfo; export type FcrPerformanceInfo = AgoraRtePerformanceInfo; export type FcrStreamJoinConfig = AgoraRteStreamJoinConfig; export type FcrRoomPropertiesUpdatedEvent = AgoraRteScenePropertiesUpdatedEvent; export type FcrRoomPropertiesDeletedEvent = AgoraRteScenePropertiesDeletedEvent; export type FcrNetworkQualityEvent = AgoraRteNetworkQualityEvent; export type FcrNetworkStats = AgoraRtcNetworkStats; export type FcrGroupInfoFromSceneProperties = { [groupId: string]: { groupName: string; users: { userUuid: string; }[]; sort: number; }; }; export type FcrRoomJoinSnapshotOptions = { snapshot: unknown; timestamp: number; } & Partial<FcrRoomJoinOptions>; export type FcrRoomJoinOptionsWithTicket = { ticket?: string; } & FcrRoomJoinOptions; export type FcrGroupInfo = { groupId: string; groupName: string; }; export type FcrGroupCreateConfig = { groupName: string; userList: string[]; }; export type FcrGroupUpdateOptions = { groupId: string; groupName: string; }; export type FcrGroupAddedEvent = { info: FcrGroupInfo; operatorUser?: FcrUserInfo; }; export type FcrGroupUpdatedEvent = { info: FcrGroupInfo; operatorUser?: FcrUserInfo; }; export type FcrGroupRemovedEvent = { info: FcrGroupInfo; operatorUser?: FcrUserInfo; }; export type FcrGroupUserAddedEvent = { groupId: string; userId: string; operatorUser?: FcrUserInfo; }; export type FcrGroupUserMovedEvent = { fromGroupId: string; toGroupId: string; userId: string; operatorUser?: FcrUserInfo; }; export type FcrGroupUserRemovedEvent = { groupId: string; userId: string; reason: FcrUserLeftReason; operatorUser?: FcrUserInfo; }; export type FcrGroupObserver = { onGroupsAdded(events: FcrGroupAddedEvent[]): void; onGroupsUpdated(events: FcrGroupUpdatedEvent[]): void; onGroupsRemoved(events: FcrGroupRemovedEvent[]): void; onUserListAddedToGroup(events: FcrGroupUserAddedEvent[]): void; onUserListMoveToGroup(events: FcrGroupUserMovedEvent[]): void; onUserListRemovedFromGroup(events: FcrGroupUserRemovedEvent[]): void; }; export declare enum FcrSessionState { Starting = 1, Stopped = 2 } export declare enum FcrStreamState { UNPUBLISH = 0, PUBLISH = 1 } export type FcrOperateCause = AgoraRteOperatCause; export declare enum FcrCloudRecordingAudioProfile { DEFAULT = 0,// mono 48khz 48kbps MONO_48KHZ_128KBPS = 1,// mono 48khz 128kbps STEREO_48KHZ_192KBPS = 2 } export type FcrCloudRecordingConfig = { videoEncoderConfig: FcrVideoEncoderConfig; audioProfile: FcrCloudRecordingAudioProfile; retryTimeout: number; }; export declare enum FcrUserRole { HOST = 1, COHOST = 2, PARTICIPANT = 3, AUDIENCE = 4, OBSERVER = 5, ROBOT = 6 } export declare const FcrUserRoleToStringMap: { readonly 1: "host"; readonly 2: "cohost"; readonly 3: "participant"; readonly 4: "audience"; readonly 5: "observer"; readonly 6: "robot"; }; export declare const FcrUserStringToRoleMap: { host: FcrUserRole; cohost: FcrUserRole; participant: FcrUserRole; audience: FcrUserRole; observer: FcrUserRole; robot: FcrUserRole; }; export declare enum FcrLiveStreamingLayoutType { GALLERY = 1, SPEAKER = 2 } export interface FcrLiveStreamingConfig { pushStreamingUrl: string; pushStreamingKey: string; pullStreamingUrl: string; layoutType: FcrLiveStreamingLayoutType; } export declare enum FcrLiveStreamingState { STARTING = 1, STARTED = 2, STOPPED = 3 } export type FcrSharePermissionProps = { screen?: FcrSharePermissionState; board?: { start?: FcrSharePermissionState; write?: FcrSharePermissionState; }; }; export type FcrVideoRenderConfig = { renderMode: FcrVideoRenderMode; isMirror: boolean; }; export declare enum FcrLineType { SINGLE_ROW = 1, MULTI_ROW = 2 } export type FcrAllowWatermarkPayloadBody = { lineType: FcrLineType; }; export declare enum RoomMessageKey { USER_WAITING_ROOM_JOINED = "USER_WAITING_ROOM_JOINED" } export type FcrRenderView = AgoraRteRenderView; export {};