# TypeScript

## What is TypeScript?

At its core, **TypeScript** is a superset of [**JavaScript**](/orbital/readme-1.md)—which means it builds on top of JavaScript by adding static typing.

Think of it as

> TypeScript = JavaScript + Types

You write valid JavaScript, but with the power of **types**, **interfaces**, **type inference**, and other features that help catch bugs earlier, improve editor tooling (like auto-completion and refactoring), and make your codebase more robust as it grows.

TypeScript compiles to JavaScript, which means your browser or Node.js doesn’t need to support TypeScript directly. You write .ts or .tsx files, then transpile them into plain JavaScript (usually sits under the `/dist` folder).

## What This Guide Covers

This guide is for those who've finished the [JavaScript section](/orbital/readme-1.md) and want to learn just the most essential TypeScript features to be productive in React.

We’re not going to cover everything about TypeScript (like advanced conditional types). Instead, we focus on:

* What you actually use daily in React codebases
* Concepts that improve code clarity, type safety, and developer productivity

By the end of this guide, you'll understand how to:

* How to define and extend **types** and **interfaces** for your components and logic
* When and how to use handy utility types like `Pick`, `Omit`, and `Partial`
* How to safely type **component props, events, refs, and hooks**
* How to avoid common mistakes (like reaching for `any` too quickly)
* And ultimately, how to make your code **more predictable**, **scalable**, and **enjoyable** to work with


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.nushackers.org/orbital/typescript.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
