import CSS from 'csstype' ; type CSSProperties = CSS . StandardLonghandPropertiesHyphen ; type CSSProp = keyof CSSProperties ; export function getComputedStyles ( element , CSSProps ) { const computed = getComputedStyle ( element ) ; const CSSProp = ( p ) => ( { [ p ] : computed . getPropertyValue ( p ) } ) ; const styles = Object . assign ( { } , ... CSSProps . map ( CSSProp ) ) ; return styles ; }