Introduction
Get started with typist - a type-level programming toolkit for TypeScript
Typist is a minimal, compositional, and debug-friendly suite of type-level utilities designed for static analysis , symbolic testing , and phantom type operations in TypeScript.
It treats types as first-class values , leveraging TypeScript's structural type system to encode symbolic verdicts , composable constraints , and static proofs .
What is Type-Level Programming?
Type-level programming is a paradigm where you write code that operates on types themselves, rather than just values. TypeScript's powerful type system allows you to create types that can perform computations, validations, and transformations at compile time.
Core Philosophy
Typist follows these key principles:
- Minimal - Small, focused utilities that compose well together
- Compositional - Building blocks that can be combined to create complex type-level logic
- Debug-friendly - Clear error messages and introspectable type-level behavior
- Zero runtime cost - All utilities operate at compile-time with no runtime overhead
Why Choose Typist?
Traditional TypeScript development often requires runtime checks and validation to ensure type safety. Typist shifts this validation to compile-time, enabling you to:
- Catch type errors before they reach production
- Build more expressive and self-documenting APIs
- Create robust type-level test suites
- Eliminate runtime overhead for type checking
- Express complex domain constraints through the type system
Key Features
Phantom Types
Create nominal types without runtime overhead, perfect for domain modeling and preventing common mistakes like mixing up user IDs and product IDs.
Verdict System
Encode compile-time validation results that can be composed and reasoned about, providing rich error information when types don't match expectations.
Type Assertions
Test assignability, identity, and structure in-place with utilities that provide immediate feedback during development.
Symbolic Operations
Perform type-level comparisons and transformations with a rich set of operators that work seamlessly with TypeScript's inference engine.
Getting Started
Ready to dive in? Check out our Installation Guideto set up typist in your project, or jump straight to the Quick Start for hands-on examples.
💡 Pro Tip
Typist works best when you embrace type-first thinking. Start with the types you want to express, then use typist's utilities to encode and validate those type relationships.