import { LocaleTag } from './Locale.js'; /** The status tone a section color maps to — colors come from the theme, not from the format. */ export type FormatTone = 'danger' | 'success' | 'info' | 'warning'; export interface FormattedNumber { text: string; tone?: FormatTone; } /** A number format: a spreadsheet format code (`#,##0.00`, `0.0%`, `[Red]-#,##0`) or `Intl.NumberFormat` options. */ export type NumberFormat = string | Intl.NumberFormatOptions; /** * Formats `value` with a {@link NumberFormat} — the one number-format vocabulary the table, sheet and * widget packages share. A format code keeps its section color as a theme {@link FormatTone}. * * - `null` / `undefined` → empty text. * - A number or numeric text is formatted; other text goes through a code's text section, or is shown as is. * - Neither path writes a signed zero: a negative that rounds to zero reads `0`, as in Excel. For options, * that is `signDisplay: 'negative'` unless the options set `signDisplay` themselves. * - Returns `null` when a format code uses syntax this engine does not support (conditions `[>100]`, * `[Color N]`, scientific `E+`, fractions) or more digit placeholders than `Intl.NumberFormat` takes (21 integer, * 100 fraction) — the caller decides how to show the value then. * * Separators follow `locale`, or the app locale (`Locale.get()`) when omitted. */ export declare function applyNumberFormat(value: unknown, format: NumberFormat, locale?: LocaleTag): FormattedNumber | null;