/** * Reactive media query matching. * * Returns a reactive boolean signal that tracks whether a CSS media query matches. * * @module bquery/media */ import type { MediaSignalHandle } from './types'; /** * Creates a reactive signal that tracks whether a CSS media query matches. * * Uses `window.matchMedia()` under the hood and automatically updates * when the match state changes (e.g., on window resize, device orientation change). * * @param query - A valid CSS media query string (e.g., `'(min-width: 768px)'`) * @returns A readonly reactive signal that is `true` when the query matches, * plus a `destroy()` method to remove the media query listener * * @example * ```ts * import { mediaQuery } from '@bquery/bquery/media'; * import { effect } from '@bquery/bquery/reactive'; * * const isDark = mediaQuery('(prefers-color-scheme: dark)'); * effect(() => { * document.body.classList.toggle('dark', isDark.value); * }); * * const isWide = mediaQuery('(min-width: 1024px)'); * effect(() => { * console.log('Wide screen:', isWide.value); * }); * ``` */ export declare const mediaQuery: (query: string) => MediaSignalHandle; //# sourceMappingURL=media-query.d.ts.map