@hscmap/inertial-wheel
Advanced tools
Comparing version 0.2.0 to 0.4.0
@@ -20,7 +20,8 @@ export interface Callbacks { | ||
constructor(target: HTMLElement, cb: Callbacks); | ||
setParams({beta, t0, v0}: { | ||
private readonly t0; | ||
setParams(override: Partial<{ | ||
beta: number; | ||
t0: number; | ||
v0: number; | ||
}): void; | ||
}>): void; | ||
teardown(): void; | ||
@@ -27,0 +28,0 @@ stop(): void; |
"use strict"; | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -35,7 +43,14 @@ var magic_trackpad_detector_1 = require("@hscmap/magic-trackpad-detector"); | ||
} | ||
InertialWheel.prototype.setParams = function (_a) { | ||
var beta = _a.beta, t0 = _a.t0, v0 = _a.v0; | ||
this.beta = beta; | ||
this.tau = t0 * this.beta; | ||
this.v0 = v0; | ||
Object.defineProperty(InertialWheel.prototype, "t0", { | ||
get: function () { | ||
return this.tau / this.beta; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
InertialWheel.prototype.setParams = function (override) { | ||
var p = __assign({ beta: this.beta, t0: this.t0, v0: this.v0 }, override); | ||
this.beta = p.beta; | ||
this.tau = p.t0 * this.beta; | ||
this.v0 = p.v0; | ||
this.eta = this.beta / this.tau; | ||
@@ -42,0 +57,0 @@ }; |
{ | ||
"name": "@hscmap/inertial-wheel", | ||
"version": "0.2.0", | ||
"version": "0.4.0", | ||
"main": "./lib/index.js", | ||
@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts", |
@@ -32,6 +32,11 @@ import { MagicTrackpadDetector } from "@hscmap/magic-trackpad-detector" | ||
setParams({ beta, t0, v0 }: { beta: number, t0: number, v0: number }) { | ||
this.beta = beta | ||
this.tau = t0 * this.beta | ||
this.v0 = v0 | ||
private get t0() { | ||
return this.tau / this.beta | ||
} | ||
setParams(override: Partial<{ beta: number, t0: number, v0: number }>) { | ||
const p = { beta: this.beta, t0: this.t0, v0: this.v0, ...override } | ||
this.beta = p.beta | ||
this.tau = p.t0 * this.beta | ||
this.v0 = p.v0 | ||
this.eta = this.beta / this.tau | ||
@@ -38,0 +43,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16196
342