@flighthq/sensors 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/sensors.d.ts +34 -0
- package/dist/sensors.d.ts.map +1 -0
- package/dist/sensors.js +681 -0
- package/dist/sensors.js.map +1 -0
- package/package.json +38 -0
- package/src/sensors.test.ts +771 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AmbientLightReading, MotionReading, OrientationReading, PressureReading, ProximityReading, QuaternionReading, RotationRateReading, Sensors, SensorsBackend, SensorsPermissionState } from '@flighthq/types';
|
|
2
|
+
export declare function attachSensors(sensors: Sensors): void;
|
|
3
|
+
export declare function computeEulerFromQuaternion(out: OrientationReading, quaternion: Readonly<QuaternionReading>): void;
|
|
4
|
+
export declare function computeGravityFromOrientation(out: MotionReading, orientation: Readonly<OrientationReading>): void;
|
|
5
|
+
export declare function computeQuaternionFromOrientationReading(out: QuaternionReading, orientation: Readonly<OrientationReading>): void;
|
|
6
|
+
export declare function computeRotationMatrixFromQuaternion(out: number[], quaternion: Readonly<QuaternionReading>): void;
|
|
7
|
+
export declare function computeScreenRelativeOrientation(out: OrientationReading, orientation: Readonly<OrientationReading>, screenAngle: number): void;
|
|
8
|
+
export declare function computeWorldAccelerationFromDeviceAcceleration(out: MotionReading, acceleration: Readonly<MotionReading>, quaternion: Readonly<QuaternionReading>): void;
|
|
9
|
+
export declare function createAmbientLightReading(): AmbientLightReading;
|
|
10
|
+
export declare function createMotionReading(): MotionReading;
|
|
11
|
+
export declare function createOrientationReading(): OrientationReading;
|
|
12
|
+
export declare function createPressureReading(): PressureReading;
|
|
13
|
+
export declare function createProximityReading(): ProximityReading;
|
|
14
|
+
export declare function createQuaternionReading(): QuaternionReading;
|
|
15
|
+
export declare function createRotationRateReading(): RotationRateReading;
|
|
16
|
+
export declare function createSensors(): Sensors;
|
|
17
|
+
export declare function createWebSensorsBackend(): SensorsBackend;
|
|
18
|
+
export declare function detachSensors(sensors: Sensors): void;
|
|
19
|
+
export declare function disposeSensors(sensors: Sensors): void;
|
|
20
|
+
export declare function getSensorsBackend(): SensorsBackend;
|
|
21
|
+
export declare function getSensorsPermissionState(sensor?: 'motion' | 'orientation' | 'magnetometer'): Promise<SensorsPermissionState>;
|
|
22
|
+
export declare function hasAccelerometer(): boolean;
|
|
23
|
+
export declare function hasAmbientLightSensor(): boolean;
|
|
24
|
+
export declare function hasBarometer(): boolean;
|
|
25
|
+
export declare function hasGravitySensor(): boolean;
|
|
26
|
+
export declare function hasGyroscope(): boolean;
|
|
27
|
+
export declare function hasLinearAccelerationSensor(): boolean;
|
|
28
|
+
export declare function hasMagnetometer(): boolean;
|
|
29
|
+
export declare function hasOrientationSensor(): boolean;
|
|
30
|
+
export declare function hasProximitySensor(): boolean;
|
|
31
|
+
export declare function isSensorsSupported(): boolean;
|
|
32
|
+
export declare function requestSensorsPermission(): Promise<boolean>;
|
|
33
|
+
export declare function setSensorsBackend(backend: SensorsBackend | null): void;
|
|
34
|
+
//# sourceMappingURL=sensors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sensors.d.ts","sourceRoot":"","sources":["../src/sensors.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,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