@supunlakmal/hooks
Version:
A collection of reusable React hooks
15 lines (14 loc) • 458 B
TypeScript
interface OrientationState {
angle: number;
type: OrientationType;
/** True if the API is supported, false otherwise */
isSupported: boolean;
}
/**
* Tracks the device's screen orientation using the Screen Orientation API.
* Provides the current angle and type (e.g., 'portrait-primary').
*
* @returns An object containing the current orientation angle and type.
*/
export declare function useOrientation(): OrientationState;
export {};