Guide
What it is: the shared type contract — every type the live packages share (geometry, model, hosts) is declared here. There is no second place.
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, Curve2d,
ObjectNode, BlockNode, ObjectNodeBase, SceneNode,
SceneObject, ObjectData, CameraObject, Page, BrepData,
} from '@huukhanhnguyen/types'Object tier: identity is the object's key. Mid-chain stream is ObjectData (*Data). Page.objects is SceneObject[]. CameraData is projection only (fov | height); placement is CameraObject.instances[i]. Two kinds carry an Entity tier over their *Data for what only a viewport needs: LightEntity = LightData & { target?, gizmoSize? } and CameraEntity = CameraData & { gizmoSize? } — one Entity each, wrapping the whole union, never one per shape or projection arm.
Modules
- evaluate/animation
- evaluate/annotationStyle
- evaluate/assetFile
- evaluate/colorStop
- evaluate/diff
- evaluate/environment
- evaluate/frame
- evaluate/inspect
- evaluate/layer
- evaluate/material
- evaluate/pattern
- evaluate/sheets
- evaluate/styles
- evaluate/table
- evaluate/textStyle
- evaluate/texture
- evaluate/view
- geometry/brep
- geometry/core
- geometry/core2d
- geometry/curve
- geometry/curve2d
- geometry/mesh
- geometry/offset
- geometry/surface
- geometry/triangleMesh
- model/analyze
- model/animationBinding
- model/commandRegistry
- model/conventions
- model/environment
- model/filter
- model/fold
- model/graphSnapshot
- model/import
- model/kernel
- model/modelDocument
- model/nesting
- model/objectBase
- model/objectNode
- model/tree
- objects/angularDimension
- objects/annotation
- objects/base
- objects/block
- objects/brep
- objects/camera
- objects/curve
- objects/hatch
- objects/image
- objects/leader
- objects/light
- objects/linearDimension
- objects/mesh
- objects/pointCloud
- objects/radialDimension
- objects/scene
- objects/section
- objects/skeleton
- objects/text
- objects/view