title: typescript文档2-Handbook
date: 2023.2.19
tags:


https://www.typescriptlang.org/docs/handbook/intro.html
https://www.typescriptlang.org/zh/docs/handbook/2/basic-types.html

2023.2.19 星期日

The TypeScript Handbook

The Basics

Static type-checking

Non-exception Failures

Types for Tooling

tsc, the TypeScript compiler

Emitting with Errors

Explicit Types

Erased Types

Downleveling

Strictness

noImplicitAny

strictNullChecks

Everyday Types

The primitives: string, number, and boolean

Arrays

any

noImplicitAny

Type Annotations on Variables

Functions

Parameter Type Annotations

Return Type Annotations

Anonymous Functions

Object Types

Optional Properties

Union Types

Defining a Union Type

Working with Union Types

Type Aliases

Interfaces

Differences Between Type Aliases and Interfaces

Type Assertions

Literal Types

Literal Inference

null and undefined

strictNullChecks off

strictNullChecks on

Non-null Assertion Operator (Postfix !)

Enums

Less Common Primitives

Narrowing

More on Functions

Object Types

Type Manipulation

Creating Types from Types
Generics
Keyof Type Operator
Typeof Type Operator
Indexed Access Types
Conditional Types
Mapped Types
Template Literal Types

Classes

Modules