@aurigma/design-atoms-model
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
57 lines • 1.92 kB
JavaScript
import { Color } from "./Color";
import { validateComponent, validateStringProperty } from "./ValidationUtils";
var Ink = /** @class */ (function () {
function Ink(name, alternativeColor, solidity) {
if (solidity === void 0) { solidity = 1; }
this._name = validateStringProperty(name);
this._alternativeColor = alternativeColor;
this._solidity = validateComponent(solidity, 0, 1);
}
Object.defineProperty(Ink.prototype, "name", {
get: function () {
return this._name;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Ink.prototype, "alternativeColor", {
get: function () {
return this._alternativeColor;
},
enumerable: true,
configurable: true
});
Object.defineProperty(Ink.prototype, "solidity", {
get: function () {
return this._solidity;
},
enumerable: true,
configurable: true
});
Ink.equals = function (a, b) {
if (a == null && b == null)
return true;
if (a == null || b == null)
return false;
return a.equals(b);
};
Ink.prototype.equals = function (other) {
return this.name === other.name
&& this.solidity === other.solidity
&& Color.equals(this.alternativeColor, other.alternativeColor);
};
Ink.prototype.clone = function () {
return new Ink(this.name, this.alternativeColor, this.solidity);
};
Ink.prototype.getData = function () {
var _a;
return {
name: this.name,
alternativeColor: (_a = this.alternativeColor) === null || _a === void 0 ? void 0 : _a.getData(),
solidity: this.solidity
};
};
return Ink;
}());
export { Ink };
//# sourceMappingURL=Ink.js.map