formatchange
Version:
Utility that monitors named CSS media-query breakpoints and triggers event callbacks when a media-format change occurs.
15 lines (14 loc) • 1.08 kB
TypeScript
import { FormatChange, FormatMonitorGroupConfig } from "../formatchange";
/**
* @deprecated Prefer `makeFormatMonitorHook()` instead. (Will be removed in v3.0)
*
* @see https://github.com/maranomynet/formatchange/tree/v2#react-withmediaprops-hoc
*/
export declare const withMediaProps: (...args: any[]) => any;
/**
* A factory function that generates a react hook that is bound
* to a specific `FormatChange` monitor instance.
*
* @see https://github.com/maranomynet/formatchange/tree/v2#react-makeformatmonitorhook
*/
export declare const makeFormatMonitorHook: <G extends string, C extends FormatMonitorGroupConfig<G>>(formatMonitor: FormatChange<C, C extends FormatMonitorGroupConfig<infer G_1> ? G_1 : string> | (() => FormatChange<C, C extends FormatMonitorGroupConfig<infer G_1> ? G_1 : string>)) => (callback: ((media: import("../formatchange").FormatMonitorMedia<C extends FormatMonitorGroupConfig<infer G_1> ? G_1 : string>) => void) | undefined) => import("../formatchange").FormatMonitorMedia<C extends FormatMonitorGroupConfig<infer G_1> ? G_1 : string>;