Convert Figma logo to code with AI

microsoft logoTypeScript-Handbook

Deprecated, please use the TypeScript-Website repo instead

4,882
1,129
4,882
181

Top Related Projects

100,112

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

:books: The definitive guide to TypeScript and possibly the best TypeScript book :book:. Free and Open Source 🌹

44,903

Cheatsheets for experienced React developers getting started with TypeScript

Collection of TypeScript type challenges with online judge

An interactive TypeScript tutorial for beginners

A collection of awesome TypeScript resources for client-side and server-side development. Write your awesome JavaScript in TypeScript

Quick Overview

The TypeScript-Handbook repository is the official documentation for TypeScript, a typed superset of JavaScript. It provides comprehensive guides, tutorials, and reference materials for developers learning and using TypeScript in their projects.

Pros

  • Comprehensive and well-structured documentation
  • Regularly updated to reflect the latest TypeScript features
  • Includes both beginner-friendly and advanced topics
  • Maintained by Microsoft, ensuring high-quality content

Cons

  • Can be overwhelming for absolute beginners
  • Some sections may become outdated as TypeScript evolves rapidly
  • Limited interactive examples compared to some other documentation sites
  • Navigation can be challenging due to the large amount of content

Code Examples

As this is a documentation repository and not a code library, there are no specific code examples to provide. However, the handbook itself contains numerous code snippets and examples to illustrate TypeScript concepts and features.

Getting Started

To access the TypeScript Handbook:

  1. Visit the GitHub repository: https://github.com/microsoft/TypeScript-Handbook
  2. Browse the contents in the pages directory for specific topics
  3. For a more user-friendly reading experience, visit the official TypeScript documentation website: https://www.typescriptlang.org/docs/

To start using TypeScript in your project:

# Install TypeScript globally
npm install -g typescript

# Create a new TypeScript file
echo "const message: string = 'Hello, TypeScript!';" > hello.ts

# Compile the TypeScript file
tsc hello.ts

# Run the compiled JavaScript
node hello.js

This will set up a basic TypeScript environment and compile a simple TypeScript file to JavaScript.

Competitor Comparisons

100,112

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

Pros of TypeScript

  • Contains the actual TypeScript compiler source code
  • Provides a more comprehensive view of TypeScript's inner workings
  • Allows direct contributions to the language implementation

Cons of TypeScript

  • Larger and more complex codebase, potentially harder for beginners
  • Requires deeper understanding of compiler design and language internals
  • Less focused on documentation and learning resources

Code Comparison

TypeScript (compiler implementation):

function createSourceFile(
    fileName: string,
    sourceText: string,
    languageVersion: ScriptTarget,
    setParentNodes = false,
    scriptKind?: ScriptKind
): SourceFile {
    // ... implementation details
}

TypeScript-Handbook (documentation example):

function greet(person: string) {
    return "Hello, " + person;
}

console.log(greet("TypeScript"));

The TypeScript repository contains the actual compiler implementation, while the TypeScript-Handbook focuses on providing documentation and examples for users. The TypeScript repo is more suitable for those interested in contributing to the language itself or understanding its internals, while the Handbook is better for learning and reference purposes.

:books: The definitive guide to TypeScript and possibly the best TypeScript book :book:. Free and Open Source 🌹

Pros of typescript-book

  • More comprehensive coverage of advanced TypeScript topics
  • Includes practical examples and real-world scenarios
  • Regularly updated with community contributions

Cons of typescript-book

  • Less official and may not always align with the latest TypeScript updates
  • Can be overwhelming for beginners due to its extensive content

Code Comparison

TypeScript-Handbook:

interface Person {
  name: string;
  age: number;
}

function greet(person: Person) {
  return "Hello, " + person.name;
}

typescript-book:

type Person = {
  name: string;
  age: number;
};

const greet = (person: Person): string => {
  return `Hello, ${person.name}!`;
};

The TypeScript-Handbook example uses an interface and a traditional function declaration, while the typescript-book example uses a type alias and an arrow function. Both approaches are valid in TypeScript, but the typescript-book example demonstrates more modern syntax.

TypeScript-Handbook is the official documentation maintained by Microsoft, offering a structured and authoritative resource for learning TypeScript. It focuses on core concepts and language features.

typescript-book, on the other hand, is a community-driven project that provides a more in-depth exploration of TypeScript, including advanced topics and practical applications. It offers a broader perspective but may require more effort to navigate for beginners.

44,903

Cheatsheets for experienced React developers getting started with TypeScript

Pros of React TypeScript Cheatsheets

  • Focused specifically on React and TypeScript integration
  • Community-driven with frequent updates and contributions
  • Includes practical examples and best practices for React development

Cons of React TypeScript Cheatsheets

  • Less comprehensive coverage of general TypeScript concepts
  • May not be as authoritative as the official Microsoft handbook
  • Could be overwhelming for beginners due to its dense information

Code Comparison

TypeScript-Handbook (Basic Types):

let isDone: boolean = false;
let decimal: number = 6;
let color: string = "blue";
let list: number[] = [1, 2, 3];
let x: [string, number] = ["hello", 10];

