import type { CSSInterpolation } from '@emotion/serialize' export type TemplateFn = ( strings: Readonly, ...values: readonly string[] ) => R export type TwFn = TemplateFn export type TwComponentMap = { [K in keyof JSX.IntrinsicElements]: TemplateFn> } export type TwComponent = ( props: JSX.IntrinsicElements[K] ) => JSX.Element type TwComponentWrapper = >( component: T ) => TemplateFn declare module 'react' { interface DOMAttributes { tw?: string css?: CSSInterpolation } } declare global { const tw: TwFn & TwComponentMap & TwComponentWrapper namespace JSX { interface IntrinsicAttributes extends React.Attributes { tw?: string } } }