/**
 * @since Last modified: 2024-09-13 15:18:01
 * @function getWidths
 * @description Get the values of the horizonal direction of the element.
 * @param {getEl} elem - Node or node selector.
 * @returns  {object} - Return values object,include properties:width,paddingLeft,paddingRight,marginLeft,marginRight,borderLeftWidth and borderRightWidth.
 * @see {@link https://codepen.io/axui/pen/JjQVpaQ|demo @ codepen}
 * @example
 * ax.getWidths('#demo');
 * <!--return {width,paddingLeft,paddingRight,marginLeft,marginRight,borderLeftWidth,borderRightWidth}-->
 */
'use strict';
import getEl from './getEl';
import style from './style';
const getWidths = (elem: any) => {
    let target = getEl(elem);
    if (!target) {
        throw new Error('The target node does not exist!');
    }
    let styles = style(target);
    return {
        width: parseInt(styles.width),
        paddingLeft: parseInt(styles.paddingLeft),
        paddingRight: parseInt(styles.paddingRight),
        marginLeft: parseInt(styles.marginLeft),
        marginRight: parseInt(styles.marginRight),
        borderLeftWidth: parseInt(styles.borderLeftWidth),
        borderRightWidth: parseInt(styles.borderRightWidth),
    };
};
export default getWidths;
