@checksub_team/peaks_timeline
Version:
JavaScript UI component for displaying audio waveforms
57 lines (48 loc) • 936 B
JavaScript
/**
* @file
*
* Defines the {@link data} class.
*
* @module data
*/
define([
], function() {
'use strict';
/**
* A data object associated with a source.
*
* @class
* @alias Data
*
* @param {String} type The MIME type (image, video, audio...)
* @param {Object} content Content of the data retrieved.
*/
function Data(type, content) {
this._type = type;
this._content = content;
}
Object.defineProperties(Data.prototype, {
type: {
enumerable: true,
get: function() {
return this._type;
},
set: function(type) {
this._type = type;
}
},
content: {
enumerable: true,
get: function() {
return this._content;
},
set: function(content) {
this._content = content;
}
}
});
Data.prototype.isComplete = function() {
return this._type && this._content;
};
return Data;
});