import type { ConditionalFormattingRowFields, ConditionalFormattingWithCompareTarget, ConditionalRuleLabel, ItemsMap } from '..';
import { ConditionalFormattingColorApplyTo, type ConditionalFormattingColorRange, type ConditionalFormattingConfig, type ConditionalFormattingConfigWithColorRange, type ConditionalFormattingConfigWithSingleColor, type ConditionalFormattingMinMax, type ConditionalFormattingMinMaxMap, type ConditionalFormattingWithFilterOperator } from '../types/conditionalFormatting';
import { LightdashError } from '../types/errors';
import { type FilterableItem } from '../types/field';
import { type FieldTarget } from '../types/filter';
export declare const createConditionalFormattingRuleWithValues: () => ConditionalFormattingWithFilterOperator;
export declare const createConditionalFormattingRuleWithCompareTarget: () => ConditionalFormattingWithCompareTarget;
export declare const createConditionalFormattingRuleWithCompareTargetValues: () => ConditionalFormattingWithCompareTarget;
export declare const createConditionalFormattingConfigWithSingleColor: (defaultColor: string, target?: FieldTarget | null) => ConditionalFormattingConfigWithSingleColor;
export declare const createConditionalFormattingConfigWithColorRange: (defaultColor: string, target?: FieldTarget | null) => ConditionalFormattingConfigWithColorRange;
export declare const hasPercentageFormat: (field: ItemsMap[string] | undefined) => boolean;
export declare const convertFormattedValue: <T extends unknown>(value: T, field: ItemsMap[string] | undefined) => T | number;
export declare const getMinMaxFromMinMaxMap: (minMaxMap: ConditionalFormattingMinMaxMap) => {
    min: number;
    max: number;
};
export declare class ConditionalFormattingError extends LightdashError {
    constructor(message: string);
}
export declare const hasMatchingConditionalRules: (field: ItemsMap[string], value: unknown, minMaxMap: ConditionalFormattingMinMaxMap, config: ConditionalFormattingConfig | undefined, rowFields?: ConditionalFormattingRowFields) => boolean;
export declare const getConditionalFormattingConfig: ({ field, value, minMaxMap, conditionalFormattings, rowFields, applyTo, }: {
    field: ItemsMap[string] | undefined;
    value: unknown | undefined;
    minMaxMap: ConditionalFormattingMinMaxMap | undefined;
    conditionalFormattings: ConditionalFormattingConfig[] | undefined;
    rowFields?: ConditionalFormattingRowFields;
    applyTo?: ConditionalFormattingColorApplyTo;
}) => ConditionalFormattingConfig | undefined;
export declare const getConditionalFormattingDescription: (field: ItemsMap[string] | undefined, conditionalFormattingConfig: ConditionalFormattingConfig | undefined, rowFields: ConditionalFormattingRowFields, getConditionalRuleLabel: (rule: ConditionalFormattingWithFilterOperator, item: FilterableItem) => ConditionalRuleLabel) => string | undefined;
type GetColorFromRangeFunction = (value: number, colorRange: ConditionalFormattingColorRange, minMaxRange: ConditionalFormattingMinMax) => string | undefined;
export type ConditionalFormattingColorResult = {
    color: string;
    applyTo: ConditionalFormattingColorApplyTo;
};
export declare const getConditionalFormattingColorWithColorRange: ({ field, value, config, minMaxMap, getColorFromRange, }: {
    field: ItemsMap[string] | undefined;
    value: unknown;
    config: ConditionalFormattingConfigWithColorRange;
    minMaxMap: ConditionalFormattingMinMaxMap | undefined;
    getColorFromRange: GetColorFromRangeFunction;
}) => ConditionalFormattingColorResult | undefined;
export declare const getConditionalFormattingColorWithSingleColor: ({ config, }: {
    config: ConditionalFormattingConfigWithSingleColor;
}) => ConditionalFormattingColorResult;
export declare const getConditionalFormattingColor: ({ field, value, config, minMaxMap, getColorFromRange, }: {
    field: ItemsMap[string] | undefined;
    value: unknown;
    config: ConditionalFormattingConfig | undefined;
    minMaxMap: ConditionalFormattingMinMaxMap | undefined;
    getColorFromRange: GetColorFromRangeFunction;
}) => ConditionalFormattingColorResult | undefined;
/**
 * Row-level conditional formatting (PROD-8058): returns the background color to
 * paint across an entire row when a single `applyTo: ROW` rule's trigger field
 * matches. Evaluated once per row, independent of the cell being drawn.
 * Returns null when no ROW rule matches.
 */
export declare const getRowConditionalFormattingColor: ({ conditionalFormattings, rowFields, minMaxMap, }: {
    conditionalFormattings: ConditionalFormattingConfig[] | undefined;
    rowFields: ConditionalFormattingRowFields;
    minMaxMap: ConditionalFormattingMinMaxMap | undefined;
}) => string | null;
/**
 * Canonical key for a pivot cell's dimension context (index + header dims).
 * Used by both pivotQueryResults (to store hidden values) and the pivot
 * renderer (to look them up), so the keys cannot drift. Entries are sorted by
 * fieldId; null and undefined raw values are normalised to the same token.
 */
export declare const getPivotRowContextKey: (dimValues: Record<string, unknown>) => string;
export {};
//# sourceMappingURL=conditionalFormatting.d.ts.map