Metakit / API

@doeixd/metakit/domain

Domain Schemas & symbolic ops (@doeixd/metakit/domain):

  • Money (fixed-scale integer minor units + compile-time currency safety)
  • Decimal (fixed-scale integer units + compile-time scale safety + half-even rounding)
  • CalendarDay (timezone-free epoch days)
  • OrderedEnum (totally ordered string literal enums lowered to integer ranks)
  • Text (text holding no NUL, which the checkers can prove rules over)
  • Domain annotation reader (domainOf)

Namespaces

CalendarDayTimezone-free CalendarDay Schema backed by integer epoch days (days since 1970-01-01), with symbolic arithmetic and ordering lowering directly to integer…
DecimalFixed-scale integer-backed Decimal Schema (@doeixd/metakit/domain) with compile-time scale safety, exact decimal text parsing and formatting, half-even…
DomainDomain annotations attached to Effect Schemas so non-interpreter consumers (forms, grids, JSON Schema, agents) recognize Money, CalendarDay, OrderedEnum,…
IdId: branded, non-empty, NUL-free entity identifiers (@doeixd/metakit/domain).
MoneyFixed-scale integer-backed Money and Currency Schemas + symbolic ops.
OrderedEnumOrderedEnum: an Effect Schema.Literals with a total order (e.g. draft < pending < paid < refunded).
OrdinalOrdinal: lexicographic fractional-index ordering keys (@doeixd/metakit/domain).
TextText that holds no NUL character (U+0000), which Postgres cannot store and every text and equality operation refuses. A field of Text.schema is one the…

Interfaces

Types

CalendarDayValueInteger epoch day (0 = 1970-01-01), timezone-free.
DecimalValueInteger count of fixed-scale decimal units (10^-S).
IdValueA branded string identifier for entity Entity.
MoneyValueInteger minor-unit amount branded by currency C and decimal scale S.
OrdinalValueA base-62 lexicographic ordinal key (0-9A-Za-z, non-empty).