TypeScript
JavaScript with added type annotations, checked by a compiler before the code runs.
In more detail
TypeScript catches mistakes such as passing a number where a string is expected, and gives editors autocomplete. The compiler, tsc, then removes the annotations to leave plain JavaScript that runs anywhere JavaScript does.
Examples
The course's lesson files are .tsx, TypeScript files that may contain JSX.In the browser: The course examples are written in TypeScript: interfaces and type names such as string[] describe the shape of data, and the types are removed when the code is compiled to plain JavaScript for the browser.Current Node.js versions can run many .ts files directly by stripping the annotations, and loader hooks can transpile other files as they are imported.The course examples are written in TypeScript: interfaces describe the shape of props, and union types describe reducer actions.interface CardProps { title: string; count: number; }function add(a: number, b: number): number { return a + b; }Related terms
- JavaScript — The programming language of web browsers, also widely used on servers through Node.js.
- as const — The TypeScript suffix as const, which tells the compiler to treat an object's values as fixed literal values rather than general types.
- VariantProps — A TypeScript helper from CVA that extracts a component's prop types from its cva() definition.
- type declaration file — A TypeScript file ending in .d.ts that describes the types of JavaScript code without containing the code itself.
- static typing — A language rule that every variable has one fixed type, known when the program is compiled, so type mistakes are caught before it runs.
- nominal typing — A type system in which two types are compatible only if one is declared to inherit or implement the other, not merely because they have the same members.
- interface — A named set of member signatures that a type promises to implement, with no state of its own.
- compile time — The moment source code is checked and translated by a compiler, before the program runs, as opposed to run time.
- type safety — Having a type checker such as TypeScript confirm that values have the expected shape before the code runs.
- validation schema — A description of what valid data looks like, checked by code while the program runs so bad data is rejected at the door.
- TSX file — A TypeScript file that may contain JSX markup, used for React components such as page.tsx.
- transpiler — A tool that translates source code into another language at a similar level, such as TypeScript into plain JavaScript.
- module customization hooks — Functions you register with module.register() or module.registerHooks() to change how Node.js finds and loads modules.
- discriminated union — A type made of several object shapes that share one literal field, such as status or type, whose value tells them apart.
- tsc — The command-line TypeScript compiler, which type-checks a project and writes JavaScript and declaration files.
- static type system — Rules a compiler uses to check, before the program runs, that every value is used in a way its type allows.
- type erasure — The removal of all TypeScript types when code is compiled, so none of them exist while the JavaScript runs.
Taught in
- Token Transformation: Style Dictionary & Multi-Platform Outputs — Design Systems & Component Engineering
- Class Variance Authority: Type-Safe Variant & Prop Orchestration — Design Systems & Component Engineering
- Polymorphism & Slotted Composition: The asChild Pattern — Design Systems & Component Engineering
- Storybook & Component Driven Development Workflows — Design Systems & Component Engineering
- Component Packaging: Dual ESM/CJS Builds & Package Exports — Design Systems & Component Engineering
- The C# Language: Types, Variables, and Flow Control — Modern .NET Core, C# & Enterprise Microservices
- How Browsers Work: Navigation, DNS, TCP, TLS And Request Timing — Frontend Architecture & Web Platform
- Layout, Reflow, Paint And GPU Compositing Layers — Frontend Architecture & Web Platform
- CustomEvent Dispatching And Decoupled Component Event Buses — Frontend Architecture & Web Platform
- Web Workers: Off-Thread Computation And Structured Clone — Frontend Architecture & Web Platform
- Monorepo Architecture: Workspaces & Turborepo — Production Full-Stack Engineering
- End-to-End Type Safety: Shared Schemas & DTOs — Production Full-Stack Engineering
- Type-Safe RPC Architectures: tRPC & Procedures — Production Full-Stack Engineering
- Containerization Architecture: Multi-Stage Dockerfiles — Production Full-Stack Engineering
- Server Action Security: Zod Validation & Auth Gates — Next.js 15 & Modern App Router Architecture
- Route Handlers: RESTful Endpoints with NextRequest — Next.js 15 & Modern App Router Architecture
- Instrumentation: OpenTelemetry & Performance Spans — Next.js 15 & Modern App Router Architecture
- V8 Engine & JIT Pipeline: Bytecode & Turbofan — Node.js Internals & Backend Services
- Native Module Systems: ESM Loader Hooks vs CommonJS — Node.js Internals & Backend Services
- Production Hardening: Graceful Shutdown & Docker — Node.js Internals & Backend Services
- JSX Transpilation: createElement, JSX Runtime, React Elements — React 19 & Modern Component Architecture
- Complex State with useReducer: State Machines And Action Types — React 19 & Modern Component Architecture
- useImperativeHandle: Controlled Ref Forwarding Boundaries — React 19 & Modern Component Architecture
- Higher-Order Components And Render Props: Tradeoff Analysis — React 19 & Modern Component Architecture
- Why TypeScript: Contracts, Erased Types And Soundness — Production TypeScript
- The Compiler Pipeline: tsc, AST And Code Emission — Production TypeScript
- tsconfig.json: target, lib, strict And NodeNext — Production TypeScript
- Type Annotations, Type Inference And Contextual Typing — Production TypeScript
- Verify Your Environment: Running tsc And Bun TypeScript — Production TypeScript
- Primitive Types: String, Number, Boolean, Bigint And Symbol — Production TypeScript
- Literal Types: String, Number, Boolean Literals And const — Production TypeScript
- any Versus unknown: Defensive Typing In Practice — Production TypeScript
- void, undefined And null: Exact Optional Property Types — Production TypeScript
- never: The Bottom Type And Exhaustive Switch Checking — Production TypeScript
- Type Aliases Versus Interfaces: Declaration Merging — Production TypeScript
- Optional Properties, Readonly And Index Signatures — Production TypeScript
- Union Types, Intersections And Property Conflicts — Production TypeScript
- Discriminated Unions: Tagged Variants And Pattern Matching — Production TypeScript
- Tuples: Fixed Length, Labeled Elements And Variadic Tuples — Production TypeScript
- Typeof Guards, Truthiness And Equality Narrowing — Production TypeScript
- The in Operator And Instanceof Narrowing — Production TypeScript
- Custom Type Predicates: Functions Returning is Type — Production TypeScript
- Assertion Signatures: asserts condition And Invariants — Production TypeScript
- Exhaustive Narrowing With never In Production Handlers — Production TypeScript
- Why Generics: Functions, Identities And Type Variables — Production TypeScript
- Generic Interfaces, Classes And Type Aliases — Production TypeScript
- Generic Constraints: extends, keyof And Indexed Access — Production TypeScript
- Default Generic Arguments And Multi-Type Parameters — Production TypeScript
- Const Type Parameters: Retaining Literal Types In Functions — Production TypeScript
- Core Utilities: Partial, Required, Readonly, Pick And Omit — Production TypeScript
- Conditional Types: Ternary Types And Type Inference With infer — Production TypeScript
- Mapped Types, Key Remapping With as And Template Literals — Production TypeScript
- ECMAScript Modules, CJS Interop And verbatimModuleSyntax — Production TypeScript
- Declaration Files, Ambient Namespaces And Module Augmentation — Production TypeScript
- The satisfies Operator: Safe Validation Without Widening — Production TypeScript
- Modern Decorators: Stage 3 Standards And Class Metadata — Production TypeScript
- The Spine Artifact: Generating Typed Models From OpenAPI — Production TypeScript