export var pick = function (props, obj) {
    return props.reduce(function (acc, prop) {
        acc[prop] = obj[prop];
        return acc;
    }, {});
};
var SIZING_STYLE = [
    "borderBottomWidth",
    "borderLeftWidth",
    "borderRightWidth",
    "borderTopWidth",
    "boxSizing",
    "fontFamily",
    "fontSize",
    "fontStyle",
    "fontWeight",
    "letterSpacing",
    "lineHeight",
    "paddingBottom",
    "paddingLeft",
    "paddingRight",
    "paddingTop",
    "tabSize",
    "textIndent",
    "textRendering",
    "textTransform",
    "width",
    "wordBreak"
];
var getSizingData = function (node) {
    var style = window.getComputedStyle(node);
    if (style === null) {
        return null;
    }
    var sizingStyle = pick(SIZING_STYLE, style);
    var boxSizing = sizingStyle.boxSizing;
    if (boxSizing === "") {
        return null;
    }
    if (boxSizing === "border-box") {
        sizingStyle.width = "\n      " + (parseFloat(sizingStyle.width) +
            parseFloat(sizingStyle.borderRightWidth) +
            parseFloat(sizingStyle.borderLeftWidth) +
            parseFloat(sizingStyle.paddingRight) +
            parseFloat(sizingStyle.paddingLeft)) + "\n      px";
    }
    var paddingSize = parseFloat(sizingStyle.paddingBottom) + parseFloat(sizingStyle.paddingTop);
    var borderSize = parseFloat(sizingStyle.borderBottomWidth) +
        parseFloat(sizingStyle.borderTopWidth);
    return {
        sizingStyle: sizingStyle,
        paddingSize: paddingSize,
        borderSize: borderSize
    };
};
export default getSizingData;
