UNPKG

@pilotlab/lux-attributes

Version:

A luxurious user experience framework, developed by your friends at Pilot.

38 lines 1.8 kB
"use strict"; 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 attributeEnums_1 = require("../attributeEnums"); var lux_attributes_1 = require("@pilotlab/lux-attributes"); var AttributeInt = (function (_super) { __extends(AttributeInt, _super); function AttributeInt(key, value, label) { if (value === void 0) { value = 0; } var _this = _super.call(this, key, value, attributeEnums_1.DataType.NUMBER_INT, label) || this; _this.validate = function (value) { return parseInt(value); }; return _this; } Object.defineProperty(AttributeInt.prototype, "value", { get: function () { return Math.round(this.p_value); }, enumerable: true, configurable: true }); AttributeInt.prototype.go = function (target, durationSpeed, ease, repeatCount) { if (repeatCount === void 0) { repeatCount = 0; } var options = new lux_attributes_1.AttributeChangeOptions(lux_attributes_1.AttributeChangeActions.SIGNAL_CHANGE, durationSpeed, ease); options.repeatCount = repeatCount; return this.attributes.update(target, options); }; return AttributeInt; }(lux_attributes_1.Attribute)); exports.AttributeInt = AttributeInt; exports.default = AttributeInt; //# sourceMappingURL=attributeInt.js.map