/* eslint-disable */ import CSS from 'csstype'; type Style = CSS.StandardProperties; type StyleSheet = { [key: string]: Style }; export type StyleNeverize = { [K in keyof T]: K extends keyof Style ? Style[K] : never; }; export type StyleSheetNeverize = { [K in keyof T]: StyleNeverize; }; type StyleSheetFactory = () => T extends unknown ? StyleSheet : StyleSheet & StyleSheetNeverize; type CompiledStyleSheet = { [key: string]: object }; type Transformer = (...styles: (undefined | false | string | object)[]) => string; function createStyleSheet(styleSheet: StyleSheetFactory): StyleSheetFactory { return styleSheet; } const styleSheet = createStyleSheet(() => ({ button: { fontVariantCaps: 'normal', display: 'block', }, button__active: {}, })); function useStyles(styleSheet: StyleSheetFactory): [CompiledStyleSheet, Transformer] { return [(styleSheet as unknown) as CompiledStyleSheet, () => '']; } const [styles, cx] = useStyles(styleSheet); styles.button; styles.button__active;