UNPKG

@dyst/react

Version:

Dynamic Css-in-Js styles engine, based on Emotion for React

28 lines (27 loc) 943 B
import { EmotionCache } from '@emotion/cache'; import type { StyleItem } from '../StyleSheet'; export declare class CssFactory { key: string; private refPropertyName; /** * Factory for creating emotion-based `css` utilities. * * @private * @param key - Key/Name identifier of the CssFactory. */ constructor(key?: string); build(cache: EmotionCache): { css: CSSType; cx: CXType; }; private merge; /** * Tries to extract the 'ref' property from the specified argument. * * @param arg - Argument to extract the 'ref' property from. * @return {arg, ref} - Returns the extracted reference ('ref') and the specified argument 'arg' with the 'ref' property removed. */ private extractRef; } export declare type CSSType = (styles: StyleItem[] | StyleItem) => string; export declare type CXType = (...args: any) => string;