@supunlakmal/hooks
Version:
A collection of reusable React hooks
15 lines (14 loc) • 475 B
TypeScript
export interface DeviceOrientationState {
alpha: number | null;
beta: number | null;
gamma: number | null;
absolute: boolean;
isSupported: boolean;
}
/**
* Custom hook to track the physical orientation of the device.
* Uses the 'deviceorientation' event.
*
* @returns {DeviceOrientationState} An object containing orientation angles (alpha, beta, gamma) and support status.
*/
export declare const useDeviceOrientation: () => DeviceOrientationState;