import { ContextManager, Context } from '../context'; import { Event } from '../event'; import { Observable } from '../observable'; export declare enum Orientation { Portrait = "portrait", Landscape = "landscape", PortraitSecondary = "portrait-secondary", LandscapeSecondary = "landscape-secondary" } /** * Manages and tracks orientation changes in the application context. * @zcontext */ export declare class OrientationContext extends Context { /** * Observable indicating whether the current orientation is portrait. * @zui */ readonly isPortrait: Observable; /** * Observable indicating whether the current orientation is landscape. * @zui */ readonly isLandscape: Observable; /** * Observable indicating whether the current orientation is secondary portrait. * @zui */ readonly isPortraitSecondary: Observable; /** * Observable indicating whether the current orientation is secondary landscape. * @zui */ readonly isLandscapeSecondary: Observable; /** * Observable representing the current orientation. */ readonly orientation: Observable; /** * Event triggered when the orientation changes to portrait. */ readonly onPortrait: Event<[void]>; /** * Event triggered when the orientation changes to landscape. */ readonly onLandscape: Event<[void]>; /** * Event triggered when the orientation changes to secondary portrait. */ readonly onPortraitSecondary: Event<[void]>; /** * Event triggered when the orientation changes to secondary landscape. */ readonly onLandscapeSecondary: Event<[void]>; /** * Event triggered when there is any orientation change. */ readonly onOrientationChange: Event<[Orientation]>; /** * Creates an instance of OrientationContext. * @param contextManager - The current ContextManager */ constructor(contextManager: ContextManager); private attachListeners; private _onOrientationChange; private orientationChangeHandler; private getOrientation; private getOrientationFromScreen; private getOrientationFromWindow; private getOrientationFromDimensions; dispose: () => never; } /** * Returns an observable that notifies when the orientation changes. * @param mgr The ContextManager instance to access the OrientationContext. * @returns Observable for orientation change events. */ export declare function useOnOrientationChange(mgr: ContextManager): Event<[Orientation]>; /** * Retrieves the current orientation value. * @param mgr The ContextManager instance to access the OrientationContext. * @returns The current orientation as an Orientation enum value. */ export declare function getOrientation(mgr: ContextManager): Orientation; /** * Determines if the current orientation is portrait. * @param mgr The ContextManager instance to access the OrientationContext. * @returns True if the orientation is portrait, false otherwise. */ export declare function isPortrait(mgr: ContextManager): boolean; /** * Determines if the current orientation is landscape. * @param mgr The ContextManager instance to access the OrientationContext. * @returns True if the orientation is landscape, false otherwise. */ export declare function isLandscape(mgr: ContextManager): boolean; /** * Determines if the current orientation is secondary portrait. * @param mgr The ContextManager instance to access the OrientationContext. * @returns True if the orientation is secondary portrait, false otherwise. */ export declare function isPortraitSecondary(mgr: ContextManager): boolean; /** * Determines if the current orientation is secondary landscape. * @param mgr The ContextManager instance to access the OrientationContext. * @returns True if the orientation is secondary landscape, false otherwise. */ export declare function isLandscapeSecondary(mgr: ContextManager): boolean;