agora-edu-core
Version:
Core APIs for building an online classroom
168 lines (164 loc) • 4.9 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CloudDriveUploadingProgress = exports.CloudDriveResource = void 0;
var _mobx = require("mobx");
var _type = require("./type");
var _class, _descriptor, _descriptor2;
function _initializerDefineProperty(e, i, r, l) { r && Object.defineProperty(e, i, { enumerable: r.enumerable, configurable: r.configurable, writable: r.writable, value: r.initializer ? r.initializer.call(l) : void 0 }); }
function _applyDecoratedDescriptor(i, e, r, n, l) { var a = {}; return Object.keys(n).forEach(function (i) { a[i] = n[i]; }), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) { return n(i, e, r) || r; }, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a; }
function _initializerWarningHelper(r, e) { throw Error("Decorating class property failed. Please ensure that transform-class-properties is enabled and runs after the decorators transform."); }
/**
* 资源对象
* 支持类型 `` 'bmp', 'jpg', 'png','gif', 'pdf', 'jpeg', 'pptx', 'ppt', 'doc', 'docx', 'mp3','mp4',``
*
*/
/** @en
* CloudDriveResource
* support `` 'bmp', 'jpg', 'png','gif', 'pdf', 'jpeg', 'pptx', 'ppt', 'doc', 'docx', 'mp3','mp4',``
*
*/
class CloudDriveResource {
constructor(data) {
/**
* 资源扩展名
*/
/** @en
* Extension name of the resource file
*/
this.ext = void 0;
/**
* 资源文件名称
*/
/** @en
* Resource name of the resource file
*/
this.resourceName = void 0;
/**
* 资源文件 UUID
*/
/** @en
* UUID of the resource file
*/
this.resourceUuid = void 0;
/**
* 资源文件大小,单位:字节
*/
/** @en
* File size in bytes
*/
this.size = void 0;
/**
* 最近更新时间
*/
/** @en
* Last update time
*/
this.updateTime = void 0;
/**
* @deprecated
*
* 是否进入教室后自动打开课件,目前未实现
*/
/** @en
* @deprecated
* Wether automatically open the file after classroom is launched, currently not implemented.
*/
this.initOpen = void 0;
/**
* 资源文件 URL
*/
/** @en
* Resource file URL
*/
this.url = void 0;
this.ext = data.ext;
this.resourceName = data.resourceName;
this.resourceUuid = data.resourceUuid;
this.size = data.size;
this.updateTime = data.updateTime;
this.initOpen = data.initOpen;
this.url = data.url;
}
}
/**
* 资源上传进度对象
*/
/** @en
* Cloud Drive Uploading Progress
*/
exports.CloudDriveResource = CloudDriveResource;
let CloudDriveUploadingProgress = exports.CloudDriveUploadingProgress = (_class = class CloudDriveUploadingProgress {
constructor(data) {
var _data$resourceUuid, _data$size, _data$updateTime;
/**
* 资源扩展名
*/
/** @en
* Extension name of the resource file
*/
this.ext = void 0;
/**
* 资源文件名称
*/
/** @en
* Resource name of the resource file
*/
this.resourceName = void 0;
/**
* 资源文件 UUID
*/
/** @en
* UUID of the resource file
*/
this.resourceUuid = void 0;
/**
* 资源文件大小,单位:字节
*/
/** @en
* File size in bytes
*/
this.size = void 0;
/**
* 最近更新时间
*/
/** @en
* Last update time
*/
this.updateTime = void 0;
/**
* 上传状态
*/
/** @en
* Upload status
*/
_initializerDefineProperty(this, "status", _descriptor, this);
/**
* 上传进度
*/
/** @en
* Upload progress
*/
_initializerDefineProperty(this, "progress", _descriptor2, this);
this.ext = data.ext;
this.resourceName = data.resourceName;
this.resourceUuid = (_data$resourceUuid = data.resourceUuid) !== null && _data$resourceUuid !== void 0 ? _data$resourceUuid : '';
this.size = (_data$size = data.size) !== null && _data$size !== void 0 ? _data$size : 0;
this.updateTime = (_data$updateTime = data.updateTime) !== null && _data$updateTime !== void 0 ? _data$updateTime : 0;
}
}, _descriptor = _applyDecoratedDescriptor(_class.prototype, "status", [_mobx.observable], {
configurable: true,
enumerable: true,
writable: true,
initializer: function () {
return _type.CloudDriveResourceUploadStatus.Pending;
}
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, "progress", [_mobx.observable], {
configurable: true,
enumerable: true,
writable: true,
initializer: function () {
return 0;
}
}), _class);