Skip to content
Shapemetry

Types

Guide

What it is: the shared type contract - ONLY the types that cross a package boundary (geometry ⇄ scene ⇄ model ⇄ hosts). A type used inside a single package stays in that package.

Declarations only. No runtime code, no const, no functions, no dependencies - the package compiles to an empty module.

Design laws

  1. Imports nothing. Types sits BELOW all packages in the dependency graph; importing one would invert the arrows.
  2. Cross-boundary only. A type moves in when a SECOND package needs it - never speculatively.
  3. One declaration, both sides. The exchange format is declared once. The goal is to retire unchecked JSON.parse(...) as X casts: the producer's return type IS the consumer's expectation.
pnpm add @huukhanhnguyen/types
import type { Point, BoundingBox, BoundingBox2d, Path2d } from '@huukhanhnguyen/types'

API reference

One page per concept, grouped by source directory — the sidebar mirrors packages/types/src exactly.

Geometry

Evaluate

Model

Io

Last updated: 📖 2 min readEdit on GitHub