LabeledBox.js 874 B

12345678910111213141516171819202122232425
  1. import { __extends } from "tslib";
  2. import { isValidNumber } from '../utils';
  3. import { Box } from './Box';
  4. var LabeledBox = /** @class */ (function (_super) {
  5. __extends(LabeledBox, _super);
  6. function LabeledBox(box, label) {
  7. var _this = _super.call(this, box) || this;
  8. _this._label = label;
  9. return _this;
  10. }
  11. LabeledBox.assertIsValidLabeledBox = function (box, callee) {
  12. Box.assertIsValidBox(box, callee);
  13. if (!isValidNumber(box.label)) {
  14. throw new Error(callee + " - expected property label (" + box.label + ") to be a number");
  15. }
  16. };
  17. Object.defineProperty(LabeledBox.prototype, "label", {
  18. get: function () { return this._label; },
  19. enumerable: true,
  20. configurable: true
  21. });
  22. return LabeledBox;
  23. }(Box));
  24. export { LabeledBox };
  25. //# sourceMappingURL=LabeledBox.js.map