Atscript for TypeScript
The complete guide to using Atscript with TypeScript. This section is self-contained — everything you need to define types in .as files, generate TypeScript code, and use runtime utilities like validation, JSON Schema, and serialization.
What's in This Guide
Introduction:
- Why Atscript? — the problem Atscript solves
- Atscript Validation vs Others — side-by-side comparison with Zod and class-validator
- Quick Start — create your first
.asfile
Atscript Syntax:
- Interfaces & Types — define data structures
- Imports & Exports — module system
- Primitives — built-in types and semantic extensions
- Annotations — syntax, inheritance, built-in annotations
- Ad-hoc Annotations — annotate existing types without modification
Runtime API:
- Metadata — access annotations at runtime
- Validation — validate data with type guard support
- JSON Schema — generate JSON Schema from types
- Serialization — serialize types for backend-to-frontend transfer
- Type Definitions — the annotated type system and type traversal
Setup & Tooling:
- Configuration — config file and plugin options
- CLI — build
.asfiles from the command line - Build Setup — bundler integration (Vite, Rollup, esbuild)
Advanced:
- Custom Primitives — define your own primitive extensions
- Custom Annotations — define your own annotation types