/** * Cross-package helpers for per-column value formatting. Used by both * `viewer-datagrid` (cell formatting) and `viewer-charts` (axis ticks, * tooltips, legends) so a column's `number_format` / `date_format` * configuration produces identical output across plugins. * * The format configs mirror the `Intl.NumberFormatOptions` / * `Intl.DateTimeFormatOptions` shapes one-for-one — they're written * straight into the respective constructors. The `date_format.format` * discriminator ("simple" | "custom") selects between two derivation * paths: simple uses `dateStyle` / `timeStyle`, custom uses the * per-field overrides (year / month / day / ...). */ export interface NumberFormatConfig { style?: "decimal" | "currency" | "percent" | "unit"; minimumFractionDigits?: number; maximumFractionDigits?: number; minimumIntegerDigits?: number; minimumSignificantDigits?: number; maximumSignificantDigits?: number; currency?: string; currencyDisplay?: "code" | "symbol" | "narrowSymbol" | "name"; notation?: "standard" | "scientific" | "engineering" | "compact"; compactDisplay?: "short" | "long"; useGrouping?: boolean; } export interface DateFormatConfig { format?: "custom" | string; timeZone?: string; dateStyle?: "short" | "medium" | "long" | "full" | "disabled"; timeStyle?: "short" | "medium" | "long" | "full" | "disabled"; second?: "numeric" | "2-digit" | "disabled"; minute?: "numeric" | "2-digit" | "disabled"; hour?: "numeric" | "2-digit" | "disabled"; day?: "numeric" | "2-digit" | "disabled"; weekday?: "narrow" | "short" | "long" | "disabled"; month?: "numeric" | "2-digit" | "narrow" | "short" | "long" | "disabled"; year?: "numeric" | "2-digit" | "disabled"; hour12?: boolean; fractionalSecondDigits?: 1 | 2 | 3; } export declare function createNumberFormatter(type: string, cfg?: NumberFormatConfig): Intl.NumberFormat; export declare function createDatetimeFormatter(cfg?: DateFormatConfig): Intl.DateTimeFormat; export declare function createDateFormatter(cfg?: DateFormatConfig): Intl.DateTimeFormat; /** * Recover the source column name from a synthetic split-by path. Split * pivoting produces paths of the form `|...|`; * per-column config (formatters, aggregate styling, …) is always keyed * on the trailing source column. */ export declare function sourceColumn(path: string): string;