"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConditionalFormattingColorApplyTo = exports.ConditionalFormattingComparisonType = exports.getConditionalFormattingConfigType = exports.ConditionalFormattingConfigType = exports.isConditionalFormattingConfigWithColorRange = exports.isConditionalFormattingConfigWithSingleColor = exports.isConditionalFormattingWithCompareTarget = exports.isConditionalFormattingWithValues = void 0;
const isConditionalFormattingWithValues = (rule) => 'values' in rule;
exports.isConditionalFormattingWithValues = isConditionalFormattingWithValues;
const isConditionalFormattingWithCompareTarget = (rule) => 'compareTarget' in rule;
exports.isConditionalFormattingWithCompareTarget = isConditionalFormattingWithCompareTarget;
const isConditionalFormattingConfigWithSingleColor = (rule) => 'color' in rule && typeof rule.color === 'string' && 'rules' in rule;
exports.isConditionalFormattingConfigWithSingleColor = isConditionalFormattingConfigWithSingleColor;
const isConditionalFormattingConfigWithColorRange = (config) => 'color' in config && typeof config.color === 'object';
exports.isConditionalFormattingConfigWithColorRange = isConditionalFormattingConfigWithColorRange;
var ConditionalFormattingConfigType;
(function (ConditionalFormattingConfigType) {
    ConditionalFormattingConfigType["Single"] = "single";
    ConditionalFormattingConfigType["Range"] = "range";
})(ConditionalFormattingConfigType || (exports.ConditionalFormattingConfigType = ConditionalFormattingConfigType = {}));
const getConditionalFormattingConfigType = (rule) => {
    if ((0, exports.isConditionalFormattingConfigWithSingleColor)(rule)) {
        return ConditionalFormattingConfigType.Single;
    }
    if ((0, exports.isConditionalFormattingConfigWithColorRange)(rule)) {
        return ConditionalFormattingConfigType.Range;
    }
    throw new Error('Invalid conditional formatting rule');
};
exports.getConditionalFormattingConfigType = getConditionalFormattingConfigType;
var ConditionalFormattingComparisonType;
(function (ConditionalFormattingComparisonType) {
    ConditionalFormattingComparisonType["VALUES"] = "values";
    ConditionalFormattingComparisonType["TARGET_FIELD"] = "target_field";
    ConditionalFormattingComparisonType["TARGET_TO_VALUES"] = "target_to_values";
})(ConditionalFormattingComparisonType || (exports.ConditionalFormattingComparisonType = ConditionalFormattingComparisonType = {}));
var ConditionalFormattingColorApplyTo;
(function (ConditionalFormattingColorApplyTo) {
    ConditionalFormattingColorApplyTo["CELL"] = "cell";
    ConditionalFormattingColorApplyTo["TEXT"] = "text";
    ConditionalFormattingColorApplyTo["ROW"] = "row";
})(ConditionalFormattingColorApplyTo || (exports.ConditionalFormattingColorApplyTo = ConditionalFormattingColorApplyTo = {}));
//# sourceMappingURL=conditionalFormatting.js.map