Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/motion-sensors-polyfill/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class GravitySensor extends Accelerometer {
constructor(options?: AccelerometerSensorOptions);
}

interface GyroscopeSensorOptions {
interface GyroscopeSensorOptions extends SensorOptions {
referenceFrame?: GyroscopeLocalCoordinateSystem | undefined; // defauts to "device"
}

Expand Down
30 changes: 24 additions & 6 deletions types/motion-sensors-polyfill/motion-sensors-polyfill-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,52 @@ import {
// GeolocationSensor,
} from "motion-sensors-polyfill";

const accelerometer = new Accelerometer();
const accelerometer = new Accelerometer({
frequency: 60,
referenceFrame: "device",
});
accelerometer.timestamp;
accelerometer.x;
accelerometer.y;
accelerometer.z;

const linearAccelerationSensor = new LinearAccelerationSensor();
const linearAccelerationSensor = new LinearAccelerationSensor({
frequency: 60,
referenceFrame: "device",
});
linearAccelerationSensor.timestamp;
linearAccelerationSensor.x;
linearAccelerationSensor.y;
linearAccelerationSensor.z;

const gravitySensor = new GravitySensor();
const gravitySensor = new GravitySensor({
frequency: 60,
referenceFrame: "screen",
});
gravitySensor.timestamp;
gravitySensor.x;
gravitySensor.y;
gravitySensor.z;

const gyroscope = new Gyroscope();
const gyroscope = new Gyroscope({
frequency: 60,
referenceFrame: "device",
});
gyroscope.x;
gyroscope.y;
gyroscope.z;

const absoluteOrientation = new AbsoluteOrientationSensor();
const absoluteOrientation = new AbsoluteOrientationSensor({
frequency: 60,
referenceFrame: "device",
});
absoluteOrientation.timestamp;
absoluteOrientation.quaternion;

const relativeOrientation = new RelativeOrientationSensor();
const relativeOrientation = new RelativeOrientationSensor({
frequency: 60,
referenceFrame: "screen",
});
relativeOrientation.timestamp;
relativeOrientation.quaternion;

Expand Down
2 changes: 1 addition & 1 deletion types/motion-sensors-polyfill/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "@types/motion-sensors-polyfill",
"version": "0.3.9999",
"projects": [
"https://github.com/kenchris/lit-element"
"https://github.com/kenchris/sensor-polyfills"
],
"devDependencies": {
"@types/motion-sensors-polyfill": "workspace:."
Expand Down