modifier.d.ts 944 B

12345678910111213141516171819202122
  1. import { Skeleton } from '../types/skeleton.js';
  2. /**
  3. * Determine a modifier for the input value to account for any `scale`,
  4. * `percent`, and `precision-increment` tokens in the skeleton.
  5. *
  6. * @internal
  7. * @remarks
  8. * With ICU NumberFormatter, the `percent` skeleton would style `25` as "25%".
  9. * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`.
  10. */
  11. export declare function getNumberFormatModifier(skeleton: Skeleton): (n: number) => number;
  12. /**
  13. * Returns a string of JavaScript source that evaluates to a modifier for the
  14. * input value to account for any `scale`, `percent`, and `precision-increment`
  15. * tokens in the skeleton.
  16. *
  17. * @internal
  18. * @remarks
  19. * With ICU NumberFormatter, the `percent` skeleton would style `25` as "25%".
  20. * To achieve the same with `Intl.NumberFormat`, the input value must be `0.25`.
  21. */
  22. export declare function getNumberFormatModifierSource(skeleton: Skeleton): string | null;