/** * Media Query Service * Provides utilities for responsive design and media query management */ export interface MediaQueryListener { query: string; handler: (match: boolean) => void; matcher?: MediaQueryList; } export interface BreakpointConfig { sm?: string; md?: string; lg?: string; xl?: string; '2xl'?: string; } /** * Default breakpoints (Tailwind-inspired) */ export declare const DEFAULT_BREAKPOINTS: BreakpointConfig; /** * MediaQueryService - Centralized media query management * Provides: * - Media query listener registration * - Breakpoint detection * - Window resize handling * - Current viewport information */ export declare class MediaQueryService { private listeners; private breakpoints; private resizeObserver; private resizeListeners; constructor(breakpoints?: BreakpointConfig); /** * Register a media query listener * @param id - Unique identifier for this listener * @param query - CSS media query string * @param handler - Callback when media query matches/unmatches */ registerMediaQuery(id: string, query: string, handler: (match: boolean) => void): void; /** * Register a breakpoint listener (easier than raw media queries) * @param id - Unique identifier * @param breakpoint - Breakpoint name (sm, md, lg, xl, 2xl) * @param type - Type of match: 'min' (mobile-first) or 'max' (desktop-first) * @param handler - Callback when breakpoint matches */ registerBreakpoint(id: string, breakpoint: keyof BreakpointConfig, type: "min" | "max" | undefined, handler: (match: boolean) => void): void; /** * Unregister a media query listener */ unregisterMediaQuery(id: string): void; /** * Check if a media query currently matches */ isMatching(query: string): boolean; /** * Check if a breakpoint is currently active */ isBreakpointActive(breakpoint: keyof BreakpointConfig, type?: 'min' | 'max'): boolean; /** * Get the current viewport width */ getViewportWidth(): number; /** * Get the current viewport height */ getViewportHeight(): number; /** * Check if viewport is mobile-sized (< 768px) */ isMobile(): boolean; /** * Check if viewport is tablet-sized (768px - 1024px) */ isTablet(): boolean; /** * Check if viewport is desktop-sized (>= 1024px) */ isDesktop(): boolean; /** * Check if prefers-reduced-motion is enabled */ prefersReducedMotion(): boolean; /** * Check if dark mode is preferred */ prefersDarkMode(): boolean; /** * Get the current device orientation */ getOrientation(): 'portrait' | 'landscape'; /** * Register a window resize listener * @param id - Unique identifier * @param handler - Callback with (width, height) * @param debounceMs - Debounce delay in milliseconds */ registerResizeListener(id: string, handler: (width: number, height: number) => void, debounceMs?: number): void; /** * Unregister a resize listener */ unregisterResizeListener(id: string): void; /** * Clean up all listeners */ cleanup(): void; /** * Update breakpoint configuration */ setBreakpoints(breakpoints: BreakpointConfig): void; } /** * Get the singleton MediaQueryService instance */ export declare function getMediaQueryService(breakpoints?: BreakpointConfig): MediaQueryService; /** * Create a new isolated MediaQueryService instance */ export declare function createMediaQueryService(breakpoints?: BreakpointConfig): MediaQueryService;