import { default as React } from 'react'; import { default as ConditionalFormattingRule } from '../../conditional-formatting-sheet/types/ConditionalFormattingRule'; import { ITableColumnProps } from '../../table'; import { default as ConditionalFormattingColumnDomain } from '../types/ConditionalFormattingColumnDomain'; /** * Resolves the conditional formatting CSS for one cell, or `undefined` when no * rule applies to it. */ type ConditionalFormattingCellStyleResolver = (record: T, columnId: string) => React.CSSProperties | undefined; /** * Compiles the enabled rules into a resolver the cell render path can call cheaply. * * Everything that depends only on the rules, columns and domains — the column * lookup, each rule's CSS, and which rules can touch a given column — is derived * once here. Without that, every visible cell re-walked every rule and scanned the * column array per condition, so a keystroke in the rule editor (which hands down a * new rules array) cost O(cells × rules × conditions × columns). * * Returns `null` when nothing is enabled, so callers can skip the work entirely. * * Rules are checked in array order — the first matching rule wins for a given cell, * per the rule list's own "higher rule is applied" priority. A column rule only ever * matches its own column; a row rule matches every column once all its conditions * hold, so an earlier column rule can still win for its one cell even when a later * row rule also matches. */ export default function createConditionalFormattingResolver(rules: ConditionalFormattingRule[], columns: ITableColumnProps[], columnDomains: Record): ConditionalFormattingCellStyleResolver | null; export type { ConditionalFormattingCellStyleResolver };