UNPKG

@mujo/box

Version:

A React utility to add a style guide to primative components

28 lines (27 loc) 1.14 kB
/// <reference types="react" /> import { SerializedStyles } from '@emotion/react'; import { StyleGuideHash, BoxProps } from '../types'; declare type CSSToStyle = (cssProp: any) => SerializedStyles; export declare const cssToStyle: CSSToStyle; export declare function mapToPair<T>(props: Partial<BoxProps<T>>): (key: string) => [string, unknown]; interface MappingAccum { used: string[]; key: string; value: string | number | unknown; } declare type MapToStyleGuideValue = (accum: MappingAccum) => (val: SerializedStyles | null, curr: StyleGuideHash) => SerializedStyles | null; export declare const mapToStyleGuideValue: MapToStyleGuideValue; interface PropsToStylesRet { used: string[]; styles: SerializedStyles[]; } export declare function propsToStyles<T>(stylesObjs: StyleGuideHash): (props: Partial<BoxProps<T, import("react").BaseHTMLAttributes<HTMLDivElement>>>) => PropsToStylesRet; interface MakeStyles { <K extends string, T extends {}>(property: K, obj: T): { [K2 in keyof typeof obj]: { [key: string]: T[K2]; }; }; } export declare const makeStyles: MakeStyles; export {};