export function parseCSS ( css ) { let rules = ( css || "" ) . split ( ";" ) ; let styles = { } ; for ( let rule of rules ) { let [ name , ... value ] = rule . split ( ":" ) ; if ( value . length > 0 ) { styles [ name ] = value . join ( ":" ) . trim ( ) ; } } return styles ; } const RightToLeftAlignment = { left : "end" , right : "start" , center : "center" , justify : "justify" , } as { [ key ] : "start" | "end" | "center" | "justify" | undefined ; } ; const LeftToRightAlignment = { left : "start" , right : "end" , center : "center" , justify : "justify" , } as { [ key ] : "start" | "end" | "center" | "justify" | undefined ; } ; param alignment param language export function toAlignment ( alignment , direction ) { if ( alignment == null ) { return alignment ; } if ( direction === "rtl" ) { return RightToLeftAlignment [ alignment ] ; } return LeftToRightAlignment [ alignment ] ; }