React TypeScript Cheatsheets (React Component):

type Props = {
  name: string;
  age: number;
};

const MyComponent: React.FC<Props> = ({ name, age }) => {
  return <div>{`Hello, ${name}! You are ${age} years old.`}</div>;
};

Summary

While the TypeScript-Handbook provides a comprehensive guide to TypeScript as a whole, React TypeScript Cheatsheets offers specialized knowledge for React developers. The latter is more community-driven and frequently updated, but may lack the depth of general TypeScript concepts found in the official handbook. Choose based on your specific needs: general TypeScript learning or React-focused TypeScript application.

Collection of TypeScript type challenges with online judge

Pros of type-challenges

  • Interactive learning experience with hands-on challenges
  • Community-driven content with a wide range of difficulty levels
  • Focuses on advanced TypeScript concepts and edge cases

Cons of type-challenges

  • Less structured than a comprehensive handbook
  • May be overwhelming for beginners
  • Lacks in-depth explanations for some concepts

Code Comparison

TypeScript-Handbook:

interface Person {
  name: string;
  age: number;
}

function greet(person: Person) {
  return `Hello, ${person.name}!`;
}

type-challenges:

type Greeting<T> = T extends { name: infer N }
  ? `Hello, ${N extends string ? N : never}!`
  : never;

type Result = Greeting<{ name: 'Alice' }>;
// Result: "Hello, Alice!"

The TypeScript-Handbook example demonstrates basic interface and function usage, while the type-challenges example showcases advanced type manipulation using conditional types and type inference.

TypeScript-Handbook provides a comprehensive guide to TypeScript features and best practices, suitable for beginners and experienced developers alike. It offers structured learning with detailed explanations and examples.

type-challenges, on the other hand, presents a collection of TypeScript type puzzles that challenge users to solve complex type manipulations. It's ideal for those looking to deepen their understanding of TypeScript's type system and explore its limits.

An interactive TypeScript tutorial for beginners

Pros of beginners-typescript-tutorial

  • More interactive and hands-on approach with coding exercises
  • Tailored specifically for beginners, with a gradual learning curve
  • Includes video content for enhanced learning experience

Cons of beginners-typescript-tutorial

  • Less comprehensive coverage of advanced TypeScript features
  • May not be as up-to-date with the latest TypeScript releases
  • Smaller community and fewer contributors compared to the official handbook

Code Comparison

TypeScript-Handbook:

interface Person {
  name: string;
  age: number;
}

function greet(person: Person) {
  return "Hello, " + person.name;
}

beginners-typescript-tutorial:

type Person = {
  name: string;
  age: number;
};

const greet = (person: Person): string => {
  return `Hello, ${person.name}!`;
};

Both repositories provide valuable resources for learning TypeScript, but they cater to different audiences and learning styles. The TypeScript-Handbook offers a more comprehensive and official documentation, while beginners-typescript-tutorial focuses on providing an interactive and beginner-friendly learning experience. The code comparison shows that both repositories cover similar concepts, but with slightly different approaches to syntax and implementation.

A collection of awesome TypeScript resources for client-side and server-side development. Write your awesome JavaScript in TypeScript

Pros of awesome-typescript

  • Curated list of resources, tools, and libraries for TypeScript
  • Community-driven with frequent updates and contributions
  • Covers a wide range of TypeScript-related topics beyond just language features

Cons of awesome-typescript

  • Less structured and organized compared to the official handbook
  • May contain outdated or less reliable information due to community contributions
  • Lacks in-depth explanations and examples for core TypeScript concepts

Code comparison

TypeScript-Handbook:

interface Person {
  name: string;
  age: number;
}

function greet(person: Person) {
  return "Hello, " + person.name;
}

awesome-typescript:

// No direct code examples provided in the repository
// The repository focuses on linking to external resources rather than
// providing code snippets or tutorials directly

Summary

TypeScript-Handbook is the official documentation maintained by Microsoft, offering comprehensive and structured information about TypeScript. It provides in-depth explanations, examples, and best practices for using the language.

awesome-typescript, on the other hand, is a community-driven repository that serves as a curated list of TypeScript resources, tools, and libraries. It offers a broader scope of TypeScript-related content but lacks the official status and structured approach of the handbook.

While TypeScript-Handbook is ideal for learning the language in-depth, awesome-typescript is better suited for discovering additional resources and staying up-to-date with the TypeScript ecosystem.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

TypeScript-Handbook Repo Deprecated

The handbook has moved into the new TypeScript website repo, you can find the revised and updated handbook pages in /packages/documentation in that repo.


TypeScript-Handbook

Build Status

The TypeScript Handbook is a comprehensive guide to the TypeScript language. It is meant to be read online at the TypeScript website or directly from this repository.

For a more formal description of the language, see the latest TypeScript Language Specification.

How To Contribute

TypeScript-Handbook is accepting contributions. If you've submitted a PR for an existing issue, please post a comment in the issue to avoid duplication of effort. See our CONTRIBUTING file for more information - it also contains guidelines for how to submit a PR.