import { DECLARATION , Element , node , RULESET } from 'stylis' ; export type RuleSet = Element & { type : typeof RULESET ; children : Element [ ] ; props : string [ ] ; } ; export type Declaration = Element & { type : typeof DECLARATION ; props : string ; children : string ; } ; export const isRuleSet = ( element ) : element is RuleSet => element . type === RULESET ; export const isDeclaration = ( element ) : element is Declaration => element . type === DECLARATION ; export const attachDeclaration = ( property , value , ruleSet ) : void => { const declaration = node ( `${ property }:${ value };` , ruleSet , ruleSet , DECLARATION , property as unknown as string [ ] , value as unknown as Element [ ] , property . length ) ; ruleSet . children . push ( declaration ) ; } ;