UNPKG

tonami

Version:

Minimal CSS-in-JS library that promotes CSS best-practices and strongly-typed design systems.

24 lines (23 loc) 903 B
import { Properties } from "csstype"; declare type PropertiesWithFunction<T> = { [K in keyof Properties]: Properties[K] | ((args: T) => void); }; declare type Vars = Record<string, any>; export declare type Selectors<T> = { [selector: string]: PropertiesWithFunction<T> & Vars; }; export declare type StaticSelectors = Record<string, Properties & Vars>; /** * The apply type represents what attributes should be applied to a component */ export declare type Apply = Record<string, any>; export declare type Ruleset<T> = PropertiesWithFunction<T> & Vars & { apply?: Apply; condition?: Condition<T>; selectors?: { [k: string]: PropertiesWithFunction<T>; }; }; declare type Condition<Interface> = boolean | ((props: Interface) => boolean); export declare type ConditionsMap<Interface> = Map<Record<string, string>, Condition<Interface>>; export {};