import { DeepMaybeObservable, Supportable, PermissionAware, ReadonlyObservable } from '@usels/core'; import { ConfigurableWindow } from '../../shared/configurable.mjs'; import '@legendapp/state'; type UseDeviceMotionOptions = ConfigurableWindow; interface UseDeviceMotionReturn extends Supportable, PermissionAware { /** * Whether the device has real motion sensor hardware. * `isSupported` only checks API availability — desktop browsers expose the API * but may fire events with non-zero interval yet all-null values when no hardware exists. * `hasRealData$` becomes `true` on the first event where `interval > 0` AND at least * one of acceleration or rotationRate has a non-null value. */ hasRealData$: ReadonlyObservable; /** Linear acceleration of the device (without gravity), in m/s² */ acceleration$: ReadonlyObservable<{ x: number | null; y: number | null; z: number | null; }>; /** Linear acceleration of the device (including gravity), in m/s² */ accelerationIncludingGravity$: ReadonlyObservable<{ x: number | null; y: number | null; z: number | null; }>; /** Rate of rotation of the device around each axis, in deg/s */ rotationRate$: ReadonlyObservable<{ alpha: number | null; beta: number | null; gamma: number | null; }>; /** Interval (in ms) at which the device obtains motion data */ interval$: ReadonlyObservable; } /** * Framework-agnostic reactive wrapper around the * [DeviceMotionEvent](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent). * * Resolves the target window via `resolveWindowSource` (honoring * `options.window` for iframe / custom root scenarios), exposes acceleration, * rotation rate, and interval as observables, and integrates with the * iOS permission flow via `createPermissionAware`. */ declare function createDeviceMotion(options?: DeepMaybeObservable): UseDeviceMotionReturn; export { type UseDeviceMotionOptions, type UseDeviceMotionReturn, createDeviceMotion };