Atscript for TypeScript
The TypeScript guide is the main place to evaluate Atscript today. TypeScript is the first supported target, and this section is organized as a practical learning path first, with lower-level reference material separated out for later.
Best Path For New Users
If you are evaluating Atscript for the first time, read these in order:
What You Can Do Today
- Define models once in
.asfiles - Generate TypeScript types and runtime metadata
- Validate data from the same model
- Export JSON Schema
- Feed the same model into DB integrations
Recommended Learning Path
1. Get A First Success
- Why Atscript? — the problem Atscript solves for TypeScript applications
- Quick Start — define one model, generate files, and validate data
- Build Setup — wire Atscript into Vite, Rollup, esbuild, or another bundler
2. Learn The Core Language
- Interfaces & Types — the
.assyntax you will use most - Imports & Exports — how
.as,.as.d.ts, and.as.jsfit together - Primitives — semantic types like
string.emailandnumber.int - Annotations Guide — practical metadata and validation annotations
3. Use The Runtime Tools
- Validation Guide — validate unknown input with type narrowing
- Metadata — read labels, placeholders, and other annotations at runtime
- JSON Schema — generate JSON Schema from types
- Serialization — serialize types for backend-to-frontend transfer
4. Configure And Automate
- Installation — packages, prerequisites, and optional tooling
- Configuration — plugin options and config file settings
- CLI — generate files from the command line
5. Go Deeper When You Need To
- Atscript Validation vs Others — side-by-side comparison with Zod and class-validator
- Ad-hoc Annotations — annotate existing types without editing their source
- Annotations Reference — inheritance, merge rules, and the full annotation catalog
- Validation Reference — validator options, plugin hooks, and lower-level API details
- Type Definitions — the annotated runtime type system and traversal
- Code Generation — what Atscript emits and how imports work
- Custom Primitives — define your own primitive extensions
- Custom Annotations — define your own annotation types