@resval/react-responsive-values
Version:
Resval stands for Responsive Values, which is a hook that can return a value based on the current breakpoint. This hook can also respond to the size of the window.
8 lines (7 loc) • 871 B
TypeScript
import type { TOptions, TRecordKeys, TNarrowable } from './types';
export declare function createResponsiveValues<TTypeBreakpointsOption extends Record<string, string>>(options: TOptions<TTypeBreakpointsOption>): <TTypePrimitives extends TNarrowable, TTypeObject extends {
[K: string]: {} | TTypePrimitives | TTypeObject | [];
[K: number]: {} | TTypePrimitives | TTypeObject | [];
[K: symbol]: {} | TTypePrimitives | TTypeObject | [];
}, TTypeBreakpointsQueries extends Record<TRecordKeys, Partial<Record<(string & {}) | keyof TTypeBreakpointsOption, TTypePrimitives | TTypeObject>>>, TTypeReturnBreakpointsQueries = { [Param in keyof TTypeBreakpointsQueries]: TTypeBreakpointsQueries[Param][keyof TTypeBreakpointsQueries[Param]]; }>(breakpointsQueries: TTypeBreakpointsQueries) => TTypeReturnBreakpointsQueries;
export default createResponsiveValues;