@mixer/interactive-node
Version:
A NodeJS and Browser compatible client for mixer.com's interactive 2 Protocol
53 lines • 1.88 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Control_1 = require("./Control");
/**
* Label can be used to title and group different controls.
*/
var Label = /** @class */ (function (_super) {
__extends(Label, _super);
function Label() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Sets a new text value for this label.
*/
Label.prototype.setText = function (text) {
return this.updateAttribute('text', text);
};
/**
* Sets a progress value for this label.
* A decimalized percentage (0.0 - 1.0)
*/
Label.prototype.setTextSize = function (textSize) {
return this.updateAttribute('textSize', textSize);
};
/**
* Sets a new text color for this label.
*/
Label.prototype.setTextColor = function (textColor) {
return this.updateAttribute('textColor', textColor);
};
/**
* Update this label on the server.
*/
Label.prototype.update = function (controlUpdate) {
// Clone to prevent mutations
// XXX: Typescript 2.4 is strict, let the compiler be clever.
var changedData = Object.assign({}, controlUpdate);
return _super.prototype.update.call(this, changedData);
};
return Label;
}(Control_1.Control));
exports.Label = Label;
//# sourceMappingURL=Label.js.map