/**
 * Inlined replacement for the subset of `d3-format` that semiotic and
 * its consumers actually exercise.
 *
 * Why this module exists: `d3-format` ships ~42KB unpacked plus a
 * full locale-data table we don't use. Internally semiotic only emits
 * three format strings (`,.0f`, `,.${n}f`, `.${n}%`) but the public
 * `xFormat` / `yFormat` / `valueFormat` props let consumers pass any
 * d3-format spec, so the parser needs to cover the realistic chart
 * subset, not just the strings semiotic emits itself.
 *
 * What's implemented (the chart-relevant subset):
 *
 *     [,][.precision][~][type]
 *
 *   - `,` — thousands grouping using a literal comma. Matches d3's
 *     default-locale behavior (en-US); intentionally not locale-aware,
 *     because chart axis labels need stable output across CI runners
 *     and SSR snapshots — a runtime-locale separator would shift to
 *     `1.234,56` under de-DE / fr-FR and break golden-file tests.
 *   - `.N` — fractional precision (digits after the decimal for
 *     `f`/`%`, significant digits for `s`/`r`/`g`/`e`)
 *   - `~` — trim trailing zeros (matches d3's `~` modifier)
 *   - type: `f` (fixed), `%` (percent ×100), `e` (exponential),
 *     `d` (integer; precision ignored), `s` (SI prefix), `r` (rounded
 *     to N significant digits), `g` (general — switches between fixed
 *     and exponential), or omitted (treated as `g` with default
 *     precision, matching d3).
 *
 * What's NOT implemented (rare in chart axis labels):
 *
 *   - `[fill][align]` (`0`, `<`, `>`, `^`, `=`) — padding/alignment
 *   - `[sign]` (`+`, `-`, `(`, ` `) — sign behaviors
 *   - `[symbol]` (`$`, `#`) — currency / radix prefix
 *   - `[width]` — minimum field width
 *   - `b`/`o`/`x`/`X`/`c`/`n`/`p` types — binary/octal/hex/code-point/
 *     comma/percent-rounded
 *
 * If a consumer passes a spec with one of the un-implemented features
 * the parser falls through to a best-effort `Intl.NumberFormat` call
 * so we don't crash; if the input isn't even a recognized spec, the
 * caller's existing `try/catch` falls back to `String(value)`.
 */
/**
 * Build a number formatter from a d3-format-style spec string.
 * Mirrors `d3.format(spec)`: returns `(value: number) => string`.
 *
 * **Throws on unparseable specs and unimplemented types.** This
 * matches d3's contract — the existing `try/catch` in
 * `formatUtils.formatNumber` (and any consumer code that wraps a
 * `format(spec)` call) catches the throw and falls back to
 * `String(value)`. Earlier shim revisions silently fell back to
 * `Intl.NumberFormat`, which (a) suppressed bad-input errors that
 * the outer fallback was designed to handle, and (b) reintroduced a
 * runtime-locale dependency that would shift output across CI runners
 * and SSR snapshot baselines.
 */
export declare function format(spec: string): (value: number) => string;
