Money Modeling
@teakit/money is being prepared to model monetary values with amount, currency, scale, and explicit policy.
Current State
The implementation currently seeds the package with a Money-named API surface aligned with Dinero.js v2 capabilities, including number and bigint entry points, ISO currency exports, arithmetic, comparison, conversion, formatting, and rounding helpers.
Read docs/proposals/v00-money.md before proposing money behavior or public API names.
v1 Direction
- Represent money as amount, currency, and scale, not as display text.
- Prefer scaled integer representation and strict decimal-string parsing.
- Make rounding, allocation, formatting, and serialization policies explicit.
- Keep JSON-safe snapshots and agent-readable usage rules as first-class concerns.
API Reference
Implemented entry points:
@teakit/money@teakit/money/currencies@teakit/money/bigint@teakit/money/bigint/currencies
Do not document or generate usage examples for proposed constructors, operations, aliases, or exports until they exist in src and have tests.
Agent Contract
- Use only real exported APIs from
src. - Keep proposal-only APIs in
docs/proposals/ordocs/specs/. - Update README, tests,
skills/llms.md, and this reference when public money behavior is implemented.
Agent Notes
The target category is safe monetary modeling for TypeScript applications. Keep future examples precise, currency-aware, and explicit about lossy boundaries such as rounding and allocation.