import { OverflowDirection } from './OverflowWatcher/types/overflow-direction.js'; export function calcMarginSize(el:Element, scrollDirection: OverflowDirection){ const computedStyle = getComputedStyle(el); if(OverflowDirection.HORIZONTAL === scrollDirection){ return (parseInt(computedStyle.marginLeft || '0') + parseInt(computedStyle.marginRight || '0')); } return (parseInt(computedStyle.marginTop || '0') + parseInt(computedStyle.marginBottom || '0')); }