import type { TFunction } from 'i18next'; import type { HeatmapColumn, HeatmapGroup, HeatmapRow, ModelCell } from './heatmap-model'; import type { HeatmapAggregate } from './heatmap-scale'; /** What the values are: plain numbers, or rates between 0 and 1. */ export type HeatmapValueType = 'number' | 'rate'; /** * What privacy mode masks. `rows`: the row labels, which name people, * chairs or patients. `all`: the column and group labels too. The kit rule * (src/components/_shared/privacy-mask.tsx) is to mask the identity and keep * time, place and status, so columns (hours, days) and groups (practices) * stay readable unless the host asks for more. */ export type HeatmapPrivacyScope = 'rows' | 'all'; /** The default value format: a percentage for rates, a decimal otherwise. */ export declare function defaultValueFormatter(locale: string, valueType: HeatmapValueType): (value: number) => string; /** Whole-number format for counts. */ export declare function countFormatter(locale: string): (count: number) => string; /** Builds every sentence the heatmap speaks or shows. */ export interface HeatmapDescriber { /** True when privacy mode hides the row labels. */ masksRows: boolean; /** True when privacy mode hides the column labels. */ masksColumns: boolean; /** True when privacy mode hides the group labels. */ masksGroups: boolean; rowLabel: (row: HeatmapRow) => string; columnLabel: (column: HeatmapColumn) => string; groupLabel: (groupId: string) => string; /** A cell by its headers: "Tuesday, 10:00". */ cellName: (rowText: string, columnText: string) => string; /** A group header row: "Mos Eisley (Average)". */ groupRowText: (groupText: string, method: HeatmapAggregate) => string; /** A cell as the table view shows it: "26%, 10 of 39". */ tableText: (cell: ModelCell) => string; /** Label for a margin: "Total" for a sum, "Average" for a mean. */ methodLabel: (method: HeatmapAggregate) => string; /** The value as text: formatted, a cell label, "no data" or "too few". */ valueText: (cell: ModelCell) => string; /** The value as shown inside a cell, or '' when the cell shows none. */ visibleText: (cell: ModelCell) => string; /** "10 of 39" for a rate, "39 records" otherwise; null without a count. */ countText: (cell: ModelCell) => string | null; /** "Tuesday, 10:00: 26%, 10 of 39". */ sentence: (rowText: string, columnText: string, cell: ModelCell) => string; /** Format for a raw value, used by the legend. */ formatValue: (value: number) => string; } export interface DescriberOptions { t: TFunction<'ui'>; privacyMode: boolean; /** What privacy mode masks. Default `rows`. */ privacyScope?: HeatmapPrivacyScope; valueType: HeatmapValueType; formatValue: (value: number) => string; formatCount: (count: number) => string; groups?: readonly HeatmapGroup[]; } export declare function createDescriber({ t, privacyMode, privacyScope, valueType, formatValue, formatCount, groups, }: DescriberOptions): HeatmapDescriber; //# sourceMappingURL=heatmap-format.d.ts.map