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