Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(id?: Value, mode: MirrorMode = MirrorMode.default) {
super();
if (id === void 0) {
id = Text.from(Data.random(6).toBase64());
}
this.onMouseDown = this.onMouseDown.bind(this);
this.onMouseMove = this.onMouseMove.bind(this);
this.onMouseUp = this.onMouseUp.bind(this);
this.onTouchStart = this.onTouchStart.bind(this);
this.onTouchMove = this.onTouchMove.bind(this);
this.onTouchCancel = this.onTouchCancel.bind(this);
this.onTouchEnd = this.onTouchEnd.bind(this);
this.id = id;
this.mode = mode;
this.color = Color.fromAny(MirrorView.colors[Math.floor(MirrorView.colors.length * Math.random())]);
this.captive = false;
this._touchCount = 0;
this._presses = {};
}