agora-edu-core-lb
Version:
For publishing npm package agora-edu-core (Web & Electron). Get more information from https://docs.agora.io
280 lines (279 loc) • 7.34 kB
TypeScript
import { EduRoleTypeEnum, EduVideoEncoderConfiguration, EduRoomTypeEnum, MediaEncryptionConfig } from 'agora-rte-sdk';
import { SceneDefinition } from 'white-web-sdk';
export declare type AgoraExtAppUserInfo = {
userUuid: string;
userName: string;
roleType: number;
};
export declare type AgoraExtAppRoomInfo = {
roomUuid: string;
roomName: string;
roomType: number;
};
export declare type AgoraExtAppContext = {
properties: any;
dependencies: Map<string, any>;
localUserInfo: AgoraExtAppUserInfo;
roomInfo: AgoraExtAppRoomInfo;
language: string;
};
export declare type AgoraExtAppHandle = {
updateRoomProperty: (properties: any, common: any, cause: any) => Promise<void>;
deleteRoomProperties: (properties: string[], cause: any) => Promise<void>;
};
export interface IAgoraExtApp {
language: string;
appIdentifier: string;
appName: string;
width: number;
height: number;
extAppDidLoad(dom: Element, ctx: AgoraExtAppContext, handle: AgoraExtAppHandle): void;
extAppRoomPropertiesDidUpdate(properties: any, cause: any): void;
extAppWillUnload(): void;
}
export declare type AgoraWidgetUserInfo = {
userUuid: string;
userName: string;
roleType: number;
};
export declare type AgoraWidgetRoomInfo = {
roomUuid: string;
roomName: string;
roomType: number;
};
export declare type AgoraWidgetContext = {
events: any;
actions: any;
dependencies: Map<string, any>;
localUserInfo: AgoraWidgetUserInfo;
roomInfo: AgoraWidgetRoomInfo;
language: string;
};
export declare type AgoraWidgetHandle = {
updateRoomProperty: (properties: any, cause: any) => Promise<void>;
deleteRoomProperties: (properties: string[], cause: any) => Promise<void>;
};
export interface IAgoraWidget {
widgetId: string;
widgetDidLoad(dom: Element, ctx: AgoraWidgetContext, widgetProps: any): void;
widgetRoomPropertiesDidUpdate(properties: any, cause: any): void;
widgetWillUnload(): void;
}
export declare type AgoraConvertedFile = {
width: number;
height: number;
ppt: {
width: number;
src: string;
height: number;
};
conversionFileUrl: string;
};
export declare type ConvertedFileList = AgoraConvertedFile[];
export declare type CourseWareItem = {
resourceName: string;
resourceUuid: string;
ext: string;
url: string;
conversion: {
type: string;
};
size: number;
updateTime: number;
scenes: SceneDefinition[];
convert?: boolean;
taskUuid?: string;
taskToken?: string;
taskProgress?: {
totalPageSize?: number;
convertedPageSize?: number;
convertedPercentage?: number;
convertedFileList: ConvertedFileList;
};
isActive?: boolean;
};
export declare type CourseWareList = CourseWareItem[];
declare type RoomInfoParams = {
roomName: string;
roomType: number;
roomUuid: string;
userName: string;
userRole: number;
userUuid: string;
};
export declare type AgoraRegion = Uppercase<AgoraRegionString>;
export declare const regionMap: {
readonly AP: "sg";
readonly CN: "cn-hz";
readonly EU: "gb-lon";
readonly NA: "us-sv";
};
export declare type AgoraRegionString = 'cn' | 'ap' | 'na';
export declare type BoardOptionUserPayload = {
avatar?: string;
cursorName?: string;
disappearCursor?: boolean;
};
export declare type BoardOptions = {
userPayload?: BoardOptionUserPayload;
};
export declare type MediaOptions = {
cameraEncoderConfiguration?: EduVideoEncoderConfiguration;
screenShareEncoderConfiguration?: EduVideoEncoderConfiguration;
encryptionConfig?: MediaEncryptionConfig;
};
export declare type AppStoreConfigParams = {
agoraAppId: string;
agoraNetlessAppId: string;
enableLog: boolean;
sdkDomain: string;
rtmUid: string;
rtmToken: string;
courseWareList: CourseWareList;
region?: AgoraRegion;
rtcArea?: string;
rtmArea?: string;
personalCourseWareList?: CourseWareList;
vid?: number;
oss?: {
region: string;
bucketName: string;
folder: string;
accessKey: string;
secretKey: string;
endpoint: string;
};
recordUrl: string;
extApps?: IAgoraExtApp[];
widgets?: {
[key: string]: IAgoraWidget;
};
userFlexProperties?: {
[key: string]: any;
};
mediaOptions?: MediaOptions;
boardOptions?: BoardOptions;
latencyLevel?: 1 | 2;
};
export declare type LanguageEnum = 'en' | 'zh';
export declare type AppStoreInitParams = {
roomInfoParams?: RoomInfoParams;
config: AppStoreConfigParams;
language: LanguageEnum;
startTime?: number;
duration?: number;
pretest?: boolean;
mainPath?: string;
roomPath?: string;
resetRoomInfo: boolean;
};
export declare type RoomInfo = {
roomName: string;
roomType: number;
userName: string;
userRole: EduRoleTypeEnum;
userUuid: string;
roomUuid: string;
rtmUid: string;
rtmToken: string;
groupName?: string;
groupUuid?: string;
};
export declare type DeviceInfo = {
cameraName: string;
microphoneName: string;
};
export declare type RoomConfigProps<T> = {
store: T;
};
export interface RoomComponentConfigProps<T> {
store: T;
dom: Element;
}
export declare enum AgoraEduEvent {
ready = 1,
destroyed = 2,
clicked = 3
}
/**
* LaunchOption 接口
*/
export declare type LaunchOption = {
userUuid: string;
userName: string;
roomUuid: string;
roleType: EduRoleTypeEnum;
roomType: EduRoomTypeEnum;
roomName: string;
listener: ListenerCallback;
pretest: boolean;
rtmToken: string;
language: LanguageEnum;
startTime: number;
duration: number;
courseWareList: CourseWareList;
personalCourseWareList?: CourseWareList;
recordUrl?: string;
extApps?: IAgoraExtApp[];
region?: AgoraRegion;
widgets?: {
[key: string]: IAgoraWidget;
};
userFlexProperties?: {
[key: string]: any;
};
mediaOptions?: MediaOptions;
latencyLevel?: 1 | 2;
};
export declare type AgoraEduSDKConfigParams = {
appId: string;
region?: string;
};
export interface RoomParameters {
roomUuid: string;
userUuid: string;
roomName: string;
userName: string;
userRole: EduRoleTypeEnum;
roomType: number;
}
export declare type ListenerCallback = (evt: AgoraEduEvent) => void;
export declare type PPTDataType = {
active: boolean;
pptType: PPTType;
id: string;
data: any;
cover: any;
showName: string;
};
export declare enum PPTType {
dynamic = "dynamic",
static = "static",
mp4 = "mp4",
mp3 = "mp3",
init = "init"
}
export declare type NetlessImageFile = {
width: number;
height: number;
file: File;
coordinateX: number;
coordinateY: number;
};
export declare type TaskType = {
uuid: string;
folder: string;
imageFile: NetlessImageFile;
};
export declare type OssExistsFileInfo = {
isExist: boolean;
fileOssUrl: string;
findInfo: string;
};
export declare type PPTProgressListener = (phase: PPTProgressPhase, percent: number) => void;
export declare enum PPTProgressPhase {
Checking = 0,
Uploading = 1,
Converting = 2
}
export {};