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
- Imports nothing. Types sits BELOW all packages in the dependency graph; importing one would invert the arrows.
- Cross-boundary only. A type moves in when a SECOND package needs it - never speculatively.
- One declaration, both sides. The exchange format is declared once. The goal is to retire unchecked
JSON.parse(...) as Xcasts: the producer's return type IS the consumer's expectation.
pnpm add @huukhanhnguyen/typesimport 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
- Core - 8 types
- Core2d - 5 types
- Curve - 7 types
- Curve2d - 9 types
- Surface - 3 types
- Brep - 15 types
- Mesh - 4 types
- TriangleMesh - 5 types
- Image - 1 types
- Section - 1 types
- Hatch - 7 types
- Light - 2 types
- Annotation - 14 types
Evaluate
- Animation - 2 types
- Entities - 10 types
- Skeleton - 2 types
- Material - 3 types
- Texture - 1 types
- Layer - 2 types
- AssetFile - 1 types
- Styles - 2 types
- TextStyle - 1 types
- AnnotationStyle - 2 types
- Environment - 2 types
- Camera - 5 types
- Sheets - 1 types
- Table - 3 types
- Frame - 6 types
- Inspect - 7 types
- Block - 5 types
- SavedView - 3 types
Model
- Document - 20 types
- AnimationBinding - 1 types
- DocumentEnvironment - 4 types
- Analyze - 15 types
- CommandRegistry - 2 types
- Conventions - 9 types
- Export - 2 types
- Filter - 6 types
- Fold - 10 types
- GraphSnapshot - 4 types
- Import - 3 types
- Kernel - 4 types
- Nesting - 3 types
- Tree - 7 types
- ObjectBase - 2 types
Io
- 3MF - 2 types
- Binary - 1 types
- DXF - 4 types
- Entity mesh - 6 types
- GLB - 3 types
- GLB entities - 4 types
- glTF - 20 types
- IFC - 2 types
- IGES - 8 types
- OBJ - 3 types
- PDF - 4 types
- PLY - 1 types
- PNG - 1 types
- STEP - 7 types
- STL - 2 types
- SVG - 6 types
- USD - 9 types