@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.
64 lines • 2.45 kB
JavaScript
import { arraysIsEqual } from "@aurigma/utils-js/algorithms/array";
export class ThemeBinding {
constructor() {
this.styles = [];
this.clipartColors = [];
}
static fromRaw(object) {
var result = new ThemeBinding();
result.text = object.text;
result.stroke = object.stroke;
result.shadow = object.shadow;
result.img = object.img;
result.border = object.border;
result.fill = object.fill;
result.textFill = object.textFill;
result.line = object.line;
result.altline = object.altline;
result.horizontal = object.horizontal;
result.vertical = object.vertical;
result.barcode = object.barcode;
result.styles = object.styles != null ? object.styles.slice(0) : null;
result.clipartColors = object.clipartColors != null ? object.clipartColors.slice(0) : null;
return result;
}
clone() {
const clone = new ThemeBinding();
clone.text = this.text;
clone.stroke = this.stroke;
clone.shadow = this.shadow;
clone.img = this.img;
clone.border = this.border;
clone.fill = this.fill;
clone.textFill = this.textFill;
clone.line = this.line;
clone.altline = this.altline;
clone.horizontal = this.horizontal;
clone.vertical = this.vertical;
clone.barcode = this.barcode;
clone.styles = this.styles != null
? this.styles.slice(0)
: null;
clone.clipartColors = this.clipartColors != null
? this.clipartColors.slice(0)
: null;
return clone;
}
equals(other) {
return this.text === other.text &&
this.stroke === other.stroke &&
this.shadow === other.shadow &&
this.img === other.img &&
this.border === other.border &&
this.fill === other.fill &&
this.textFill === other.textFill &&
this.line === other.line &&
this.altline === other.altline &&
this.horizontal === other.horizontal &&
this.vertical === other.vertical &&
this.barcode === other.barcode &&
arraysIsEqual(this.styles, other.styles) &&
arraysIsEqual(this.clipartColors, other.clipartColors);
}
}
//# sourceMappingURL=ThemeBinding.js.map