function mapDimMethodToMode(method) {
    switch (method) {
        case "fit":
            return "fit";
        case "fill":
            return "fill";
        case "px":
            return "px";
        case "percent":
            return "%";
        case "columns":
        case "col":
            return "columns";
        case "rows":
        case "row":
            return "rows";
        default:
            return undefined;
    }
}
export function toValueDimension(expression) {
    const expressionNode = "get" in expression ? expression.node : expression;
    if (expressionNode.callee.type !== "MemberExpression") {
        return undefined;
    }
    const property = expressionNode.callee.property;
    if (property.type !== "Identifier") {
        return undefined;
    }
    const mode = mapDimMethodToMode(property.name);
    if (!mode) {
        return undefined;
    }
    const value = expressionNode.arguments[0];
    return {
        mode,
        value: value?.type === "NumericLiteral" ? value.value : 1,
    };
}
//# sourceMappingURL=to-value-dimensions.js.map