UNPKG

fcr-core

Version:

Core APIs for building online scenes

301 lines (300 loc) 14.6 kB
import { AgoraRtcNetworkStats, AgoraRteNetworkQualityEvent, AgoraRtcDeviceInfo, AgoraRtcDisplayInfo, AgoraRtcWindowInfo, AgoraRtePerformanceInfo, AgoraRteScenePropertiesDeletedEvent, AgoraRteStreamEncryptionConfig, AgoraRteStreamJoinConfig, AgoraRteDualVideoStreamConfig, AgoraRteMessage, AgoraRteConnectionState, AgoraRteScenePropertiesUpdatedEvent, AgoraRteOperatCause, AgoraRteRenderView, AgoraRteUploadEvent, AgoraRteVideoEncoderConfig, FcrWhiteboardView } from './imports'; import { FcrSharePermissionState } from './room-control/sharing-control/type'; import { FcrUserRole } from './room-control/user-control/type'; import type { FcrAudioSourceType, FcrMediaSourceState, FcrRegion, FcrRoomConnectorType, FcrStreamType, FcrVideoSourceType } from '.'; import { FcrLineType, FcrRoomJoinOptions, FcrRoomType } from './room-control/type'; import { FcrGroupCreateConfigSchema, FcrGroupUpdateOptionsSchema, FcrRenderConfigSchema, FcrRoomJoinOptionsWithTicketSchema, FcrSessionBaseSchema } from './schema'; import { FcrRoomRoute } from './room-router/type'; export type { FcrBaseRoomControl, FcrRoomObserver } from './room-control/type'; export type { FcrChatConnection, FcrChatConnectionObserver, FcrChatConnectionState, } from './chat-connection/type'; export type FcrCoreEngineConfig = { /** 应用唯一标识 */ appId: string; /** 身份验证令牌 */ token: string; /** 用户唯一标识 */ userId: string; /** 服务区域 */ region: FcrRegion; /** 双摄像头视频流配置 */ dualCameraVideoStreamConfig: AgoraRteDualVideoStreamConfig; /** 双屏幕视频流配置 */ dualScreenVideoStreamConfig: AgoraRteDualVideoStreamConfig; /** 额外参数配置 */ parameters?: Record<string, unknown>; }; export { AgoraRteRegion as FcrRegion, AgoraRteMediaStreamType as FcrStreamType, AgoraRteUserUpdatedReason as FcrUserUpdatedReason, AgoraRteRoomConnectorType as FcrRoomConnectorType, AgoraRtcVideoSourceType as FcrVideoSourceType, AgoraRtcAudioSourceType as FcrAudioSourceType, AgoraRtcMediaSourceState as FcrMediaSourceState, AgoraRtcRenderMode as FcrVideoRenderMode, AgoraRtcVideoStreamType as FcrVideoStreamType, AgoraRtcCapability as FcrCapability, AgoraRtcAiDenoiseLevel as FcrAiDenoiseLevel, AgoraRteStreamPrivilegeOperation as FcrStreamPrivilegeOperation, AgoraRteStreamPrivilegeVideoSourceType as FcrStreamPrivilegeVideoSourceType, AgoraRteStreamPrivilegeAudioSourceType as FcrStreamPrivilegeAudioSourceType, AgoraRteConnectionState as FcrConnectionState, AgoraRteLatencyLevel as FcrStreamLatencyLevel, AgoraRteScreenCaptureType as FcrScreenCaptureType, AgoraRteVideoOrientation as FcrVideoOrientation, FcrCoreEngine, registerPlugin, } from './imports'; export type FcrDualVideoStreamConfig = AgoraRteDualVideoStreamConfig; export type FcrMessage = AgoraRteMessage; export type FcrRenderView = AgoraRteRenderView; export type { FcrAudioOutputRouting, FcrDesktopMediaObserver, FcrDesktopMediaControl, FcrMobileMediaControl, FcrMobileMediaObserver, } from './media-control/type'; export type { FcrMonitorControl, FcrMonitorObserver } from './monitor-control/type'; export type { FcrPeerSessionControl, FcrPeerSessionObserver } from './peer-session/type'; export type { FcrAbilityControl } from './room-control/ability-control/type'; export { FcrAbility } from './room-control/ability-control/type'; export type { FcrChatRoomControl, FcrChatRoomObserver, FcrChatRoomControlInitConfig, FcrChatRoomSendBaseMessage, FcrChatRoomSendTextMessage, FcrChatRoomReceivedTextMessage, FcrChatRoomReceivedBaseMessage, FcrChatRoomFile, FcrChatRoomReceivedImageMessage, FcrChatRoomSendImageMessage, FcrChatRoomReceiveCustomMessage, } from './room-control/chatroom-control/type'; export { FcrChatRoomConnectionState, FcrChatRoomMessageType, } from './room-control/chatroom-control/type'; export type { FcrInterpreterState, FcrInterpreterUsersParams, FcrInterpreterRoomInfo, FcrLanguageChannelInfo, FcrInterpreterObserver, FcrInterpreterRoomControl, } from './room-control/interpreter-control/types'; export { FcrLanguage, FcrInterpreterActionType } from './room-control/interpreter-control/types'; export type { FcrPrivilegeControl, FcrPrivilegeObserver, FcrSecurityObj, FcrSecurityInfo, FcrSecuritySendChatPayload, FcrSecuritySharePayload, FcrSecurityWriteBoardPayload, FcrSecurityPrivateChatConfig, FcrSecurityInfoUpdatedEvent, FcrPermissionInfoAddedEvent, FcrPermissionInfoDeletedEvent, FcrPermission, FcrPermissionInfo, } from './room-control/privilege-control/type'; export { FcrPrivilegeUserRole, FcrPermissionAction, FcrOperatePermissionType, FcrChatPermissionType, FcrSecurityAction, FcrWatermarkPermissionState, FcrPrivilegeUserRoleToStringMap, FcrPrivilegeUserStringToRoleMap, } from './room-control/privilege-control/type'; export type { FcrRoomConnectorControl, FcrRoomConnectorObserver, FcrRoomConnectorPhoneInfo, FcrRoomConnectorIpInfo, FcrPhoneConnectorSessionParams, FcrIPConnectorSessionParams, FcrPhoneConnectorSession, FcrIPConnectorSession, } from './room-control/room-connector-control/type'; export { FcrIPConnectorSessionType, FcrRoomConnectorSessionReason, FcrRoomConnectorSessionState, FcrRoomConnectorPhoneRegion, } from './room-control/room-connector-control/type'; export type { FcrRoomSessionControl, FcrRoomSessionObserver, FcrRoomSessionParams, FcrRoomSession, } from './room-control/room-session/type'; export type { FcrSharingControl, FcrSharingObserver } from './room-control/sharing-control/type'; export { FcrScreenSharingState, FcrWhiteboardState } from './room-control/sharing-control/type'; export type { FcrStreamControl, FcrStreamObserver, FcrLocalStreamCreateConfig, FcrStreamCreateConfig, FcrUpdateStreamPrivilege, FcrUpdateStreamPrivilegeScope, FcrLocalVideoStats, FcrLocalAudioStats, FcrRemoteVideoStats, FcrRemoteAudioStats, FcrSize, FcrDimensions, FcrSnapshotInfo, FcrStreamEvent, } from './room-control/stream-control/type'; export type { FcrUserControl, FcrUserObserver, FcrUserPageParams, FcrUserPageResponse, FcrUserJoinedEvent, FcrUserLeftEvent, FcrUserUpdatedEvent, FcrUserPropertiesUpdatedEvent, FcrUserPropertiesDeletedEvent, FcrUserKickedOutEvent, } from './room-control/user-control/type'; export { FcrUserLeftReason, FcrUserKickedOutType, FcrUserRole, } from './room-control/user-control/type'; export type { FcrAnnotationControl, FcrAnnotationConfig, } from './room-control/whiteboard-control-v2/annotation-control/type'; export type { FcrWhiteboardControl, FcrWhiteboardObserver, FcrBoardConfig, } from './room-control/whiteboard-control-v2/whiteboard-control/type'; export type { FcrRoomControlType, FcrRoomRouterObserver, FcrRoomRoute, FcrRoomRouter, FcrRoomControlImplType, } from './room-router/type'; export type { FcrChatRoomTokenResData, FcrCheckInParams } from './service/type'; export type FcrCoreEngineObserver = { /** 连接状态更新回调 */ onConnectionStateUpdated?(state: FcrConnectionState): void; /** 收到点对点消息回调 */ onPeerMessageReceived?(message: FcrMessage): void; /** 用户令牌即将过期回调 */ onUserTokenWillExpire?(): void; }; 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; readonly label?: Record<string, unknown>; }; /** 平台类型枚举 */ export declare enum FcrPlatform { UNSUPPORTED = -1, WEB_DESKTOP = 1, MACOS = 2, WINDOWS = 3, IOS = 4, ANDROID = 5, WEB_MOBILE = 6, HARMONY = 7, CONNECTOR_PSTN = 101, CONNECTOR_SIP = 102, CONNECTOR_H323 = 103 } /** 用户信息类型 */ export type FcrUserInfo = { readonly userId: string; readonly userName: string; readonly userRole: FcrUserRole; readonly connectorType: FcrRoomConnectorType; readonly platform: FcrPlatform; readonly avatar: string; }; /** 流信息类型 */ 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 sceonds. */ readonly duration: number; /** 日程开始时间(秒) */ /** * The start time of the schedule, in sceonds. */ readonly startTime: number; }; /** 录制信息 */ export type FcrRecordInfo = { /** 云端录制状态 */ /** * The state of cloud recording. */ readonly state: FcrRecordingState; }; type FcrConnectionState = AgoraRteConnectionState; export type FcrGroupInfoFromSceneProperties = { [groupId: string]: { groupName: string; users: { userUuid: string; }[]; sort: number; }; }; export type FcrRoomJoinSnapshotOptions = { snapshot: unknown; timestamp: number; } & Partial<FcrRoomJoinOptions>; export type FcrRoomJoinOptionsWithTicket = FcrRoomJoinOptionsWithTicketSchema; export type FcrGroupInfo = { groupId: string; groupName: string; }; export type FcrGroupCreateConfig = FcrGroupCreateConfigSchema; export type FcrGroupUpdateOptions = FcrGroupUpdateOptionsSchema; export type FcrGroupEventBase = { operatorUser?: FcrUserInfo; }; export type FcrGroupAddedEvent = FcrGroupEventBase & { info: FcrGroupInfo; }; export type FcrGroupUpdatedEvent = FcrGroupEventBase & { info: FcrGroupInfo; }; export type FcrGroupRemovedEvent = FcrGroupEventBase & { info: FcrGroupInfo; }; export type FcrGroupUserAddedEvent = FcrGroupEventBase & { groupId: string; userId: string; }; export type FcrGroupUserMovedEvent = FcrGroupEventBase & { fromGroupId: string; toGroupId: string; userId: string; }; export type FcrGroupUserRemovedEvent = FcrGroupEventBase & { groupId: string; userId: string; }; export type FcrRoomRouteSwitchEvent = { targetRouting: FcrRoomRoute; 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 type FcrSessionBase = FcrSessionBaseSchema; export type FcrSessionResponse = { sessionId: string; sessionKey: string; responderId: string; payload: Record<string, unknown>; cause: Record<string, unknown>; }; export type FcrOperateCause = AgoraRteOperatCause; export type FcrStreamEncryptionConfig = AgoraRteStreamEncryptionConfig; 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 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 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; }; annotation?: { start?: FcrSharePermissionState; write?: FcrSharePermissionState; }; }; export type FcrAnnotationProps = { write?: FcrSharePermissionState; }; export type FcrVideoRenderConfig = FcrRenderConfigSchema; export type FcrAllowWatermarkPayloadBody = { lineType: FcrLineType; }; export declare enum RoomMessageKey { USER_WAITING_ROOM_JOINED = "USER_WAITING_ROOM_JOINED" } export type FcrMonitorUploadEvent = AgoraRteUploadEvent; export { FcrLineType } from './room-control/type'; export { FcrDeviceType } from './media-control/type'; export declare enum FcrStreamState { UNPUBLISH = 0, PUBLISH = 1 } export { FcrError } from './utilities/error'; export type FcrWhiteboardParameters = { cursor?: boolean; syncMode?: boolean; extras?: unknown; extendClass?: unknown; windowManagerParams?: unknown; floatBar?: unknown; containerElement?: FcrWhiteboardView; }; export { FcrBoardToolType, FcrBoardShape } from './room-control/whiteboard-control-v2/enum'; export type { FcrBoardMainWindow, FcrBoardMainWindowObserver, } from './room-control/whiteboard-control-v2/type'; export type { FcrColor } from './room-control/whiteboard-control/type'; export type { FcrLanguageConfig } from './room-control/stt-control/type';