enumwaii

Documentation

Learn enumwaii's ownership model, API, integrations, and tooling.

These pages document enumwaii's public API, ownership guarantees, integrations, and tooling. Start with Getting started to declare a vocabulary and validate its first external value.

API map

APIPurposeDetailed guide
em([...])Declare a non-empty closed string setBranding and identity
.enumBranded application membersMember surfaces
.rawEnum, .rawValuesCanonical unbranded integration valuesMember surfaces
.casesRaw discriminants for native union narrowingMember surfaces
.parse, .safeParse, .isValidate untrusted values at a boundaryRuntime boundaries and integrations
.pick, .omit, .extend, em.combineCompose related declarationsBranding and identity
.derive, .deriveToBuild exhaustive lookups while preserving provenanceDerivation
~type, ~keys, ~safeParseResultDeclaration-local TypeScript utilitiesMember surfaces
eslint-plugin-enumwaiiEnforce source-level ownership conventionsEnforcement model

Design foundations

Enumwaii centers one guarantee: application code receives members from the declaration that owns them.

Five foundations carry that guarantee across application code and integrations:

  1. Required TypeScript brands attach ownership to each member while runtime values remain ordinary strings.
  2. .enum is the application surface; raw views serve literal-only integrations and native union discriminants.
  3. Provenance-sensitive APIs accept members in value positions so their ownership survives inference.
  4. Frozen plain objects provide predictable behavior across frameworks, serializers, inspectors, and test tools.
  5. Runtime parsing and optional lint rules extend the ownership model to external data and source conventions.

The branding and identity guide explains the type contract and records the alternatives tested during API design. Runtime boundaries establish trust for external values, and the enforcement model maps each source convention to TypeScript or lint.

Guarantees by layer

LayerResponsibility
TypeScriptCarries declaration ownership through branded members and composition.
Runtime parsingEstablishes membership when values enter from JSON, forms, URLs, databases, providers, or agent output.
Standard SchemaLets compatible consumers use the declaration as their validation contract.
ESLintGuides casing, member extraction, comparisons, subsets, .cases, and union authoring.
Plain runtime valuesPreserve native string equality, serialization, persistence, and framework interoperability.

For coding agents

The AI agents guide provides a packaged SKILL.md, an llms.txt discovery index, an llms.md library brief, and prompts for both initial setup and read-only repository migration analysis. Every documentation page is also available as Markdown at the same path with a .md suffix.

On this page