{i("handb_deprecated_title")}
+{i("handb_deprecated_subtitle")}
diff --git a/README.md b/README.md index 554028f329e7..ae364400720f 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,7 @@ A template for generating a new playground plugin which you can use via `npm ini ## Handbook Epub -Generates an epub file from the handbook files. You can try downloading it at http://www.staging-typescript.org/assets/typescript-handbook-beta.epub +Generates an epub file from the handbook files. You can try downloading it at http://www.typescriptlang.org/assets/typescript-handbook.epub ## Community Meta diff --git a/docs/New TypeScript Version.md b/docs/New TypeScript Version.md index 547bfbf32ad3..3cb347ce1ef4 100644 --- a/docs/New TypeScript Version.md +++ b/docs/New TypeScript Version.md @@ -49,6 +49,10 @@ For each new flag: - Linking compiler versions - Add a new section to `releaseToConfigsMap` for your version +#### Playground + +The tag should be automatically generated on a [daily basis](https://github.com/microsoft/TypeScript-Make-Monaco-Builds/actions/workflows/nightly_check_prod_deploys.yml) - so you shouldn't have to do anything + ##### Tests Run `yarn test`. @@ -62,11 +66,24 @@ Unless something drastic has change, you shouldn't need to do anything. You coul ### Release -#### Playground +#### Release Notes + +Grab the markdown from the [blog posts repo](https://github.com/microsoft/TypeScript-blog-posts), create a file like: `packages/documentation/copy/en/release-notes/TypeScript 3.9.md` + +Grab the header info from a previous release notes, and add it to your new version: + +```md +--- +title: TypeScript 3.9 +layout: docs +permalink: /docs/handbook/release-notes/typescript-3-9.html +oneline: TypeScript 3.9 Release Notes +--- +``` -Make a tag for the final version in [`orta/make-monaco-builds`](https://github.com/orta/make-monaco-builds/) e.g. `git tag 3.9.3` and push it up. +You can add twoslash to the code samples if you want. -Remove the link to the beta in the dropdowns in: [`packages/playground/src/index.ts`](https://github.com/microsoft/TypeScript-website/blob/v2/packages/playground/src/index.ts) because it will be auto-generated now. +When you're happy with that, then edit [`packages/documentation/copy/en/release-notes/Overview.md](https://github.com/microsoft/TypeScript-website/blob/v2/packages/documentation/copy/en/release-notes/Overview.md) to include the changes you just added, and simplify descriptions. ##### Index diff --git a/packages/documentation/copy/en/handbook-v1/Basic Types.md b/packages/documentation/copy/en/handbook-v1/Basic Types.md index ff0801e2610b..fda92cedb099 100644 --- a/packages/documentation/copy/en/handbook-v1/Basic Types.md +++ b/packages/documentation/copy/en/handbook-v1/Basic Types.md @@ -2,8 +2,9 @@ title: Basic Types layout: docs permalink: /docs/handbook/basic-types.html -oneline: "Step one in learning TypeScript: The basic types." +oneline: "Step two in learning TypeScript: The basic types." handbook: "true" +deprecated_by: /docs/handbook/2/everyday-types.html --- For programs to be useful, we need to be able to work with some of the simplest units of data: numbers, strings, structures, boolean values, and the like. diff --git a/packages/documentation/copy/en/handbook-v1/Classes.md b/packages/documentation/copy/en/handbook-v1/Classes.md index b7c0a7a799ff..f0e368c91184 100644 --- a/packages/documentation/copy/en/handbook-v1/Classes.md +++ b/packages/documentation/copy/en/handbook-v1/Classes.md @@ -4,6 +4,7 @@ layout: docs permalink: /docs/handbook/classes.html oneline: How classes work in TypeScript handbook: "true" +deprecated_by: /docs/handbook/2/classes.html --- Traditional JavaScript uses functions and prototype-based inheritance to build up reusable components, but this may feel a bit awkward to programmers more comfortable with an object-oriented approach, where classes inherit functionality and objects are built from these classes. diff --git a/packages/documentation/copy/en/handbook-v1/Functions.md b/packages/documentation/copy/en/handbook-v1/Functions.md index 528e29d2b048..ffbed9246d21 100644 --- a/packages/documentation/copy/en/handbook-v1/Functions.md +++ b/packages/documentation/copy/en/handbook-v1/Functions.md @@ -4,6 +4,7 @@ layout: docs permalink: /docs/handbook/functions.html oneline: How to add types to a function handbook: "true" +deprecated_by: /docs/handbook/2/functions.html --- Functions are the fundamental building block of any application in JavaScript. diff --git a/packages/documentation/copy/en/handbook-v1/Generics.md b/packages/documentation/copy/en/handbook-v1/Generics.md index c8313061012a..a5f7bd40e671 100644 --- a/packages/documentation/copy/en/handbook-v1/Generics.md +++ b/packages/documentation/copy/en/handbook-v1/Generics.md @@ -4,6 +4,7 @@ layout: docs permalink: /docs/handbook/generics.html oneline: Introduction to TypeScript and Generics handbook: "true" +deprecated_by: /docs/handbook/2/generics.html --- A major part of software engineering is building components that not only have well-defined and consistent APIs, but are also reusable. diff --git a/packages/documentation/copy/en/handbook-v1/Interfaces.md b/packages/documentation/copy/en/handbook-v1/Interfaces.md index 27d88baf6060..6174a9b0a7af 100644 --- a/packages/documentation/copy/en/handbook-v1/Interfaces.md +++ b/packages/documentation/copy/en/handbook-v1/Interfaces.md @@ -4,6 +4,7 @@ layout: docs permalink: /docs/handbook/interfaces.html oneline: How to write an interface with TypeScript handbook: "true" +deprecated_by: /docs/handbook/2/objects.html --- One of TypeScript's core principles is that type checking focuses on the _shape_ that values have. diff --git a/packages/documentation/copy/en/handbook-v1/Literal Types.md b/packages/documentation/copy/en/handbook-v1/Literal Types.md index 29bc0b81fc4a..5925d2488ad8 100644 --- a/packages/documentation/copy/en/handbook-v1/Literal Types.md +++ b/packages/documentation/copy/en/handbook-v1/Literal Types.md @@ -4,6 +4,7 @@ layout: docs permalink: /docs/handbook/literal-types.html oneline: Using literal types with TypeScript handbook: "true" +deprecated_by: /docs/handbook/2/everyday-types.html#literal-types --- A literal is a more concrete sub-type of a collective type. diff --git a/packages/documentation/copy/en/handbook-v1/Unions and Intersections.md b/packages/documentation/copy/en/handbook-v1/Unions and Intersections.md index aa44a9a08406..ba8a5baacc0f 100644 --- a/packages/documentation/copy/en/handbook-v1/Unions and Intersections.md +++ b/packages/documentation/copy/en/handbook-v1/Unions and Intersections.md @@ -4,6 +4,7 @@ layout: docs permalink: /docs/handbook/unions-and-intersections.html oneline: How to use unions and intersection types in TypeScript handbook: "true" +deprecated_by: /docs/handbook/2/everyday-types.html#union-types --- So far, the handbook has covered types which are atomic objects. diff --git a/packages/documentation/copy/en/handbook-v2/Basics.md b/packages/documentation/copy/en/handbook-v2/Basics.md index b0b2d15924f1..85738dbd53db 100644 --- a/packages/documentation/copy/en/handbook-v2/Basics.md +++ b/packages/documentation/copy/en/handbook-v2/Basics.md @@ -5,8 +5,6 @@ permalink: /docs/handbook/2/basic-types.html oneline: "Step one in learning TypeScript: The basic types." preamble: >
Welcome to the first page of the handbook, if this is your first experience with TypeScript - you may want to start at one of the 'Getting Started' guides - -beta: true --- Each and every value in JavaScript has a set of behaviors you can observe from running different operations. diff --git a/packages/documentation/copy/en/handbook-v2/Classes.md b/packages/documentation/copy/en/handbook-v2/Classes.md index 5ffe6f533c5d..2fdca24387d0 100644 --- a/packages/documentation/copy/en/handbook-v2/Classes.md +++ b/packages/documentation/copy/en/handbook-v2/Classes.md @@ -3,7 +3,6 @@ title: Classes layout: docs permalink: /docs/handbook/2/classes.html oneline: "How classes work in TypeScript" -beta: true ---
@@ -127,7 +126,11 @@ g.name = "also not ok"; ### Constructors -[Background Reading: Constructor (MDN)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor) ++Class constructors are very similar to functions. You can add parameters with type annotations, default values, and overloads: @@ -184,7 +187,11 @@ Forgetting to call `super` is an easy mistake to make in JavaScript, but TypeScr ### Methods -> [Background Reading: Method definitions (MDN)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Method_definitions) +Background Reading:
+
+ Constructor (MDN)
++A function property on a class is called a _method_. Methods can use all the same type annotations as functions and constructors: @@ -337,7 +344,11 @@ c.y = 10; ### `extends` Clauses -> [Background Reading: extends keyword (MDN)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/extends) +Background Reading:
+
+ Method definitions
++Classes may `extend` from a base class. A derived class has all the properties and methods of its base class, and also define additional members. @@ -366,7 +377,11 @@ d.woof(3); #### Overriding Methods -> [Background reading: super keyword (MDN)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/super) +Background Reading:
+
+ extends keyword (MDN)
++A derived class can also override a base class field or property. You can use the `super.` syntax to access base class methods. @@ -709,7 +724,11 @@ If you need to protect values in your class from malicious actors, you should us ## Static Members -> [Background Reading: Static Members (MDN)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static) +Background Reading:
+
+ super keyword (MDN)
++Classes may have `static` members. These members aren't associated with a particular instance of the class. @@ -823,7 +842,11 @@ The `static` members of a generic class can never refer to the class's type para ## `this` at Runtime in Classes -> [Background Reading: `this` keyword (MDN)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this) +Background Reading:
+
+ Static Members (MDN)
++It's important to remember that TypeScript doesn't change the runtime behavior of JavaScript, and that JavaScript is somewhat famous for having some peculiar runtime behaviors. @@ -854,7 +877,11 @@ TypeScript provides some ways to mitigate or prevent this kind of error. ### Arrow Functions -> [Background Reading: Arrow functions (MDN)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) +Background Reading:
+
+ this keyword (MDN)
++If you have a function that will often be called in a way that loses its `this` context, it can make sense to use an arrow function property instead of a method definition: @@ -1020,7 +1047,11 @@ console.log(a.z); ## Class Expressions -> [Background reading: Class expressions (MDN)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/class) +Background Reading:
+
+ Arrow functions (MDN)
++Class expressions are very similar to class declarations. The only real difference is that class expressions don't need a name, though we can refer to them via whatever identifier they ended up bound to: diff --git a/packages/documentation/copy/en/handbook-v2/Everyday Types.md b/packages/documentation/copy/en/handbook-v2/Everyday Types.md index 56bd47895875..d75fcd8b7828 100644 --- a/packages/documentation/copy/en/handbook-v2/Everyday Types.md +++ b/packages/documentation/copy/en/handbook-v2/Everyday Types.md @@ -3,11 +3,8 @@ title: Everyday Types layout: docs permalink: /docs/handbook/2/everyday-types.html oneline: "The language primitives." -beta: true --- - - In this chapter, we'll cover some of the most common types of values you'll find in JavaScript code, and explain the corresponding ways to describe those types in TypeScript. This isn't an exhaustive list, and future chapters will describe more ways to name and use other types. @@ -384,7 +381,74 @@ Being concerned only with the structure and capabilities of types is why we call ### Differences Between Type Aliases and Interfaces Type aliases and interfaces are very similar, and in many cases you can choose between them freely. -Here are the most relevant differences between the two that you should be aware of. +Almost all features of an `interface` are available in `type`, the key distinction is that a type cannot be re-opened to add new properties vs an interface which is always extendable. + +Background Reading:
+
+ Class expressions (MDN)
++ +
+ You'll learn more about these concepts in later chapters, so don't worry if you don't understand all of these right away. - Type alias names [_may_ appear in error messages](/play?#code/PTAEGEHsFsAcEsA2BTATqNrLusgzngIYDm+oA7koqIYuYQJ56gCueyoAUCKAC4AWHAHaFcoSADMaQ0PCG80EwgGNkALk6c5C1EtWgAsqOi1QAb06groEbjWg8vVHOKcAvpokshy3vEgyyMr8kEbQJogAFND2YREAlOaW1soBeJAoAHSIkMTRmbbI8e6aPMiZxJmgACqCGKhY6ABGyDnkFFQ0dIzMbBwCwqIccabcYLyQoKjIEmh8kwN8DLAc5PzwwbLMyAAeK77IACYaQSEjUWZWhfYAjABMAMwALA+gbsVjoADqgjKESytQPxCHghAByXigYgBfr8LAsYj8aQMUASbDQcRSExCeCwFiIQh+AKfAYyBiQFgOPyIaikSGLQo0Zj-aazaY+dSaXjLDgAGXgAC9CKhDqAALxJaw2Ib2RzOISuDycLw+ImBYKQflCkWRRD2LXCw6JCxS1JCdJZHJ5RAFIbFJU8ADKC3WzEcnVZaGYE1ABpFnFOmsFhsil2uoHuzwArO9SmAAEIsSFrZB-GgAjjA5gtVN8VCEc1o1C4Q4AGlR2AwO1EsBQoAAbvB-gJ4HhPgB5aDwem-Ph1TCV3AEEirTp4ELtRbTPD4vwKjOfAuioSQHuDXBcnmgACC+eCONFEs73YAPGGZVT5cRyyhiHh7AAON7lsG3vBggB8XGV3l8-nVISOgghxoLq9i7io-AHsayRWGaFrlFauq2rg9qaIGQHwCBqChtKdgRo8TxRjeyB3o+7xAA), sometimes in place of the equivalent anonymous type (which may or may not be desirable). Interfaces will always be named in error messages. @@ -604,6 +668,10 @@ function liveDangerously(x?: number | undefined) { Just like other type assertions, this doesn't change the runtime behavior of your code, so it's important to only use `!` when you know that the value _can't_ be `null` or `undefined`. +### Enums + +Enums are a feature added to JavaScript by TypeScript which allows for describing a value which could be one of a set of possible named constants. Unlike most TypeScript features, this is _not_ a type-level addition to JavaScript but something added to the language and runtime. Because of this, it's a feature which you should know exists, but maybe hold off on using unless you are sure. You can read more about enums in the [Enum reference page](/docs/handbook/enums.html). + ### Less Common Primitives It's worth mentioning the rest of the primitives in JavaScript which are represented in the type system. diff --git a/packages/documentation/copy/en/handbook-v2/Modules.md b/packages/documentation/copy/en/handbook-v2/Modules.md index fc8f8d34a1a4..fcb72cf406ff 100644 --- a/packages/documentation/copy/en/handbook-v2/Modules.md +++ b/packages/documentation/copy/en/handbook-v2/Modules.md @@ -3,7 +3,6 @@ title: Modules layout: docs permalink: /docs/handbook/2/modules.html oneline: "How JavaScript handles communicating across file boundaries." -beta: true --- JavaScript has a long history of different ways to handle modularizing code. diff --git a/packages/documentation/copy/en/handbook-v2/More on Functions.md b/packages/documentation/copy/en/handbook-v2/More on Functions.md index 463df3476ceb..de5ac140f9af 100644 --- a/packages/documentation/copy/en/handbook-v2/More on Functions.md +++ b/packages/documentation/copy/en/handbook-v2/More on Functions.md @@ -3,7 +3,6 @@ title: More on Functions layout: docs permalink: /docs/handbook/2/functions.html oneline: "Learn about how Functions work in TypeScript." -beta: true --- Functions are the basic building block of any application, whether they're local functions, imported from another module, or methods on a class. @@ -698,7 +697,12 @@ If need to accept an arbitrary function but don't intend to call it, the type `( ## Rest Parameters and Arguments -**Background reading**: [Rest Parameters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters) and [Spread Syntax](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax) ++ ++ Interface+ Type+ ++ +Extending an interface
+++interface Animal { + name: string +}
+interface Bear extends Animal { + honey: boolean +}
+const bear = getBear() +bear.name +bear.honey ++ +Extending a type via intersections
+++type Animal = { + name: string +}
+type Bear = Animal & { + honey: Boolean +}
+const bear = getBear(); +bear.name; +bear.honey; ++ + ++ +Adding new fields to an existing interface
+++interface Window { + title: string +}
+interface Window { + ts: TypeScriptAPI +}
+const src = 'const a = "Hello World"'; +window.ts.transpileModule(src, {}); ++ +A type cannot be changed after being created
+++type Window = { + title: string +}
+type Window = { + ts: TypeScriptAPI +}
+ // Error: Duplicate identifier 'Window'.
++### Rest Parameters @@ -753,7 +757,12 @@ Using rest arguments may require turning on [`downlevelIteration`](/tsconfig/#do ## Parameter Destructuring -> **Background reading**: [Destructuring Assignment](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) + +Background Reading:
+
+ Rest Parameters
+ Spread Syntax
++You can use parameter destructuring to conveniently unpack objects provided as an argument into one or more local variables in the function body. In JavaScript, it looks like this: diff --git a/packages/documentation/copy/en/handbook-v2/Narrowing.md b/packages/documentation/copy/en/handbook-v2/Narrowing.md index 1fd9ed3c5b33..1ee9cd6999a7 100644 --- a/packages/documentation/copy/en/handbook-v2/Narrowing.md +++ b/packages/documentation/copy/en/handbook-v2/Narrowing.md @@ -3,7 +3,6 @@ title: Narrowing layout: docs permalink: /docs/handbook/2/narrowing.html oneline: "Understand how TypeScript uses JavaScript knowledge to reduce the amount of type syntax in your projects." -beta: true --- Imagine we have a function called `padLeft`. @@ -167,7 +166,7 @@ TypeError: null is not iterable Keep in mind though that truthiness checking on primitives can often be error prone. As an example, consider a different attempt at writing `printAll` -```ts twoslash +```ts twoslash {class: "do-not-do-this"} function printAll(strs: string | string[] | null) { // !!!!!!!!!!!!!!!! // DON'T DO THIS! @@ -374,6 +373,66 @@ function example() { } ``` +## Using type predicates + +We've worked with existing JavaScript constructs to handle narrowing so far, however sometimes you want more direct control over how types change throughout your code. + +To define a user-defined type guard, we simply need to define a function whose return type is a _type predicate_: + +```ts twoslash +type Fish = { swim: () => void }; +type Bird = { fly: () => void }; +declare function getSmallPet(): Fish | Bird; +// ---cut--- +function isFish(pet: Fish | Bird): pet is Fish { + return (pet as Fish).swim !== undefined; +} +``` + +`pet is Fish` is our type predicate in this example. +A predicate takes the form `parameterName is Type`, where `parameterName` must be the name of a parameter from the current function signature. + +Any time `isFish` is called with some variable, TypeScript will _narrow_ that variable to that specific type if the original type is compatible. + +```ts twoslash +type Fish = { swim: () => void }; +type Bird = { fly: () => void }; +declare function getSmallPet(): Fish | Bird; +function isFish(pet: Fish | Bird): pet is Fish { + return (pet as Fish).swim !== undefined; +} +// ---cut--- +// Both calls to 'swim' and 'fly' are now okay. +let pet = getSmallPet(); + +if (isFish(pet)) { + pet.swim(); +} else { + pet.fly(); +} +``` + +Notice that TypeScript not only knows that `pet` is a `Fish` in the `if` branch; +it also knows that in the `else` branch, you _don't_ have a `Fish`, so you must have a `Bird`. + +You may use the type guard `isFish` to filter an array of `Fish | Bird` and obtain an array of `Fish`: + +```ts twoslash +// @errors: 2345 +type Fish = { swim: () => void }; +type Bird = { fly: () => void }; +declare function getSmallPet(): Fish | Bird; +function isFish(pet: Fish | Bird): pet is Fish { + return (pet as Fish).swim !== undefined; +} +// ---cut--- +const zoo: (Fish | Bird)[] = [getSmallPet(), getSmallPet(), getSmallPet()]; +const underWater1: Fish[] = zoo.filter(isFish); +// or, equivalently +const underWater2: Fish[] = zoo.filterBackground Reading:
+
+ Destructuring Assignment
+(isFish); +const underWater3: Fish[] = zoo.filter ((pet) => isFish(pet)); +``` + # Discriminated unions Most of the examples we've looked at so far have focused around narrowing single variables with simple types like `string`, `boolean`, and `number`. diff --git a/packages/documentation/copy/en/handbook-v2/Object Types.md b/packages/documentation/copy/en/handbook-v2/Object Types.md index b065916dfc93..340e715f5f31 100644 --- a/packages/documentation/copy/en/handbook-v2/Object Types.md +++ b/packages/documentation/copy/en/handbook-v2/Object Types.md @@ -3,7 +3,6 @@ title: Object Types layout: docs permalink: /docs/handbook/2/objects.html oneline: "How TypeScript describes the shapes of JavaScript objects." -beta: true --- In JavaScript, the fundamental way that we group and pass around data is through objects. @@ -177,10 +176,8 @@ function paintShape({ shape, xPos = 0, yPos = 0 }: PaintOptions) { Here we used [a destructuring pattern](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) for `paintShape`'s parameter, and provided [default values](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Default_values) for `xPos` and `yPos`. Now `xPos` and `yPos` are both definitely present within the body of `paintShape`, but optional for any callers to `paintShape`. - +> Note that there is currently no way to place type annotations within destructuring patterns. +> This is because the following syntax already means something different in JavaScript. ```ts twoslash // @noImplicitAny: false @@ -727,14 +724,11 @@ function doSomething(stringHash: [string, number]) { } ``` - +> Tuple types are useful in heavily convention-based APIs, where each element's meaning is "obvious". +> This gives us flexibility in whatever we want to name our variables when we destructure them. +> In the above example, we were able to name elements `0` and `1` to whatever we wanted. +> +> However, since not every user holds the same view of what's obvious, it may be worth reconsidering whether using objects with descriptive property names may be better for your API. Other than those length checks, simple tuple types like these are equivalent to types which are versions of `Array`s that declare properties for specific indexes, and that declare `length` with a numeric literal type. @@ -838,7 +832,7 @@ function foo(a: number, b: number, ...args: number[]) { ### `readonly` Tuple Types -One final note about tuple types - tuples types have `readonly` variants, and can be specified by sticking a `readonly` modifier in front of them - just like with array shorthands. +One final note about tuple types - tuples types have `readonly` variants, and can be specified by sticking a `readonly` modifier in front of them - just like with array shorthand syntax. ```ts twoslash function doSomething(pair: readonly [string, number]) { diff --git a/packages/documentation/copy/en/handbook-v1/The Handbook.md b/packages/documentation/copy/en/handbook-v2/The Handbook.md similarity index 86% rename from packages/documentation/copy/en/handbook-v1/The Handbook.md rename to packages/documentation/copy/en/handbook-v2/The Handbook.md index a2b4e71b5e31..df3c596ace2c 100644 --- a/packages/documentation/copy/en/handbook-v1/The Handbook.md +++ b/packages/documentation/copy/en/handbook-v2/The Handbook.md @@ -30,13 +30,12 @@ The handbook is split into two sections: - Read and understand commonly-used TypeScript syntax and patterns - Explain the effects of important compiler options - Correctly predict type system behavior in most cases - - Write a .d.ts declaration for a simple function, object, or class In the interests of clarity and brevity, the main content of the Handbook will not explore every edge case or minutiae of the features being covered. You can find more details on particular concepts in the reference articles. - **Reference Files** - The reference section is built to provide a richer understanding of how a particular part of TypeScript works. You can read it top-to-bottom, but each section aims to provide a deeper explanation of a single concept - meaning there is no aim for continuity. + The reference section below the handbook in the navigation is built to provide a richer understanding of how a particular part of TypeScript works. You can read it top-to-bottom, but each section aims to provide a deeper explanation of a single concept - meaning there is no aim for continuity. ### Non-Goals @@ -50,9 +49,11 @@ Finally, the Handbook won't cover how TypeScript interacts with other tools, exc ## Get Started -Before getting started with [Basic Types](/docs/handbook/basic-types.html), we recommend reading one of the following introductory pages. These introductions are intended to highlight key similarities and differences between TypeScript and your favored programming language, and clear up common misconceptions specific to those languages. +Before getting started with [Basic Types](/docs/handbook/2/basic-types.html), we recommend reading one of the following introductory pages. These introductions are intended to highlight key similarities and differences between TypeScript and your favored programming language, and clear up common misconceptions specific to those languages. - [TypeScript for New Programmers](/docs/handbook/typescript-from-scratch.html) - [TypeScript for JavaScript Programmers](/docs/handbook/typescript-in-5-minutes.html) - [TypeScript for OOP Programmers](/docs/handbook/typescript-in-5-minutes-oop.html) - [TypeScript for Functional Programmers](/docs/handbook/typescript-in-5-minutes-func.html) + +Otherwise, jump to [Basic Types](/docs/handbook/2/basic-types.html). diff --git a/packages/documentation/copy/en/handbook-v2/Type Declarations.md b/packages/documentation/copy/en/handbook-v2/Type Declarations.md index b01c4ed31ceb..5c5397b0928c 100644 --- a/packages/documentation/copy/en/handbook-v2/Type Declarations.md +++ b/packages/documentation/copy/en/handbook-v2/Type Declarations.md @@ -3,7 +3,6 @@ title: Type Declarations layout: docs permalink: /docs/handbook/2/type-declarations.html oneline: "How TypeScript provides types for un-typed JavaScript." -beta: true --- Throughout the sections you've read so far, we've been demonstrating basic TypeScript concepts using the built-in functions present in all JavaScript runtimes. diff --git a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Conditional Types.md b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Conditional Types.md index 6bd6cf2255a2..80605affce24 100644 --- a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Conditional Types.md +++ b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Conditional Types.md @@ -3,7 +3,6 @@ title: Conditional Types layout: docs permalink: /docs/handbook/2/conditional-types.html oneline: "Create types which act like if statements in the type system." -beta: true --- At the heart of most useful programs, we have to make decisions based on input. diff --git a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Generics.md b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Generics.md index b9ab34e0c5ec..20a618bb3f20 100644 --- a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Generics.md +++ b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Generics.md @@ -3,7 +3,6 @@ title: Generics layout: docs permalink: /docs/handbook/2/generics.html oneline: Types which take parameters -beta: true --- A major part of software engineering is building components that not only have well-defined and consistent APIs, but are also reusable. diff --git a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Indexed Access Types.md b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Indexed Access Types.md index fef3a980c352..906209f002b2 100644 --- a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Indexed Access Types.md +++ b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Indexed Access Types.md @@ -3,7 +3,6 @@ title: Indexed Access Types layout: docs permalink: /docs/handbook/2/indexed-access-types.html oneline: "Using Type['a'] syntax to access a subset of a type." -beta: true --- We can use an _indexed access type_ to look up a specific property on another type: diff --git a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Keyof Type Operator.md b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Keyof Type Operator.md index 023e2ee6be85..4f2c09c451da 100644 --- a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Keyof Type Operator.md +++ b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Keyof Type Operator.md @@ -3,7 +3,6 @@ title: Keyof Type Operator layout: docs permalink: /docs/handbook/2/keyof-types.html oneline: "Using the keyof operator in type contexts." -beta: true --- ## The `keyof` type operator diff --git a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Mapped Types.md b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Mapped Types.md index b69fd4a07268..9fd929c1df7b 100644 --- a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Mapped Types.md +++ b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Mapped Types.md @@ -3,7 +3,6 @@ title: Mapped Types layout: docs permalink: /docs/handbook/2/mapped-types.html oneline: "Generating types by re-using an existing type." -beta: true --- When you don't want to repeat yourself, sometimes a type needs to be based on another type. diff --git a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Template Literal Types.md b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Template Literal Types.md index 8460a8c710c4..a2eebb3fff8b 100644 --- a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Template Literal Types.md +++ b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Template Literal Types.md @@ -3,7 +3,6 @@ title: Template Literal Types layout: docs permalink: /docs/handbook/2/template-literal-types.html oneline: "Generating mapping types which change properties via template literal strings." -beta: true --- Template literal types build on [string literal types](/docs/handbook/2/everyday-types.html#literal-types), and have the ability to expand into many strings via unions. diff --git a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Typeof Type Operator.md b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Typeof Type Operator.md index 4308703dd6ce..a48674ed8f14 100644 --- a/packages/documentation/copy/en/handbook-v2/Type Manipulation/Typeof Type Operator.md +++ b/packages/documentation/copy/en/handbook-v2/Type Manipulation/Typeof Type Operator.md @@ -3,7 +3,6 @@ title: Typeof Type Operator layout: docs permalink: /docs/handbook/2/typeof-types.html oneline: "Using the typeof operator in type contexts." -beta: true --- ## The `typeof` type operator diff --git a/packages/documentation/copy/en/handbook-v2/Type Manipulation/_Creating Types from Types.md b/packages/documentation/copy/en/handbook-v2/Type Manipulation/_Creating Types from Types.md index 1bd605a54b3e..1975666ce9d4 100644 --- a/packages/documentation/copy/en/handbook-v2/Type Manipulation/_Creating Types from Types.md +++ b/packages/documentation/copy/en/handbook-v2/Type Manipulation/_Creating Types from Types.md @@ -3,7 +3,6 @@ title: Creating Types from Types layout: docs permalink: /docs/handbook/2/types-from-types.html oneline: "Step one in learning TypeScript: The basics types." -beta: true --- TypeScript's type system is very powerful because it allows expressing types _in terms of other types_. diff --git a/packages/documentation/copy/en/handbook-v2/Understanding Errors.md b/packages/documentation/copy/en/handbook-v2/Understanding Errors.md index b65743ed88a8..91a8de95d972 100644 --- a/packages/documentation/copy/en/handbook-v2/Understanding Errors.md +++ b/packages/documentation/copy/en/handbook-v2/Understanding Errors.md @@ -3,7 +3,6 @@ title: Understanding Errors layout: docs permalink: /docs/handbook/2/understanding-errors.html oneline: "How to read TypeScript errors." -beta: true --- # Understanding Errors diff --git a/packages/documentation/copy/en/reference/Advanced Types.md b/packages/documentation/copy/en/reference/Advanced Types.md index 9b678d2f85de..640bb378d2df 100644 --- a/packages/documentation/copy/en/reference/Advanced Types.md +++ b/packages/documentation/copy/en/reference/Advanced Types.md @@ -3,6 +3,28 @@ title: Advanced Types layout: docs permalink: /docs/handbook/advanced-types.html oneline: Advanced concepts around types in TypeScript +deprecated_by: /docs/handbook/2/types-from-types.html + +# prettier-ignore +deprecation_redirects: [ + type-guards-and-differentiating-types, /docs/handbook/2/narrowing.html, + user-defined-type-guards, /docs/handbook/2/narrowing.html#using-type-predicates, + typeof-type-guards, "/docs/handbook/2/narrowing.html#typeof-type-guards", + instanceof-type-guards, /docs/handbook/2/narrowing.html#instanceof-narrowing, + nullable-types, /docs/handbook/2/everyday-types.html#null-and-undefined, + type-aliases, /docs/handbook/2/everyday-types.html#type-aliases, + interfaces-vs-type-aliases, /docs/handbook/2/everyday-types.html#differences-between-type-aliases-and-interfaces, + enum-member-types, /docs/handbook/enums.html, + polymorphic-this-types, /docs/handbook/2/classes.html, + index-types, /docs/handbook/2/indexed-access-types.html, + index-types-and-index-signatures, /docs/handbook/2/indexed-access-types.html, + mapped-types, /docs/handbook/2/mapped-types.html, + inference-from-mapped-types, /docs/handbook/2/mapped-types.html, + conditional-types, /docs/handbook/2/conditional-types.html, + distributive-conditional-types, /docs/handbook/2/conditional-types.html#distributive-conditional-types, + type-inference-in-conditional-types, /docs/handbook/2/conditional-types.html#inferring-within-conditional-types, + predefined-conditional-types, /docs/handbook/utility-types.html, +] --- This page lists some of the more advanced ways in which you can model types, it works in tandem with the [Utility Types](/docs/handbook/utility-types.html) doc which includes types which are included in TypeScript and available globally. diff --git a/packages/documentation/copy/en/handbook-v1/Enums.md b/packages/documentation/copy/en/reference/Enums.md similarity index 92% rename from packages/documentation/copy/en/handbook-v1/Enums.md rename to packages/documentation/copy/en/reference/Enums.md index 83e55261531f..d59258559597 100644 --- a/packages/documentation/copy/en/handbook-v1/Enums.md +++ b/packages/documentation/copy/en/reference/Enums.md @@ -379,3 +379,41 @@ declare enum Enum { One important difference between ambient and non-ambient enums is that, in regular enums, members that don't have an initializer will be considered constant if its preceding enum member is considered constant. In contrast, an ambient (and non-const) enum member that does not have initializer is _always_ considered computed. + +## Objects vs Enums + +In modern TypeScript, you may not need an enum when an object with `as const` could suffice: + +```ts twoslash +const enum EDirection { + Up, + Down, + Left, + Right, +} + +const ODirection = { + Up: 0, + Down: 1, + Left: 2, + Right: 3, +} as const; + +EDirection.Up; +// ^? + +ODirection.Up; +// ^? + +// Using the enum as a parameter +function walk(dir: EDirection) {} + +// It requires an extra line to pull out the keys +type Direction = typeof ODirection[keyof typeof ODirection]; +function run(dir: Direction) {} + +walk(EDirection.Left); +run(ODirection.Right); +``` + +The biggest argument in favour of this format over is that it keeps your codebase aligned with the state of JavaScript, and [when/if](https://github.com/rbuckton/proposal-enum) enums are added to JavaScript then you can move to the additional syntax. diff --git a/packages/documentation/scripts/generateDocsNavigationPerLanguage.js b/packages/documentation/scripts/generateDocsNavigationPerLanguage.js index 154e5e69dc20..956f0e864b91 100644 --- a/packages/documentation/scripts/generateDocsNavigationPerLanguage.js +++ b/packages/documentation/scripts/generateDocsNavigationPerLanguage.js @@ -41,28 +41,41 @@ const handbookPages = [ }, { title: "Handbook", - summary: "A good first read for your daily TS work.", + summary: "A great first read for your daily TS work.", chronological: true, items: [ - { file: "handbook-v1/The Handbook.md" }, - { file: "handbook-v1/Basic Types.md" }, - { file: "handbook-v1/Interfaces.md" }, - { file: "handbook-v1/Functions.md" }, - { file: "handbook-v1/Literal Types.md" }, - { file: "handbook-v1/Unions and Intersections.md" }, - { file: "handbook-v1/Classes.md" }, - { file: "handbook-v1/Enums.md" }, - { file: "handbook-v1/Generics.md" }, + { file: "handbook-v2/The Handbook.md" }, + { file: "handbook-v2/Basics.md" }, + { file: "handbook-v2/Everyday Types.md" }, + { file: "handbook-v2/Narrowing.md" }, + { file: "handbook-v2/More on Functions.md" }, + { file: "handbook-v2/Object Types.md" }, + { + title: "Type Manipulation", + items: [ + { file: "handbook-v2/Type Manipulation/_Creating Types from Types.md" }, + { file: "handbook-v2/Type Manipulation/Generics.md" }, + { file: "handbook-v2/Type Manipulation/Keyof Type Operator.md" }, + { file: "handbook-v2/Type Manipulation/Typeof Type Operator.md" }, + { file: "handbook-v2/Type Manipulation/Indexed Access Types.md" }, + { file: "handbook-v2/Type Manipulation/Conditional Types.md" }, + { file: "handbook-v2/Type Manipulation/Mapped Types.md" }, + { file: "handbook-v2/Type Manipulation/Template Literal Types.md" }, + ] + }, + { file: "handbook-v2/Classes.md" }, + { file: "handbook-v2/Modules.md" }, ], }, { title: "Reference", summary: "Deep dive reference materials.", items: [ - { file: "reference/Advanced Types.md" }, + // { file: "reference/Advanced Types.md" }, { file: "reference/Utility Types.md" }, { file: "reference/Decorators.md" }, { file: "reference/Declaration Merging.md" }, + { file: "reference/Enums.md" }, { file: "reference/Iterators and Generators.md" }, { file: "reference/JSX.md" }, { file: "reference/Mixins.md" }, @@ -151,38 +164,7 @@ const handbookPages = [ { file: "project-config/Configuring Watch.md" }, { file: "Nightly Builds.md" }, ], - }, - { - title: "Handbook v2: Beta", - summary: "The new handbook which is a work in progress.", - chronological: true, - beta: true, - items: [ - { file: "handbook-v2/Basics.md" }, - { file: "handbook-v2/Everyday Types.md" }, - { file: "handbook-v2/Narrowing.md" }, - { file: "handbook-v2/More on Functions.md" }, - { file: "handbook-v2/Object Types.md" }, - { - title: "Type Manipulation", - items: [ - { file: "handbook-v2/Type Manipulation/_Creating Types from Types.md" }, - { file: "handbook-v2/Type Manipulation/Generics.md" }, - { file: "handbook-v2/Type Manipulation/Keyof Type Operator.md" }, - { file: "handbook-v2/Type Manipulation/Typeof Type Operator.md" }, - { file: "handbook-v2/Type Manipulation/Indexed Access Types.md" }, - { file: "handbook-v2/Type Manipulation/Conditional Types.md" }, - { file: "handbook-v2/Type Manipulation/Mapped Types.md" }, - { file: "handbook-v2/Type Manipulation/Template Literal Types.md" }, - ] - }, - { file: "handbook-v2/Classes.md" }, - { file: "handbook-v2/Modules.md" }, - // These two are probably good reference pages - // { file: "handbook-v2/Type Declarations.md" }, - // { file: "handbook-v2/Understanding Errors.md" }, - ], - }, + } ] fillReleaseInfo(); @@ -383,5 +365,5 @@ function fillReleaseInfo() { } function toID(secIdx, str) { - return secIdx.toString() + str.toLowerCase().replace(/\s/g, "-"); + return secIdx.toString() + "-" + str.toLowerCase().replace(/\s/g, "-"); } diff --git a/packages/documentation/scripts/types/AllFilenames.d.ts b/packages/documentation/scripts/types/AllFilenames.d.ts index 507e453ad4ff..e52ed18e2b40 100644 --- a/packages/documentation/scripts/types/AllFilenames.d.ts +++ b/packages/documentation/scripts/types/AllFilenames.d.ts @@ -21,12 +21,10 @@ export type AllDocsPages = | "get-started/TS for the New Programmer.md" | "handbook-v1/Basic Types.md" | "handbook-v1/Classes.md" - | "handbook-v1/Enums.md" | "handbook-v1/Functions.md" | "handbook-v1/Generics.md" | "handbook-v1/Interfaces.md" | "handbook-v1/Literal Types.md" - | "handbook-v1/The Handbook.md" | "handbook-v1/Unions and Intersections.md" | "handbook-v2/Basics.md" | "handbook-v2/Classes.md" @@ -35,6 +33,7 @@ export type AllDocsPages = | "handbook-v2/More on Functions.md" | "handbook-v2/Narrowing.md" | "handbook-v2/Object Types.md" + | "handbook-v2/The Handbook.md" | "handbook-v2/Type Declarations.md" | "handbook-v2/Understanding Errors.md" | "handbook-v2/Type Manipulation/Conditional Types.md" @@ -58,6 +57,7 @@ export type AllDocsPages = | "reference/Advanced Types.md" | "reference/Declaration Merging.md" | "reference/Decorators.md" + | "reference/Enums.md" | "reference/Iterators and Generators.md" | "reference/JSX.md" | "reference/Mixins.md" @@ -101,6 +101,7 @@ export type AllDocsPages = | "release-notes/TypeScript 3.9.md" | "release-notes/TypeScript 4.0.md" | "release-notes/TypeScript 4.1.md" + | "release-notes/TypeScript 4.2.md" | "tutorials/ASP.NET Core.md" | "tutorials/Angular.md" | "tutorials/Babel with TypeScript.md" diff --git a/packages/handbook-epub/assets/cover.jpg b/packages/handbook-epub/assets/cover.jpg new file mode 100644 index 000000000000..dae7871c497b Binary files /dev/null and b/packages/handbook-epub/assets/cover.jpg differ diff --git a/packages/handbook-epub/assets/cover.png b/packages/handbook-epub/assets/cover.png deleted file mode 100644 index 6c1a0c8e93fb..000000000000 Binary files a/packages/handbook-epub/assets/cover.png and /dev/null differ diff --git a/packages/handbook-epub/assets/ebook-style.css b/packages/handbook-epub/assets/ebook-style.css index 9cb41a8dbe75..2b0463728d79 100644 --- a/packages/handbook-epub/assets/ebook-style.css +++ b/packages/handbook-epub/assets/ebook-style.css @@ -82,6 +82,10 @@ pre code { display: none; } +.code-container .line { + min-height: 1rem; +} + .code-container .error { margin-top: 8px; background-color: rgba(255, 84, 84, 0.2); diff --git a/packages/handbook-epub/script/createEpub.ts b/packages/handbook-epub/script/createEpub.ts index 5635f88f9966..8c22c2c1c1bd 100644 --- a/packages/handbook-epub/script/createEpub.ts +++ b/packages/handbook-epub/script/createEpub.ts @@ -10,6 +10,10 @@ const { createReadStream } = jetpack; const Streampub = require("streampub"); const toHAST = require(`mdast-util-to-hast`); const hastToHTML = require(`hast-util-to-html`); +const { + recursiveReadDirSync, +} = require("../../typescriptlang-org/lib/utils/recursiveReadDirSync"); + import { readdirSync, readFileSync, @@ -33,17 +37,10 @@ const handbookNavigation = getDocumentationNavForLanguage("en"); // Grab all the md + yml info from the handbook files on disk // and add them to ^ // prettier-ignore -const handbookPath = join( - __dirname, - "..", - "..", - "documentation", - "copy", - "en", - "handbook-v1", -); -readdirSync(handbookPath, "utf-8").forEach((path) => { - const filePath = join(handbookPath, path); +const handbookPath = join( __dirname, "..", "..", "documentation", "copy", "en", "handbook-v2"); + +recursiveReadDirSync(handbookPath).forEach((path) => { + const filePath = join(__dirname, "..", "..", path); if (lstatSync(filePath).isDirectory() || !filePath.endsWith("md")) { return; } @@ -52,7 +49,7 @@ readdirSync(handbookPath, "utf-8").forEach((path) => { // prettier-ignore if (!md.data.permalink) { throw new Error( - `${path} in the handbook did not have a permalink in the yml header`, + `${filePath} in the handbook did not have a permalink in the yml header`, ); } const id = md.data.permalink; @@ -86,7 +83,7 @@ const startEpub = async () => { epub.pipe(jetpack.createWriteStream(epubPath)); // Add the cover - epub.write(Streampub.newCoverImage(createReadStream("./assets/cover.png"))); + epub.write(Streampub.newCoverImage(createReadStream("./assets/cover.jpg"))); epub.write(Streampub.newFile("ts.png", createReadStream("./assets/ts.png"))); // Import CSS @@ -110,9 +107,18 @@ const startEpub = async () => { }); epub.write(Streampub.newChapter(bookMetadata.title, editedIntro, 0)); + let counter = 0; for (const item of handbook!.items!) { - const index = handbook!.items!.indexOf(item) + 1; - await addHandbookPage(epub, item.permalink!, index); + if (item.permalink) { + await addHandbookPage(epub, item.permalink, counter); + counter++; + } + if (item.items) { + for (const subitem of item.items) { + await addHandbookPage(epub, subitem.permalink!, counter); + counter++; + } + } } epub.end(); @@ -125,20 +131,25 @@ process.once("exit", () => { epubPath, join( __dirname, - "../../typescriptlang-org/static/assets/typescript-handbook-beta.epub" + "../../typescriptlang-org/static/assets/typescript-handbook.epub" ) ); }); const addHandbookPage = async (epub: any, id: string, index: number) => { const md = markdowns.get(id); - if (!md) throw new Error("Could not get markdown for " + id); + if (!md) + throw new Error( + "Could not get markdown for " + + id + + `\n\nAll MDs: ${Array.from(markdowns.keys())}` + ); const title = md.data.title; const prefix = ` ${title}
`; const suffix = ""; const html = await getHTML(md.content, {}); const edited = replaceAllInString(html, { - 'a href="/': 'a href="https://www.staging-typescript.org/', + 'a href="/': 'a href="https://www.typescriptlang.org/', }); epub.write(Streampub.newChapter(title, prefix + edited + suffix, index)); @@ -153,7 +164,9 @@ const getHTML = async (code: string, settings?: any) => { { markdownAST }, { theme: require("../../typescriptlang-org/lib/themes/typescript-beta-light.json"), - } + }, + // @ts-ignore + {} ); } diff --git a/packages/handbook-epub/script/createPDF.ts b/packages/handbook-epub/script/createPDF.ts index 2b7103c3aced..663aebc21918 100644 --- a/packages/handbook-epub/script/createPDF.ts +++ b/packages/handbook-epub/script/createPDF.ts @@ -17,4 +17,4 @@ const distPath = join(__dirname, "..", "dist"); execSync(`ebook-convert ${join(distPath, "handbook.epub")} ${join(distPath, "handbook.pdf")}`); // prettier-ignore -copyFileSync(join(distPath, "handbook.pdf"), join(__dirname, "..", "..", "typescriptlang-org", "static", "assets", "typescript-handbook-beta.pdf")) +copyFileSync(join(distPath, "handbook.pdf"), join(__dirname, "..", "..", "typescriptlang-org", "static", "assets", "typescript-handbook.pdf")) diff --git a/packages/typescriptlang-org/.gitignore b/packages/typescriptlang-org/.gitignore index aff60b9a4460..45ae35888651 100644 --- a/packages/typescriptlang-org/.gitignore +++ b/packages/typescriptlang-org/.gitignore @@ -84,8 +84,8 @@ static/js/examples/ # No autogenerated types src/__generated__/ -static/assets/typescript-handbook-beta.epub -static/assets/typescript-handbook-beta.pdf +static/assets/typescript-handbook.epub +static/assets/typescript-handbook.pdf /src/lib/release-info.json diff --git a/packages/typescriptlang-org/src/components/layout/main.scss b/packages/typescriptlang-org/src/components/layout/main.scss index 266260c5d8ad..74c3599f36ba 100644 --- a/packages/typescriptlang-org/src/components/layout/main.scss +++ b/packages/typescriptlang-org/src/components/layout/main.scss @@ -158,6 +158,7 @@ html.font-open-dyslexic { li > code { background-color: var(--inline-code-background-color); font-family: $font-code; + padding: 2px 4px; } td { diff --git a/packages/typescriptlang-org/src/copy/en/handbook.ts b/packages/typescriptlang-org/src/copy/en/handbook.ts index 62177e21a188..a869326b74c4 100644 --- a/packages/typescriptlang-org/src/copy/en/handbook.ts +++ b/packages/typescriptlang-org/src/copy/en/handbook.ts @@ -6,4 +6,8 @@ export const handbookCopy = { handb_like_desc: "Yes", handb_dislike_desc: "No", handb_thanks: "Thanks for the feedback", + handb_deprecated_title: "This page has been deprecated", + handb_deprecated_subtitle: "This handbook page has been replaced, ", + handb_deprecated_subtitle_link: "go to the new page", + handb_deprecated_subtitle_action: "Go to new page", } diff --git a/packages/typescriptlang-org/src/lib/documentationNavigation.ts b/packages/typescriptlang-org/src/lib/documentationNavigation.ts index ab975d1fafbb..b77e2a96efd2 100644 --- a/packages/typescriptlang-org/src/lib/documentationNavigation.ts +++ b/packages/typescriptlang-org/src/lib/documentationNavigation.ts @@ -7,12 +7,12 @@ */ export interface SidebarNavItem { - title: string - id: string - permalink?: string - chronological?: boolean - oneline?: string - items?: SidebarNavItem[] + title: string; + id: string; + permalink?: string; + chronological?: boolean; + oneline?: string; + items?: SidebarNavItem[]; } /** ---INSERT--- */ @@ -20,9 +20,9 @@ export interface SidebarNavItem { export function getDocumentationNavForLanguage( langRequest: string ): SidebarNavItem[] { - const langs = ["en", "id", "ja", "ko", "pl", "pt", "vo", "zh"] - const lang = langs.includes(langRequest) ? langRequest : "en" - const navigations: Record= {} + const langs = ["en"]; + const lang = langs.includes(langRequest) ? langRequest : "en"; + const navigations: Record = {}; navigations.en = [ { @@ -34,33 +34,33 @@ export function getDocumentationNavForLanguage( items: [ { title: "TS for the New Programmer", - id: "0typescript-for-the-new-programmer", + id: "0-typescript-for-the-new-programmer", permalink: "/docs/handbook/typescript-from-scratch.html", oneline: "Learn TypeScript from scratch", }, { title: "TypeScript for JS Programmers", - id: "0typescript-for-javascript-programmers", + id: "0-typescript-for-javascript-programmers", permalink: "/docs/handbook/typescript-in-5-minutes.html", oneline: "Learn how TypeScript extends JavaScript", }, { title: "TS for Java/C# Programmers", - id: "0typescript-for-java/c#-programmers", + id: "0-typescript-for-java/c#-programmers", permalink: "/docs/handbook/typescript-in-5-minutes-oop.html", oneline: "Learn TypeScript if you have a background in object-oriented languages", }, { title: "TS for Functional Programmers", - id: "0typescript-for-functional-programmers", + id: "0-typescript-for-functional-programmers", permalink: "/docs/handbook/typescript-in-5-minutes-func.html", oneline: "Learn TypeScript if you have a background in functional programming", }, { title: "TypeScript Tooling in 5 minutes", - id: "0typescript-tooling-in-5-minutes", + id: "0-typescript-tooling-in-5-minutes", permalink: "/docs/handbook/typescript-tooling-in-5-minutes.html", oneline: "A tutorial to understand how to create a small website with TypeScript", @@ -69,5177 +69,100 @@ export function getDocumentationNavForLanguage( }, { title: "Handbook", - oneline: "A good first read for your daily TS work.", + oneline: "A great first read for your daily TS work.", id: "handbook", chronological: true, items: [ { title: "The TypeScript Handbook", - id: "1the-typescript-handbook", + id: "1-the-typescript-handbook", permalink: "/docs/handbook/intro.html", oneline: "Your first step to learn TypeScript", }, - { - title: "Basic Types", - id: "1basic-types", - permalink: "/docs/handbook/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Interfaces", - id: "1interfaces", - permalink: "/docs/handbook/interfaces.html", - oneline: "How to write an interface with TypeScript", - }, - { - title: "Functions", - id: "1functions", - permalink: "/docs/handbook/functions.html", - oneline: "How to add types to a function", - }, - { - title: "Literal Types", - id: "1literal-types", - permalink: "/docs/handbook/literal-types.html", - oneline: "Using literal types with TypeScript", - }, - { - title: "Unions and Intersection Types", - id: "1unions-and-intersection-types", - permalink: "/docs/handbook/unions-and-intersections.html", - oneline: "How to use unions and intersection types in TypeScript", - }, - { - title: "Classes", - id: "1classes", - permalink: "/docs/handbook/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Enums", - id: "1enums", - permalink: "/docs/handbook/enums.html", - oneline: "How TypeScript enums work", - }, - { - title: "Generics", - id: "1generics", - permalink: "/docs/handbook/generics.html", - oneline: "Introduction to TypeScript and Generics", - }, - ], - }, - { - title: "Handbook Reference", - oneline: "Deep dive reference materials.", - id: "handbook-reference", - chronological: false, - - items: [ - { - title: "Advanced Types", - id: "2advanced-types", - permalink: "/docs/handbook/advanced-types.html", - oneline: "Advanced concepts around types in TypeScript", - }, - { - title: "Utility Types", - id: "2utility-types", - permalink: "/docs/handbook/utility-types.html", - oneline: "Types which are globally included in TypeScript", - }, - { - title: "Decorators", - id: "2decorators", - permalink: "/docs/handbook/decorators.html", - oneline: "TypeScript Decorators overview", - }, - { - title: "Declaration Merging", - id: "2declaration-merging", - permalink: "/docs/handbook/declaration-merging.html", - oneline: "How merging namespaces and interfaces works", - }, - { - title: "Iterators and Generators", - id: "2iterators-and-generators", - permalink: "/docs/handbook/iterators-and-generators.html", - oneline: "How Iterators and Generators work in TypeScript", - }, - { - title: "JSX", - id: "2jsx", - permalink: "/docs/handbook/jsx.html", - oneline: "Using JSX with TypeScript", - }, - { - title: "Mixins", - id: "2mixins", - permalink: "/docs/handbook/mixins.html", - oneline: "Using the mixin pattern with TypeScript", - }, - { - title: "Modules", - id: "2modules", - permalink: "/docs/handbook/modules.html", - oneline: "How modules work in TypeScript", - }, - { - title: "Module Resolution", - id: "2module-resolution", - permalink: "/docs/handbook/module-resolution.html", - oneline: "How TypeScript resolves modules in JavaScript", - }, - { - title: "Namespaces", - id: "2namespaces", - permalink: "/docs/handbook/namespaces.html", - oneline: "How TypeScript namespaces work", - }, - { - title: "Namespaces and Modules", - id: "2namespaces-and-modules", - permalink: "/docs/handbook/namespaces-and-modules.html", - oneline: - "How to organize code in TypeScript via modules or namespaces", - }, - { - title: "Symbols", - id: "2symbols", - permalink: "/docs/handbook/symbols.html", - oneline: "Using the JavaScript Symbol primitive in TypeScript", - }, - { - title: "Triple-Slash Directives", - id: "2triple-slash-directives", - permalink: "/docs/handbook/triple-slash-directives.html", - oneline: "How to use triple slash directives in TypeScript", - }, - { - title: "Type Compatibility", - id: "2type-compatibility", - permalink: "/docs/handbook/type-compatibility.html", - oneline: "How type-checking works in TypeScript", - }, - { - title: "Type Inference", - id: "2type-inference", - permalink: "/docs/handbook/type-inference.html", - oneline: "How code flow analysis works in TypeScript", - }, - { - title: "Variable Declaration", - id: "2variable-declaration", - permalink: "/docs/handbook/variable-declarations.html", - oneline: "How TypeScript handles variable declaration", - }, - ], - }, - { - title: "Tutorials", - oneline: "Using TypeScript in several environments.", - id: "tutorials", - chronological: false, - - items: [ - { - title: "ASP.NET Core", - id: "3asp.net-core", - permalink: "/docs/handbook/asp-net-core.html", - oneline: "Using TypeScript in ASP.NET Core", - }, - { - title: "Gulp", - id: "3gulp", - permalink: "/docs/handbook/gulp.html", - oneline: "Using TypeScript with Gulp", - }, - { - title: "DOM Manipulation", - id: "3dom-manipulation", - permalink: "/docs/handbook/dom-manipulation.html", - oneline: "Using the DOM with TypeScript", - }, - { - title: "Migrating from JavaScript", - id: "3migrating-from-javascript", - permalink: "/docs/handbook/migrating-from-javascript.html", - oneline: "How to migrate from JavaScript to TypeScript", - }, - { - title: "Using Babel with TypeScript", - id: "3using-babel-with-typescript", - permalink: "/docs/handbook/babel-with-typescript.html", - oneline: "How to create a hybrid Babel + TypeScript project", - }, - ], - }, - { - title: "What's New", - oneline: - "Find out how TypeScript has evolved and what's new in the releases.", - id: "what's-new", - chronological: false, - - items: [ - { - title: "Overview", - id: "4overview", - permalink: "/docs/handbook/release-notes/overview.html", - oneline: "All TypeScript release notes", - }, - { - title: "TypeScript 4.1", - id: "4typescript-4.1", - permalink: "/docs/handbook/release-notes/typescript-4-1.html", - oneline: "TypeScript 4.1 Release Notes", - }, - { - title: "TypeScript 4.0", - id: "4typescript-4.0", - permalink: "/docs/handbook/release-notes/typescript-4-0.html", - oneline: "TypeScript 4.0 Release Notes", - }, - { - title: "TypeScript 3.9", - id: "4typescript-3.9", - permalink: "/docs/handbook/release-notes/typescript-3-9.html", - oneline: "TypeScript 3.9 Release Notes", - }, - { - title: "TypeScript 3.8", - id: "4typescript-3.8", - permalink: "/docs/handbook/release-notes/typescript-3-8.html", - oneline: "TypeScript 3.8 Release Notes", - }, - { - title: "TypeScript 3.7", - id: "4typescript-3.7", - permalink: "/docs/handbook/release-notes/typescript-3-7.html", - oneline: "TypeScript 3.7 Release Notes", - }, - { - title: "TypeScript 3.6", - id: "4typescript-3.6", - permalink: "/docs/handbook/release-notes/typescript-3-6.html", - oneline: "TypeScript 3.6 Release Notes", - }, - { - title: "TypeScript 3.5", - id: "4typescript-3.5", - permalink: "/docs/handbook/release-notes/typescript-3-5.html", - oneline: "TypeScript 3.5 Release Notes", - }, - { - title: "TypeScript 3.4", - id: "4typescript-3.4", - permalink: "/docs/handbook/release-notes/typescript-3-4.html", - oneline: "TypeScript 3.4 Release Notes", - }, - { - title: "TypeScript 3.3", - id: "4typescript-3.3", - permalink: "/docs/handbook/release-notes/typescript-3-3.html", - oneline: "TypeScript 3.3 Release Notes", - }, - { - title: "TypeScript 3.2", - id: "4typescript-3.2", - permalink: "/docs/handbook/release-notes/typescript-3-2.html", - oneline: "TypeScript 3.2 Release Notes", - }, - { - title: "TypeScript 3.1", - id: "4typescript-3.1", - permalink: "/docs/handbook/release-notes/typescript-3-1.html", - oneline: "TypeScript 3.1 Release Notes", - }, - { - title: "TypeScript 3.0", - id: "4typescript-3.0", - permalink: "/docs/handbook/release-notes/typescript-3-0.html", - oneline: "TypeScript 3.0 Release Notes", - }, - { - title: "TypeScript 2.9", - id: "4typescript-2.9", - permalink: "/docs/handbook/release-notes/typescript-2-9.html", - oneline: "TypeScript 2.9 Release Notes", - }, - { - title: "TypeScript 2.8", - id: "4typescript-2.8", - permalink: "/docs/handbook/release-notes/typescript-2-8.html", - oneline: "TypeScript 2.8 Release Notes", - }, - { - title: "TypeScript 2.7", - id: "4typescript-2.7", - permalink: "/docs/handbook/release-notes/typescript-2-7.html", - oneline: "TypeScript 2.7 Release Notes", - }, - { - title: "TypeScript 2.6", - id: "4typescript-2.6", - permalink: "/docs/handbook/release-notes/typescript-2-6.html", - oneline: "TypeScript 2.6 Release Notes", - }, - { - title: "TypeScript 2.5", - id: "4typescript-2.5", - permalink: "/docs/handbook/release-notes/typescript-2-5.html", - oneline: "TypeScript 2.5 Release Notes", - }, - { - title: "TypeScript 2.4", - id: "4typescript-2.4", - permalink: "/docs/handbook/release-notes/typescript-2-4.html", - oneline: "TypeScript 2.4 Release Notes", - }, - { - title: "TypeScript 2.3", - id: "4typescript-2.3", - permalink: "/docs/handbook/release-notes/typescript-2-3.html", - oneline: "TypeScript 2.3 Release Notes", - }, - { - title: "TypeScript 2.2", - id: "4typescript-2.2", - permalink: "/docs/handbook/release-notes/typescript-2-2.html", - oneline: "TypeScript 2.2 Release Notes", - }, - { - title: "TypeScript 2.1", - id: "4typescript-2.1", - permalink: "/docs/handbook/release-notes/typescript-2-1.html", - oneline: "TypeScript 2.1 Release Notes", - }, - { - title: "TypeScript 2.0", - id: "4typescript-2.0", - permalink: "/docs/handbook/release-notes/typescript-2-0.html", - oneline: "TypeScript 2.0 Release Notes", - }, - { - title: "TypeScript 1.8", - id: "4typescript-1.8", - permalink: "/docs/handbook/release-notes/typescript-1-8.html", - oneline: "TypeScript 1.8 Release Notes", - }, - { - title: "TypeScript 1.7", - id: "4typescript-1.7", - permalink: "/docs/handbook/release-notes/typescript-1-7.html", - oneline: "TypeScript 1.7 Release Notes", - }, - { - title: "TypeScript 1.6", - id: "4typescript-1.6", - permalink: "/docs/handbook/release-notes/typescript-1-6.html", - oneline: "TypeScript 1.6 Release Notes", - }, - { - title: "TypeScript 1.5", - id: "4typescript-1.5", - permalink: "/docs/handbook/release-notes/typescript-1-5.html", - oneline: "TypeScript 1.5 Release Notes", - }, - { - title: "TypeScript 1.4", - id: "4typescript-1.4", - permalink: "/docs/handbook/release-notes/typescript-1-4.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.3", - id: "4typescript-1.3", - permalink: "/docs/handbook/release-notes/typescript-1-3.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.1", - id: "4typescript-1.1", - permalink: "/docs/handbook/release-notes/typescript-1-1.html", - oneline: "TypeScript 1.1 Release Notes", - }, - ], - }, - { - title: "Declaration Files", - oneline: - "Learn how to write declaration files to describe existing JavaScript. Important for DefinitelyTyped contributions.", - id: "declaration-files", - chronological: true, - - items: [ - { - title: "Introduction", - id: "5introduction", - permalink: "/docs/handbook/declaration-files/introduction.html", - oneline: - "How to write a high-quality TypeScript Declaration (d.ts) file", - }, - { - title: "Declaration Reference", - id: "5declaration-reference", - permalink: "/docs/handbook/declaration-files/by-example.html", - oneline: "How to create a d.ts file for a module", - }, - { - title: "Library Structures", - id: "5library-structures", - permalink: "/docs/handbook/declaration-files/library-structures.html", - oneline: "How to structure your d.ts files", - }, - { - title: ".d.ts Templates", - id: "5.d.ts-templates", - oneline: "undefined", - - items: [ - { - title: "Modules .d.ts", - id: "5modules-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/module-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Plugin", - id: "5module:-plugin", - permalink: - "/docs/handbook/declaration-files/templates/module-plugin-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Class", - id: "5module:-class", - permalink: - "/docs/handbook/declaration-files/templates/module-class-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Function", - id: "5module:-function", - permalink: - "/docs/handbook/declaration-files/templates/module-function-d-ts.html", - oneline: "undefined", - }, - { - title: "Global .d.ts", - id: "5global-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/global-d-ts.html", - oneline: "undefined", - }, - { - title: "Global: Modifying Module", - id: "5global:-modifying-module", - permalink: - "/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html", - oneline: "undefined", - }, - ], - }, - { - title: "Do's and Don'ts", - id: "5do's-and-don'ts", - permalink: "/docs/handbook/declaration-files/do-s-and-don-ts.html", - oneline: "Recommendations for writing d.ts files", - }, - { - title: "Deep Dive", - id: "5deep-dive", - permalink: "/docs/handbook/declaration-files/deep-dive.html", - oneline: "How do d.ts files work, a deep dive", - }, - { - title: "Publishing", - id: "5publishing", - permalink: "/docs/handbook/declaration-files/publishing.html", - oneline: "How to get your d.ts files to users", - }, - { - title: "Consumption", - id: "5consumption", - permalink: "/docs/handbook/declaration-files/consumption.html", - oneline: "How to download d.ts files for your project", - }, - ], - }, - { - title: "JavaScript", - oneline: "How to use TypeScript-powered JavaScript tooling.", - id: "javascript", - chronological: true, - - items: [ - { - title: "JS Projects Utilizing TypeScript", - id: "6js-projects-utilizing-typescript", - permalink: "/docs/handbook/intro-to-js-ts.html", - oneline: - "How to add type checking to JavaScript files using TypeScript", - }, - { - title: "Type Checking JavaScript Files", - id: "6type-checking-javascript-files", - permalink: "/docs/handbook/type-checking-javascript-files.html", - oneline: - "How to add type checking to JavaScript files using TypeScript", - }, - { - title: "JSDoc Reference", - id: "6jsdoc-reference", - permalink: "/docs/handbook/jsdoc-supported-types.html", - oneline: "What JSDoc does TypeScript-powered JavaScript support?", - }, - { - title: "Creating .d.ts Files from .js files", - id: "6creating-.d.ts-files-from-.js-files", - permalink: "/docs/handbook/declaration-files/dts-from-js.html", - oneline: "How to add d.ts generation to JavaScript projects", - }, - ], - }, - { - title: "Project Configuration", - oneline: "Compiler configuration reference.", - id: "project-configuration", - chronological: false, - - items: [ - { - title: "What is a tsconfig.json", - id: "7what-is-a-tsconfig.json", - permalink: "/docs/handbook/tsconfig-json.html", - oneline: "Learn about how a TSConfig works", - }, - { - title: "Compiler Options in MSBuild", - id: "7compiler-options-in-msbuild", - permalink: "/docs/handbook/compiler-options-in-msbuild.html", - oneline: "Which compiler options are available in MSBuild projects.", - }, - { - title: "TSConfig Reference", - id: "7tsconfig-reference", - permalink: "/tsconfig", - oneline: "The page covering every TSConfig option", - }, - { - title: "tsc CLI Options", - id: "7tsc-cli-options", - permalink: "/docs/handbook/compiler-options.html", - oneline: - "A very high-level overview of the CLI compiler options for tsc", - }, - { - title: "Project References", - id: "7project-references", - permalink: "/docs/handbook/project-references.html", - oneline: "How to split up a large TypeScript project", - }, - { - title: "Integrating with Build Tools", - id: "7integrating-with-build-tools", - permalink: "/docs/handbook/integrating-with-build-tools.html", - oneline: "How to use TypeScript with other build tools", - }, - { - title: "Configuring Watch", - id: "7configuring-watch", - permalink: "/docs/handbook/configuring-watch.html", - oneline: "How to configure the watch mode of TypeScript", - }, - { - title: "Nightly Builds", - id: "7nightly-builds", - permalink: "/docs/handbook/nightly-builds.html", - oneline: "How to use a nightly build of TypeScript", - }, - ], - }, - { - title: "Handbook v2: Beta", - oneline: "The new handbook which is a work in progress.", - id: "handbook-v2:-beta", - chronological: true, - - items: [ - { - title: "The Basics", - id: "8the-basics", - permalink: "/docs/handbook/2/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Everyday Types", - id: "8everyday-types", - permalink: "/docs/handbook/2/everyday-types.html", - oneline: "The language primitives.", - }, - { - title: "Narrowing", - id: "8narrowing", - permalink: "/docs/handbook/2/narrowing.html", - oneline: - "Understand how TypeScript uses JavaScript knowledge to reduce the amount of type syntax in your projects.", - }, - { - title: "More on Functions", - id: "8more-on-functions", - permalink: "/docs/handbook/2/functions.html", - oneline: "Learn about how Functions work in TypeScript.", - }, - { - title: "Object Types", - id: "8object-types", - permalink: "/docs/handbook/2/objects.html", - oneline: "How TypeScript describes the shapes of JavaScript objects.", - }, - { - title: "Type Manipulation", - id: "8type-manipulation", - oneline: "undefined", - - items: [ - { - title: "Creating Types from Types", - id: "8creating-types-from-types", - permalink: "/docs/handbook/2/types-from-types.html", - oneline: "Step one in learning TypeScript: The basics types.", - }, - { - title: "Generics", - id: "8generics", - permalink: "/docs/handbook/2/generics.html", - oneline: "Types which take parameters", - }, - { - title: "Keyof Type Operator", - id: "8keyof-type-operator", - permalink: "/docs/handbook/2/keyof-types.html", - oneline: "Using the keyof operator in type contexts.", - }, - { - title: "Typeof Type Operator", - id: "8typeof-type-operator", - permalink: "/docs/handbook/2/typeof-types.html", - oneline: "Using the typeof operator in type contexts.", - }, - { - title: "Indexed Access Types", - id: "8indexed-access-types", - permalink: "/docs/handbook/2/indexed-access-types.html", - oneline: "Using Type['a'] syntax to access a subset of a type.", - }, - { - title: "Conditional Types", - id: "8conditional-types", - permalink: "/docs/handbook/2/conditional-types.html", - oneline: - "Create types which act like if statements in the type system.", - }, - { - title: "Mapped Types", - id: "8mapped-types", - permalink: "/docs/handbook/2/mapped-types.html", - oneline: "Generating types by re-using an existing type.", - }, - { - title: "Template Literal Types", - id: "8template-literal-types", - permalink: "/docs/handbook/2/template-literal-types.html", - oneline: - "Generating mapping types which change properties via template literal strings.", - }, - ], - }, - { - title: "Classes", - id: "8classes", - permalink: "/docs/handbook/2/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Modules", - id: "8modules", - permalink: "/docs/handbook/2/modules.html", - oneline: "Learn how TypeScript handles different module styles.", - }, - ], - }, - ] - navigations.id = [ - { - title: "Get Started", - oneline: "Quick introductions based on your background or preference.", - id: "get-started", - chronological: false, - - items: [ - { - title: "TS for the New Programmer", - id: "0typescript-for-the-new-programmer", - permalink: "/docs/handbook/typescript-from-scratch.html", - oneline: "Learn TypeScript from scratch", - }, - { - title: "TypeScript for JS Programmers", - id: "0typescript-for-javascript-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes.html", - oneline: "Learn how TypeScript extends JavaScript", - }, - { - title: "TS for Java/C# Programmers", - id: "0typescript-for-java/c#-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-oop.html", - oneline: - "Learn TypeScript if you have a background in object-oriented languages", - }, - { - title: "TS for Functional Programmers", - id: "0typescript-for-functional-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-func.html", - oneline: - "Learn TypeScript if you have a background in functional programming", - }, - { - title: "TypeScript Tooling dalam 5 menit", - id: "0typescript-tooling-dalam-5-menit", - permalink: "/id/docs/handbook/typescript-tooling-in-5-minutes.html", - oneline: - "Sebuah tutorial untuk memahami cara membuat situs web kecil dengan TypeScript", - }, - ], - }, - { - title: "Handbook", - oneline: "A good first read for your daily TS work.", - id: "handbook", - chronological: true, - - items: [ - { - title: "The TypeScript Handbook", - id: "1the-typescript-handbook", - permalink: "/docs/handbook/intro.html", - oneline: "Your first step to learn TypeScript", - }, - { - title: "Basic Types", - id: "1basic-types", - permalink: "/docs/handbook/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Interfaces", - id: "1interfaces", - permalink: "/docs/handbook/interfaces.html", - oneline: "How to write an interface with TypeScript", - }, - { - title: "Functions", - id: "1functions", - permalink: "/docs/handbook/functions.html", - oneline: "How to add types to a function", - }, - { - title: "Literal Types", - id: "1literal-types", - permalink: "/docs/handbook/literal-types.html", - oneline: "Using literal types with TypeScript", - }, - { - title: "Unions and Intersection Types", - id: "1unions-and-intersection-types", - permalink: "/docs/handbook/unions-and-intersections.html", - oneline: "How to use unions and intersection types in TypeScript", - }, - { - title: "Classes", - id: "1classes", - permalink: "/docs/handbook/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Enums", - id: "1enums", - permalink: "/docs/handbook/enums.html", - oneline: "How TypeScript enums work", - }, - { - title: "Generics", - id: "1generics", - permalink: "/docs/handbook/generics.html", - oneline: "Introduction to TypeScript and Generics", - }, - ], - }, - { - title: "Handbook Reference", - oneline: "Deep dive reference materials.", - id: "handbook-reference", - chronological: false, - - items: [ - { - title: "Advanced Types", - id: "2advanced-types", - permalink: "/docs/handbook/advanced-types.html", - oneline: "Advanced concepts around types in TypeScript", - }, - { - title: "Utility Types", - id: "2utility-types", - permalink: "/docs/handbook/utility-types.html", - oneline: "Types which are globally included in TypeScript", - }, - { - title: "Decorators", - id: "2decorators", - permalink: "/id/docs/handbook/decorators.html", - oneline: "Ringkasan Dekorator TypeScript", - }, - { - title: "Declaration Merging", - id: "2declaration-merging", - permalink: "/docs/handbook/declaration-merging.html", - oneline: "How merging namespaces and interfaces works", - }, - { - title: "Iterators dan Generators", - id: "2iterators-dan-generators", - permalink: "/id/docs/handbook/iterators-and-generators.html", - oneline: "Bagaimana Iterator dan Generator bekerja di TypeScript", - }, - { - title: "JSX", - id: "2jsx", - permalink: "/id/docs/handbook/jsx.html", - oneline: "Menggunakan JSX dengan TypeScript", - }, - { - title: "Mixins", - id: "2mixins", - permalink: "/id/docs/handbook/mixins.html", - oneline: "Menggunakan pola mixin dengan TypeScript", - }, - { - title: "Modules", - id: "2modules", - permalink: "/docs/handbook/modules.html", - oneline: "How modules work in TypeScript", - }, - { - title: "Module Resolution", - id: "2module-resolution", - permalink: "/docs/handbook/module-resolution.html", - oneline: "How TypeScript resolves modules in JavaScript", - }, - { - title: "Namespaces", - id: "2namespaces", - permalink: "/docs/handbook/namespaces.html", - oneline: "How TypeScript namespaces work", - }, - { - title: "Namespaces and Modules", - id: "2namespaces-and-modules", - permalink: "/docs/handbook/namespaces-and-modules.html", - oneline: - "How to organize code in TypeScript via modules or namespaces", - }, - { - title: "Symbols", - id: "2symbols", - permalink: "/id/docs/handbook/symbols.html", - oneline: "Menggunakan Simbol JavaScript primitif di TypeScript", - }, - { - title: "Triple-Slash Directives", - id: "2triple-slash-directives", - permalink: "/docs/handbook/triple-slash-directives.html", - oneline: "How to use triple slash directives in TypeScript", - }, - { - title: "Type Compatibility", - id: "2type-compatibility", - permalink: "/docs/handbook/type-compatibility.html", - oneline: "How type-checking works in TypeScript", - }, - { - title: "Type Inference", - id: "2type-inference", - permalink: "/docs/handbook/type-inference.html", - oneline: "How code flow analysis works in TypeScript", - }, - { - title: "Variable Declaration", - id: "2variable-declaration", - permalink: "/docs/handbook/variable-declarations.html", - oneline: "How TypeScript handles variable declaration", - }, - ], - }, - { - title: "Tutorials", - oneline: "Using TypeScript in several environments.", - id: "tutorials", - chronological: false, - - items: [ - { - title: "ASP.NET Core", - id: "3asp.net-core", - permalink: "/docs/handbook/asp-net-core.html", - oneline: "Using TypeScript in ASP.NET Core", - }, - { - title: "Gulp", - id: "3gulp", - permalink: "/docs/handbook/gulp.html", - oneline: "Using TypeScript with Gulp", - }, - { - title: "Manipulasi DOM", - id: "3manipulasi-dom", - permalink: "/id/docs/handbook/dom-manipulation.html", - oneline: "Menggunakan DOM dengan TypeScript", - }, - { - title: "Migrating from JavaScript", - id: "3migrating-from-javascript", - permalink: "/docs/handbook/migrating-from-javascript.html", - oneline: "How to migrate from JavaScript to TypeScript", - }, - { - title: "Menggunakan Babel dengan TypeScript", - id: "3menggunakan-babel-dengan-typescript", - permalink: "/id/docs/handbook/babel-with-typescript.html", - oneline: "Cara membuat proyek hybrid Babel + TypeScript", - }, - ], - }, - { - title: "What's New", - oneline: - "Find out how TypeScript has evolved and what's new in the releases.", - id: "what's-new", - chronological: false, - - items: [ - { - title: "Overview", - id: "4overview", - permalink: "/docs/handbook/release-notes/overview.html", - oneline: "All TypeScript release notes", - }, - { - title: "TypeScript 4.1", - id: "4typescript-4.1", - permalink: "/docs/handbook/release-notes/typescript-4-1.html", - oneline: "TypeScript 4.1 Release Notes", - }, - { - title: "TypeScript 4.0", - id: "4typescript-4.0", - permalink: "/docs/handbook/release-notes/typescript-4-0.html", - oneline: "TypeScript 4.0 Release Notes", - }, - { - title: "TypeScript 3.9", - id: "4typescript-3.9", - permalink: "/docs/handbook/release-notes/typescript-3-9.html", - oneline: "TypeScript 3.9 Release Notes", - }, - { - title: "TypeScript 3.8", - id: "4typescript-3.8", - permalink: "/docs/handbook/release-notes/typescript-3-8.html", - oneline: "TypeScript 3.8 Release Notes", - }, - { - title: "TypeScript 3.7", - id: "4typescript-3.7", - permalink: "/docs/handbook/release-notes/typescript-3-7.html", - oneline: "TypeScript 3.7 Release Notes", - }, - { - title: "TypeScript 3.6", - id: "4typescript-3.6", - permalink: "/docs/handbook/release-notes/typescript-3-6.html", - oneline: "TypeScript 3.6 Release Notes", - }, - { - title: "TypeScript 3.5", - id: "4typescript-3.5", - permalink: "/docs/handbook/release-notes/typescript-3-5.html", - oneline: "TypeScript 3.5 Release Notes", - }, - { - title: "TypeScript 3.4", - id: "4typescript-3.4", - permalink: "/docs/handbook/release-notes/typescript-3-4.html", - oneline: "TypeScript 3.4 Release Notes", - }, - { - title: "TypeScript 3.3", - id: "4typescript-3.3", - permalink: "/docs/handbook/release-notes/typescript-3-3.html", - oneline: "TypeScript 3.3 Release Notes", - }, - { - title: "TypeScript 3.2", - id: "4typescript-3.2", - permalink: "/docs/handbook/release-notes/typescript-3-2.html", - oneline: "TypeScript 3.2 Release Notes", - }, - { - title: "TypeScript 3.1", - id: "4typescript-3.1", - permalink: "/docs/handbook/release-notes/typescript-3-1.html", - oneline: "TypeScript 3.1 Release Notes", - }, - { - title: "TypeScript 3.0", - id: "4typescript-3.0", - permalink: "/docs/handbook/release-notes/typescript-3-0.html", - oneline: "TypeScript 3.0 Release Notes", - }, - { - title: "TypeScript 2.9", - id: "4typescript-2.9", - permalink: "/docs/handbook/release-notes/typescript-2-9.html", - oneline: "TypeScript 2.9 Release Notes", - }, - { - title: "TypeScript 2.8", - id: "4typescript-2.8", - permalink: "/docs/handbook/release-notes/typescript-2-8.html", - oneline: "TypeScript 2.8 Release Notes", - }, - { - title: "TypeScript 2.7", - id: "4typescript-2.7", - permalink: "/docs/handbook/release-notes/typescript-2-7.html", - oneline: "TypeScript 2.7 Release Notes", - }, - { - title: "TypeScript 2.6", - id: "4typescript-2.6", - permalink: "/docs/handbook/release-notes/typescript-2-6.html", - oneline: "TypeScript 2.6 Release Notes", - }, - { - title: "TypeScript 2.5", - id: "4typescript-2.5", - permalink: "/docs/handbook/release-notes/typescript-2-5.html", - oneline: "TypeScript 2.5 Release Notes", - }, - { - title: "TypeScript 2.4", - id: "4typescript-2.4", - permalink: "/docs/handbook/release-notes/typescript-2-4.html", - oneline: "TypeScript 2.4 Release Notes", - }, - { - title: "TypeScript 2.3", - id: "4typescript-2.3", - permalink: "/docs/handbook/release-notes/typescript-2-3.html", - oneline: "TypeScript 2.3 Release Notes", - }, - { - title: "TypeScript 2.2", - id: "4typescript-2.2", - permalink: "/docs/handbook/release-notes/typescript-2-2.html", - oneline: "TypeScript 2.2 Release Notes", - }, - { - title: "TypeScript 2.1", - id: "4typescript-2.1", - permalink: "/docs/handbook/release-notes/typescript-2-1.html", - oneline: "TypeScript 2.1 Release Notes", - }, - { - title: "TypeScript 2.0", - id: "4typescript-2.0", - permalink: "/docs/handbook/release-notes/typescript-2-0.html", - oneline: "TypeScript 2.0 Release Notes", - }, - { - title: "TypeScript 1.8", - id: "4typescript-1.8", - permalink: "/docs/handbook/release-notes/typescript-1-8.html", - oneline: "TypeScript 1.8 Release Notes", - }, - { - title: "TypeScript 1.7", - id: "4typescript-1.7", - permalink: "/docs/handbook/release-notes/typescript-1-7.html", - oneline: "TypeScript 1.7 Release Notes", - }, - { - title: "TypeScript 1.6", - id: "4typescript-1.6", - permalink: "/docs/handbook/release-notes/typescript-1-6.html", - oneline: "TypeScript 1.6 Release Notes", - }, - { - title: "TypeScript 1.5", - id: "4typescript-1.5", - permalink: "/docs/handbook/release-notes/typescript-1-5.html", - oneline: "TypeScript 1.5 Release Notes", - }, - { - title: "TypeScript 1.4", - id: "4typescript-1.4", - permalink: "/docs/handbook/release-notes/typescript-1-4.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.3", - id: "4typescript-1.3", - permalink: "/docs/handbook/release-notes/typescript-1-3.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.1", - id: "4typescript-1.1", - permalink: "/docs/handbook/release-notes/typescript-1-1.html", - oneline: "TypeScript 1.1 Release Notes", - }, - ], - }, - { - title: "Declaration Files", - oneline: - "Learn how to write declaration files to describe existing JavaScript. Important for DefinitelyTyped contributions.", - id: "declaration-files", - chronological: true, - - items: [ - { - title: "Introduction", - id: "5introduction", - permalink: "/docs/handbook/declaration-files/introduction.html", - oneline: - "How to write a high-quality TypeScript Declaration (d.ts) file", - }, - { - title: "Declaration Reference", - id: "5declaration-reference", - permalink: "/docs/handbook/declaration-files/by-example.html", - oneline: "How to create a d.ts file for a module", - }, - { - title: "Library Structures", - id: "5library-structures", - permalink: "/docs/handbook/declaration-files/library-structures.html", - oneline: "How to structure your d.ts files", - }, - { - title: ".d.ts Templates", - id: "5.d.ts-templates", - oneline: "undefined", - - items: [ - { - title: "Modules .d.ts", - id: "5modules-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/module-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Plugin", - id: "5module:-plugin", - permalink: - "/docs/handbook/declaration-files/templates/module-plugin-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Class", - id: "5module:-class", - permalink: - "/docs/handbook/declaration-files/templates/module-class-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Function", - id: "5module:-function", - permalink: - "/docs/handbook/declaration-files/templates/module-function-d-ts.html", - oneline: "undefined", - }, - { - title: "Global .d.ts", - id: "5global-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/global-d-ts.html", - oneline: "undefined", - }, - { - title: "Global: Modifying Module", - id: "5global:-modifying-module", - permalink: - "/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html", - oneline: "undefined", - }, - ], - }, - { - title: "Do's and Don'ts", - id: "5do's-and-don'ts", - permalink: "/docs/handbook/declaration-files/do-s-and-don-ts.html", - oneline: "Recommendations for writing d.ts files", - }, - { - title: "Deep Dive", - id: "5deep-dive", - permalink: "/docs/handbook/declaration-files/deep-dive.html", - oneline: "How do d.ts files work, a deep dive", - }, - { - title: "Publishing", - id: "5publishing", - permalink: "/docs/handbook/declaration-files/publishing.html", - oneline: "How to get your d.ts files to users", - }, - { - title: "Consumption", - id: "5consumption", - permalink: "/docs/handbook/declaration-files/consumption.html", - oneline: "How to download d.ts files for your project", - }, - ], - }, - { - title: "JavaScript", - oneline: "How to use TypeScript-powered JavaScript tooling.", - id: "javascript", - chronological: true, - - items: [ - { - title: "Memanfaatkan Typescript pada Proyek JS", - id: "6memanfaatkan-typescript-pada-proyek-js", - permalink: "/id/docs/handbook/intro-to-js-ts.html", - oneline: - "Cara menambahkan pemeriksaan tipe data pada berkas JavaScript menggunakan TypeScript", - }, - { - title: "Type Checking JavaScript Files", - id: "6type-checking-javascript-files", - permalink: "/docs/handbook/type-checking-javascript-files.html", - oneline: - "How to add type checking to JavaScript files using TypeScript", - }, - { - title: "Referensi JSDoc", - id: "6referensi-jsdoc", - permalink: "/id/docs/handbook/jsdoc-supported-types.html", - oneline: "JSDoc apa yang didukung JavaScript dan TypeScript?", - }, - { - title: "Membuat Berkas .d.ts dari berkas .js", - id: "6membuat-berkas-.d.ts-dari-berkas-.js", - permalink: "/id/docs/handbook/declaration-files/dts-from-js.html", - oneline: "Bagaimana cara menambahkan hasil d.ts ke proyek JavaScript", - }, - ], - }, - { - title: "Project Configuration", - oneline: "Compiler configuration reference.", - id: "project-configuration", - chronological: false, - - items: [ - { - title: "What is a tsconfig.json", - id: "7what-is-a-tsconfig.json", - permalink: "/docs/handbook/tsconfig-json.html", - oneline: "Learn about how a TSConfig works", - }, - { - title: "Compiler Options in MSBuild", - id: "7compiler-options-in-msbuild", - permalink: "/docs/handbook/compiler-options-in-msbuild.html", - oneline: "Which compiler options are available in MSBuild projects.", - }, - { - title: "TSConfig Reference", - id: "7tsconfig-reference", - permalink: "/tsconfig", - oneline: "The page covering every TSConfig option", - }, - { - title: "tsc CLI Options", - id: "7tsc-cli-options", - permalink: "/docs/handbook/compiler-options.html", - oneline: - "A very high-level overview of the CLI compiler options for tsc", - }, - { - title: "Project References", - id: "7project-references", - permalink: "/docs/handbook/project-references.html", - oneline: "How to split up a large TypeScript project", - }, - { - title: "Integrating with Build Tools", - id: "7integrating-with-build-tools", - permalink: "/docs/handbook/integrating-with-build-tools.html", - oneline: "How to use TypeScript with other build tools", - }, - { - title: "Mengkonfigurasi Watch", - id: "7mengkonfigurasi-watch", - permalink: "/id/docs/handbook/configuring-watch.html", - oneline: "Cara mengkonfigurasi mode watch TypeScript", - }, - { - title: "Nightly Builds", - id: "7nightly-builds", - permalink: "/id/docs/handbook/nightly-builds.html", - oneline: "Cara menggunakan nightly build TypeScript", - }, - ], - }, - { - title: "Handbook v2: Beta", - oneline: "The new handbook which is a work in progress.", - id: "handbook-v2:-beta", - chronological: true, - - items: [ - { - title: "The Basics", - id: "8the-basics", - permalink: "/docs/handbook/2/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Everyday Types", - id: "8everyday-types", - permalink: "/docs/handbook/2/everyday-types.html", - oneline: "The language primitives.", - }, - { - title: "Narrowing", - id: "8narrowing", - permalink: "/docs/handbook/2/narrowing.html", - oneline: - "Understand how TypeScript uses JavaScript knowledge to reduce the amount of type syntax in your projects.", - }, - { - title: "More on Functions", - id: "8more-on-functions", - permalink: "/docs/handbook/2/functions.html", - oneline: "Learn about how Functions work in TypeScript.", - }, - { - title: "Object Types", - id: "8object-types", - permalink: "/docs/handbook/2/objects.html", - oneline: "How TypeScript describes the shapes of JavaScript objects.", - }, - { - title: "Type Manipulation", - id: "8type-manipulation", - oneline: "undefined", - - items: [ - { - title: "Creating Types from Types", - id: "8creating-types-from-types", - permalink: "/docs/handbook/2/types-from-types.html", - oneline: "Step one in learning TypeScript: The basics types.", - }, - { - title: "Generics", - id: "8generics", - permalink: "/docs/handbook/2/generics.html", - oneline: "Types which take parameters", - }, - { - title: "Keyof Type Operator", - id: "8keyof-type-operator", - permalink: "/docs/handbook/2/keyof-types.html", - oneline: "Using the keyof operator in type contexts.", - }, - { - title: "Typeof Type Operator", - id: "8typeof-type-operator", - permalink: "/docs/handbook/2/typeof-types.html", - oneline: "Using the typeof operator in type contexts.", - }, - { - title: "Indexed Access Types", - id: "8indexed-access-types", - permalink: "/docs/handbook/2/indexed-access-types.html", - oneline: "Using Type['a'] syntax to access a subset of a type.", - }, - { - title: "Conditional Types", - id: "8conditional-types", - permalink: "/docs/handbook/2/conditional-types.html", - oneline: - "Create types which act like if statements in the type system.", - }, - { - title: "Mapped Types", - id: "8mapped-types", - permalink: "/docs/handbook/2/mapped-types.html", - oneline: "Generating types by re-using an existing type.", - }, - { - title: "Template Literal Types", - id: "8template-literal-types", - permalink: "/docs/handbook/2/template-literal-types.html", - oneline: - "Generating mapping types which change properties via template literal strings.", - }, - ], - }, - { - title: "Classes", - id: "8classes", - permalink: "/docs/handbook/2/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Modules", - id: "8modules", - permalink: "/docs/handbook/2/modules.html", - oneline: "Learn how TypeScript handles different module styles.", - }, - ], - }, - ] - navigations.ja = [ - { - title: "Get Started", - oneline: "Quick introductions based on your background or preference.", - id: "get-started", - chronological: false, - - items: [ - { - title: "TS for the New Programmer", - id: "0typescript-for-the-new-programmer", - permalink: "/docs/handbook/typescript-from-scratch.html", - oneline: "Learn TypeScript from scratch", - }, - { - title: "TypeScript for JS Programmers", - id: "0typescript-for-javascript-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes.html", - oneline: "Learn how TypeScript extends JavaScript", - }, - { - title: "TS for Java/C# Programmers", - id: "0typescript-for-java/c#-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-oop.html", - oneline: - "Learn TypeScript if you have a background in object-oriented languages", - }, - { - title: "TS for Functional Programmers", - id: "0typescript-for-functional-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-func.html", - oneline: - "Learn TypeScript if you have a background in functional programming", - }, - { - title: "TypeScript Tooling in 5 minutes", - id: "0typescript-tooling-in-5-minutes", - permalink: "/docs/handbook/typescript-tooling-in-5-minutes.html", - oneline: - "A tutorial to understand how to create a small website with TypeScript", - }, - ], - }, - { - title: "Handbook", - oneline: "A good first read for your daily TS work.", - id: "handbook", - chronological: true, - - items: [ - { - title: "The TypeScript Handbook", - id: "1the-typescript-handbook", - permalink: "/docs/handbook/intro.html", - oneline: "Your first step to learn TypeScript", - }, - { - title: "Basic Types", - id: "1basic-types", - permalink: "/docs/handbook/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Interfaces", - id: "1interfaces", - permalink: "/docs/handbook/interfaces.html", - oneline: "How to write an interface with TypeScript", - }, - { - title: "Functions", - id: "1functions", - permalink: "/docs/handbook/functions.html", - oneline: "How to add types to a function", - }, - { - title: "Literal Types", - id: "1literal-types", - permalink: "/docs/handbook/literal-types.html", - oneline: "Using literal types with TypeScript", - }, - { - title: "Unions and Intersection Types", - id: "1unions-and-intersection-types", - permalink: "/docs/handbook/unions-and-intersections.html", - oneline: "How to use unions and intersection types in TypeScript", - }, - { - title: "Classes", - id: "1classes", - permalink: "/docs/handbook/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Enums", - id: "1enums", - permalink: "/docs/handbook/enums.html", - oneline: "How TypeScript enums work", - }, - { - title: "Generics", - id: "1generics", - permalink: "/docs/handbook/generics.html", - oneline: "Introduction to TypeScript and Generics", - }, - ], - }, - { - title: "Handbook Reference", - oneline: "Deep dive reference materials.", - id: "handbook-reference", - chronological: false, - - items: [ - { - title: "Advanced Types", - id: "2advanced-types", - permalink: "/docs/handbook/advanced-types.html", - oneline: "Advanced concepts around types in TypeScript", - }, - { - title: "Utility Types", - id: "2utility-types", - permalink: "/docs/handbook/utility-types.html", - oneline: "Types which are globally included in TypeScript", - }, - { - title: "Decorators", - id: "2decorators", - permalink: "/docs/handbook/decorators.html", - oneline: "TypeScript Decorators overview", - }, - { - title: "Declaration Merging", - id: "2declaration-merging", - permalink: "/docs/handbook/declaration-merging.html", - oneline: "How merging namespaces and interfaces works", - }, - { - title: "Iterators and Generators", - id: "2iterators-and-generators", - permalink: "/docs/handbook/iterators-and-generators.html", - oneline: "How Iterators and Generators work in TypeScript", - }, - { - title: "JSX", - id: "2jsx", - permalink: "/docs/handbook/jsx.html", - oneline: "Using JSX with TypeScript", - }, - { - title: "Mixins", - id: "2mixins", - permalink: "/docs/handbook/mixins.html", - oneline: "Using the mixin pattern with TypeScript", - }, - { - title: "Modules", - id: "2modules", - permalink: "/docs/handbook/modules.html", - oneline: "How modules work in TypeScript", - }, - { - title: "Module Resolution", - id: "2module-resolution", - permalink: "/docs/handbook/module-resolution.html", - oneline: "How TypeScript resolves modules in JavaScript", - }, - { - title: "Namespaces", - id: "2namespaces", - permalink: "/docs/handbook/namespaces.html", - oneline: "How TypeScript namespaces work", - }, - { - title: "Namespaces and Modules", - id: "2namespaces-and-modules", - permalink: "/docs/handbook/namespaces-and-modules.html", - oneline: - "How to organize code in TypeScript via modules or namespaces", - }, - { - title: "Symbols", - id: "2symbols", - permalink: "/docs/handbook/symbols.html", - oneline: "Using the JavaScript Symbol primitive in TypeScript", - }, - { - title: "Triple-Slash Directives", - id: "2triple-slash-directives", - permalink: "/docs/handbook/triple-slash-directives.html", - oneline: "How to use triple slash directives in TypeScript", - }, - { - title: "Type Compatibility", - id: "2type-compatibility", - permalink: "/docs/handbook/type-compatibility.html", - oneline: "How type-checking works in TypeScript", - }, - { - title: "Type Inference", - id: "2type-inference", - permalink: "/docs/handbook/type-inference.html", - oneline: "How code flow analysis works in TypeScript", - }, - { - title: "Variable Declaration", - id: "2variable-declaration", - permalink: "/docs/handbook/variable-declarations.html", - oneline: "How TypeScript handles variable declaration", - }, - ], - }, - { - title: "Tutorials", - oneline: "Using TypeScript in several environments.", - id: "tutorials", - chronological: false, - - items: [ - { - title: "ASP.NET Core", - id: "3asp.net-core", - permalink: "/docs/handbook/asp-net-core.html", - oneline: "Using TypeScript in ASP.NET Core", - }, - { - title: "Gulp", - id: "3gulp", - permalink: "/docs/handbook/gulp.html", - oneline: "Using TypeScript with Gulp", - }, - { - title: "DOM Manipulation", - id: "3dom-manipulation", - permalink: "/docs/handbook/dom-manipulation.html", - oneline: "Using the DOM with TypeScript", - }, - { - title: "Migrating from JavaScript", - id: "3migrating-from-javascript", - permalink: "/docs/handbook/migrating-from-javascript.html", - oneline: "How to migrate from JavaScript to TypeScript", - }, - { - title: "Using Babel with TypeScript", - id: "3using-babel-with-typescript", - permalink: "/docs/handbook/babel-with-typescript.html", - oneline: "How to create a hybrid Babel + TypeScript project", - }, - ], - }, - { - title: "What's New", - oneline: - "Find out how TypeScript has evolved and what's new in the releases.", - id: "what's-new", - chronological: false, - - items: [ - { - title: "Overview", - id: "4overview", - permalink: "/docs/handbook/release-notes/overview.html", - oneline: "All TypeScript release notes", - }, - { - title: "TypeScript 4.1", - id: "4typescript-4.1", - permalink: "/docs/handbook/release-notes/typescript-4-1.html", - oneline: "TypeScript 4.1 Release Notes", - }, - { - title: "TypeScript 4.0", - id: "4typescript-4.0", - permalink: "/docs/handbook/release-notes/typescript-4-0.html", - oneline: "TypeScript 4.0 Release Notes", - }, - { - title: "TypeScript 3.9", - id: "4typescript-3.9", - permalink: "/docs/handbook/release-notes/typescript-3-9.html", - oneline: "TypeScript 3.9 Release Notes", - }, - { - title: "TypeScript 3.8", - id: "4typescript-3.8", - permalink: "/docs/handbook/release-notes/typescript-3-8.html", - oneline: "TypeScript 3.8 Release Notes", - }, - { - title: "TypeScript 3.7", - id: "4typescript-3.7", - permalink: "/docs/handbook/release-notes/typescript-3-7.html", - oneline: "TypeScript 3.7 Release Notes", - }, - { - title: "TypeScript 3.6", - id: "4typescript-3.6", - permalink: "/docs/handbook/release-notes/typescript-3-6.html", - oneline: "TypeScript 3.6 Release Notes", - }, - { - title: "TypeScript 3.5", - id: "4typescript-3.5", - permalink: "/docs/handbook/release-notes/typescript-3-5.html", - oneline: "TypeScript 3.5 Release Notes", - }, - { - title: "TypeScript 3.4", - id: "4typescript-3.4", - permalink: "/docs/handbook/release-notes/typescript-3-4.html", - oneline: "TypeScript 3.4 Release Notes", - }, - { - title: "TypeScript 3.3", - id: "4typescript-3.3", - permalink: "/docs/handbook/release-notes/typescript-3-3.html", - oneline: "TypeScript 3.3 Release Notes", - }, - { - title: "TypeScript 3.2", - id: "4typescript-3.2", - permalink: "/docs/handbook/release-notes/typescript-3-2.html", - oneline: "TypeScript 3.2 Release Notes", - }, - { - title: "TypeScript 3.1", - id: "4typescript-3.1", - permalink: "/docs/handbook/release-notes/typescript-3-1.html", - oneline: "TypeScript 3.1 Release Notes", - }, - { - title: "TypeScript 3.0", - id: "4typescript-3.0", - permalink: "/docs/handbook/release-notes/typescript-3-0.html", - oneline: "TypeScript 3.0 Release Notes", - }, - { - title: "TypeScript 2.9", - id: "4typescript-2.9", - permalink: "/docs/handbook/release-notes/typescript-2-9.html", - oneline: "TypeScript 2.9 Release Notes", - }, - { - title: "TypeScript 2.8", - id: "4typescript-2.8", - permalink: "/docs/handbook/release-notes/typescript-2-8.html", - oneline: "TypeScript 2.8 Release Notes", - }, - { - title: "TypeScript 2.7", - id: "4typescript-2.7", - permalink: "/docs/handbook/release-notes/typescript-2-7.html", - oneline: "TypeScript 2.7 Release Notes", - }, - { - title: "TypeScript 2.6", - id: "4typescript-2.6", - permalink: "/docs/handbook/release-notes/typescript-2-6.html", - oneline: "TypeScript 2.6 Release Notes", - }, - { - title: "TypeScript 2.5", - id: "4typescript-2.5", - permalink: "/docs/handbook/release-notes/typescript-2-5.html", - oneline: "TypeScript 2.5 Release Notes", - }, - { - title: "TypeScript 2.4", - id: "4typescript-2.4", - permalink: "/docs/handbook/release-notes/typescript-2-4.html", - oneline: "TypeScript 2.4 Release Notes", - }, - { - title: "TypeScript 2.3", - id: "4typescript-2.3", - permalink: "/docs/handbook/release-notes/typescript-2-3.html", - oneline: "TypeScript 2.3 Release Notes", - }, - { - title: "TypeScript 2.2", - id: "4typescript-2.2", - permalink: "/docs/handbook/release-notes/typescript-2-2.html", - oneline: "TypeScript 2.2 Release Notes", - }, - { - title: "TypeScript 2.1", - id: "4typescript-2.1", - permalink: "/docs/handbook/release-notes/typescript-2-1.html", - oneline: "TypeScript 2.1 Release Notes", - }, - { - title: "TypeScript 2.0", - id: "4typescript-2.0", - permalink: "/docs/handbook/release-notes/typescript-2-0.html", - oneline: "TypeScript 2.0 Release Notes", - }, - { - title: "TypeScript 1.8", - id: "4typescript-1.8", - permalink: "/docs/handbook/release-notes/typescript-1-8.html", - oneline: "TypeScript 1.8 Release Notes", - }, - { - title: "TypeScript 1.7", - id: "4typescript-1.7", - permalink: "/docs/handbook/release-notes/typescript-1-7.html", - oneline: "TypeScript 1.7 Release Notes", - }, - { - title: "TypeScript 1.6", - id: "4typescript-1.6", - permalink: "/docs/handbook/release-notes/typescript-1-6.html", - oneline: "TypeScript 1.6 Release Notes", - }, - { - title: "TypeScript 1.5", - id: "4typescript-1.5", - permalink: "/docs/handbook/release-notes/typescript-1-5.html", - oneline: "TypeScript 1.5 Release Notes", - }, - { - title: "TypeScript 1.4", - id: "4typescript-1.4", - permalink: "/docs/handbook/release-notes/typescript-1-4.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.3", - id: "4typescript-1.3", - permalink: "/docs/handbook/release-notes/typescript-1-3.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.1", - id: "4typescript-1.1", - permalink: "/docs/handbook/release-notes/typescript-1-1.html", - oneline: "TypeScript 1.1 Release Notes", - }, - ], - }, - { - title: "Declaration Files", - oneline: - "Learn how to write declaration files to describe existing JavaScript. Important for DefinitelyTyped contributions.", - id: "declaration-files", - chronological: true, - - items: [ - { - title: "Introduction", - id: "5introduction", - permalink: "/docs/handbook/declaration-files/introduction.html", - oneline: - "How to write a high-quality TypeScript Declaration (d.ts) file", - }, - { - title: "Declaration Reference", - id: "5declaration-reference", - permalink: "/docs/handbook/declaration-files/by-example.html", - oneline: "How to create a d.ts file for a module", - }, - { - title: "Library Structures", - id: "5library-structures", - permalink: "/docs/handbook/declaration-files/library-structures.html", - oneline: "How to structure your d.ts files", - }, - { - title: ".d.ts Templates", - id: "5.d.ts-templates", - oneline: "undefined", - - items: [ - { - title: "Modules .d.ts", - id: "5modules-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/module-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Plugin", - id: "5module:-plugin", - permalink: - "/docs/handbook/declaration-files/templates/module-plugin-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Class", - id: "5module:-class", - permalink: - "/docs/handbook/declaration-files/templates/module-class-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Function", - id: "5module:-function", - permalink: - "/docs/handbook/declaration-files/templates/module-function-d-ts.html", - oneline: "undefined", - }, - { - title: "Global .d.ts", - id: "5global-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/global-d-ts.html", - oneline: "undefined", - }, - { - title: "Global: Modifying Module", - id: "5global:-modifying-module", - permalink: - "/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html", - oneline: "undefined", - }, - ], - }, - { - title: "Do's and Don'ts", - id: "5do's-and-don'ts", - permalink: "/docs/handbook/declaration-files/do-s-and-don-ts.html", - oneline: "Recommendations for writing d.ts files", - }, - { - title: "Deep Dive", - id: "5deep-dive", - permalink: "/docs/handbook/declaration-files/deep-dive.html", - oneline: "How do d.ts files work, a deep dive", - }, - { - title: "Publishing", - id: "5publishing", - permalink: "/docs/handbook/declaration-files/publishing.html", - oneline: "How to get your d.ts files to users", - }, - { - title: "Consumption", - id: "5consumption", - permalink: "/docs/handbook/declaration-files/consumption.html", - oneline: "How to download d.ts files for your project", - }, - ], - }, - { - title: "JavaScript", - oneline: "How to use TypeScript-powered JavaScript tooling.", - id: "javascript", - chronological: true, - - items: [ - { - title: "TypeScriptを活用したJSプロジェクト", - id: "6typescriptを活用したjsプロジェクト", - permalink: "/ja/docs/handbook/intro-to-js-ts.html", - oneline: - "TypeScriptを使ってJavaScriptファイルに型チェックを追加する方法", - }, - { - title: "JavaScriptファイルの型チェック", - id: "6javascriptファイルの型チェック", - permalink: "/ja/docs/handbook/type-checking-javascript-files.html", - oneline: - "TypeScriptを使ってJavaScriptファイルに型チェックを追加する方法", - }, - { - title: "JSDocリファレンス", - id: "6jsdocリファレンス", - permalink: "/ja/docs/handbook/jsdoc-supported-types.html", - oneline: - "TypeScriptを備えたJavaScriptはどのようなJSDocをサポートしているか", - }, - { - title: ".jsファイルから.d.tsファイルを生成する", - id: "6.jsファイルから.d.tsファイルを生成する", - permalink: "/ja/docs/handbook/declaration-files/dts-from-js.html", - oneline: "JavaScriptプロジェクトでd.tsファイルを生成する方法", - }, - ], - }, - { - title: "Project Configuration", - oneline: "Compiler configuration reference.", - id: "project-configuration", - chronological: false, - - items: [ - { - title: "What is a tsconfig.json", - id: "7what-is-a-tsconfig.json", - permalink: "/docs/handbook/tsconfig-json.html", - oneline: "Learn about how a TSConfig works", - }, - { - title: "Compiler Options in MSBuild", - id: "7compiler-options-in-msbuild", - permalink: "/docs/handbook/compiler-options-in-msbuild.html", - oneline: "Which compiler options are available in MSBuild projects.", - }, - { - title: "TSConfig Reference", - id: "7tsconfig-reference", - permalink: "/tsconfig", - oneline: "The page covering every TSConfig option", - }, - { - title: "tsc CLI Options", - id: "7tsc-cli-options", - permalink: "/docs/handbook/compiler-options.html", - oneline: - "A very high-level overview of the CLI compiler options for tsc", - }, - { - title: "Project References", - id: "7project-references", - permalink: "/docs/handbook/project-references.html", - oneline: "How to split up a large TypeScript project", - }, - { - title: "Integrating with Build Tools", - id: "7integrating-with-build-tools", - permalink: "/docs/handbook/integrating-with-build-tools.html", - oneline: "How to use TypeScript with other build tools", - }, - { - title: "Configuring Watch", - id: "7configuring-watch", - permalink: "/docs/handbook/configuring-watch.html", - oneline: "How to configure the watch mode of TypeScript", - }, - { - title: "ナイトリービルド", - id: "7ナイトリービルド", - permalink: "/ja/docs/handbook/nightly-builds.html", - oneline: "TypeScriptのナイトリービルドを使うには", - }, - ], - }, - { - title: "Handbook v2: Beta", - oneline: "The new handbook which is a work in progress.", - id: "handbook-v2:-beta", - chronological: true, - - items: [ - { - title: "The Basics", - id: "8the-basics", - permalink: "/docs/handbook/2/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Everyday Types", - id: "8everyday-types", - permalink: "/docs/handbook/2/everyday-types.html", - oneline: "The language primitives.", - }, - { - title: "Narrowing", - id: "8narrowing", - permalink: "/docs/handbook/2/narrowing.html", - oneline: - "Understand how TypeScript uses JavaScript knowledge to reduce the amount of type syntax in your projects.", - }, - { - title: "More on Functions", - id: "8more-on-functions", - permalink: "/docs/handbook/2/functions.html", - oneline: "Learn about how Functions work in TypeScript.", - }, - { - title: "Object Types", - id: "8object-types", - permalink: "/docs/handbook/2/objects.html", - oneline: "How TypeScript describes the shapes of JavaScript objects.", - }, - { - title: "Type Manipulation", - id: "8type-manipulation", - oneline: "undefined", - - items: [ - { - title: "Creating Types from Types", - id: "8creating-types-from-types", - permalink: "/docs/handbook/2/types-from-types.html", - oneline: "Step one in learning TypeScript: The basics types.", - }, - { - title: "Generics", - id: "8generics", - permalink: "/docs/handbook/2/generics.html", - oneline: "Types which take parameters", - }, - { - title: "Keyof Type Operator", - id: "8keyof-type-operator", - permalink: "/docs/handbook/2/keyof-types.html", - oneline: "Using the keyof operator in type contexts.", - }, - { - title: "Typeof Type Operator", - id: "8typeof-type-operator", - permalink: "/docs/handbook/2/typeof-types.html", - oneline: "Using the typeof operator in type contexts.", - }, - { - title: "Indexed Access Types", - id: "8indexed-access-types", - permalink: "/docs/handbook/2/indexed-access-types.html", - oneline: "Using Type['a'] syntax to access a subset of a type.", - }, - { - title: "Conditional Types", - id: "8conditional-types", - permalink: "/docs/handbook/2/conditional-types.html", - oneline: - "Create types which act like if statements in the type system.", - }, - { - title: "Mapped Types", - id: "8mapped-types", - permalink: "/docs/handbook/2/mapped-types.html", - oneline: "Generating types by re-using an existing type.", - }, - { - title: "Template Literal Types", - id: "8template-literal-types", - permalink: "/docs/handbook/2/template-literal-types.html", - oneline: - "Generating mapping types which change properties via template literal strings.", - }, - ], - }, - { - title: "Classes", - id: "8classes", - permalink: "/docs/handbook/2/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Modules", - id: "8modules", - permalink: "/docs/handbook/2/modules.html", - oneline: "Learn how TypeScript handles different module styles.", - }, - ], - }, - ] - navigations.ko = [ - { - title: "Get Started", - oneline: "Quick introductions based on your background or preference.", - id: "get-started", - chronological: false, - - items: [ - { - title: "TS for the New Programmer", - id: "0typescript-for-the-new-programmer", - permalink: "/docs/handbook/typescript-from-scratch.html", - oneline: "Learn TypeScript from scratch", - }, - { - title: "TypeScript for JS Programmers", - id: "0typescript-for-javascript-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes.html", - oneline: "Learn how TypeScript extends JavaScript", - }, - { - title: "TS for Java/C# Programmers", - id: "0typescript-for-java/c#-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-oop.html", - oneline: - "Learn TypeScript if you have a background in object-oriented languages", - }, - { - title: "TS for Functional Programmers", - id: "0typescript-for-functional-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-func.html", - oneline: - "Learn TypeScript if you have a background in functional programming", - }, - { - title: "TypeScript Tooling in 5 minutes", - id: "0typescript-tooling-in-5-minutes", - permalink: "/ko/docs/handbook/typescript-tooling-in-5-minutes.html", - oneline: - "A tutorial to understand how to create a small website with TypeScript", - }, - ], - }, - { - title: "Handbook", - oneline: "A good first read for your daily TS work.", - id: "handbook", - chronological: true, - - items: [ - { - title: "The TypeScript Handbook", - id: "1the-typescript-handbook", - permalink: "/docs/handbook/intro.html", - oneline: "Your first step to learn TypeScript", - }, - { - title: "Basic Types", - id: "1basic-types", - permalink: "/docs/handbook/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Interfaces", - id: "1interfaces", - permalink: "/docs/handbook/interfaces.html", - oneline: "How to write an interface with TypeScript", - }, - { - title: "Functions", - id: "1functions", - permalink: "/docs/handbook/functions.html", - oneline: "How to add types to a function", - }, - { - title: "Literal Types", - id: "1literal-types", - permalink: "/docs/handbook/literal-types.html", - oneline: "Using literal types with TypeScript", - }, - { - title: "Unions and Intersection Types", - id: "1unions-and-intersection-types", - permalink: "/docs/handbook/unions-and-intersections.html", - oneline: "How to use unions and intersection types in TypeScript", - }, - { - title: "Classes", - id: "1classes", - permalink: "/docs/handbook/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Enums", - id: "1enums", - permalink: "/docs/handbook/enums.html", - oneline: "How TypeScript enums work", - }, - { - title: "Generics", - id: "1generics", - permalink: "/docs/handbook/generics.html", - oneline: "Introduction to TypeScript and Generics", - }, - ], - }, - { - title: "Handbook Reference", - oneline: "Deep dive reference materials.", - id: "handbook-reference", - chronological: false, - - items: [ - { - title: "Advanced Types", - id: "2advanced-types", - permalink: "/docs/handbook/advanced-types.html", - oneline: "Advanced concepts around types in TypeScript", - }, - { - title: "Utility Types", - id: "2utility-types", - permalink: "/ko/docs/handbook/utility-types.html", - oneline: "Types which are globally included in TypeScript", - }, - { - title: "Decorators", - id: "2decorators", - permalink: "/docs/handbook/decorators.html", - oneline: "TypeScript Decorators overview", - }, - { - title: "Declaration Merging", - id: "2declaration-merging", - permalink: "/ko/docs/handbook/declaration-merging.html", - oneline: "How merging namespaces and interfaces works", - }, - { - title: "Iterators and Generators", - id: "2iterators-and-generators", - permalink: "/ko/docs/handbook/iterators-and-generators.html", - oneline: "How Iterators and Generators work in TypeScript", - }, - { - title: "JSX", - id: "2jsx", - permalink: "/ko/docs/handbook/jsx.html", - oneline: "Using JSX with TypeScript", - }, - { - title: "Mixins", - id: "2mixins", - permalink: "/docs/handbook/mixins.html", - oneline: "Using the mixin pattern with TypeScript", - }, - { - title: "Modules", - id: "2modules", - permalink: "/docs/handbook/modules.html", - oneline: "How modules work in TypeScript", - }, - { - title: "Module Resolution", - id: "2module-resolution", - permalink: "/docs/handbook/module-resolution.html", - oneline: "How TypeScript resolves modules in JavaScript", - }, - { - title: "Namespaces", - id: "2namespaces", - permalink: "/docs/handbook/namespaces.html", - oneline: "How TypeScript namespaces work", - }, - { - title: "Namespaces and Modules", - id: "2namespaces-and-modules", - permalink: "/docs/handbook/namespaces-and-modules.html", - oneline: - "How to organize code in TypeScript via modules or namespaces", - }, - { - title: "Symbols", - id: "2symbols", - permalink: "/ko/docs/handbook/symbols.html", - oneline: "Using the JavaScript Symbol primitive in TypeScript", - }, - { - title: "Triple-Slash Directives", - id: "2triple-slash-directives", - permalink: "/ko/docs/handbook/triple-slash-directives.html", - oneline: "How to use triple slash directives in TypeScript", - }, - { - title: "Type Compatibility", - id: "2type-compatibility", - permalink: "/docs/handbook/type-compatibility.html", - oneline: "How type-checking works in TypeScript", - }, - { - title: "Type Inference", - id: "2type-inference", - permalink: "/ko/docs/handbook/type-inference.html", - oneline: "How code flow analysis works in TypeScript", - }, - { - title: "Variable Declaration", - id: "2variable-declaration", - permalink: "/docs/handbook/variable-declarations.html", - oneline: "How TypeScript handles variable declaration", - }, - ], - }, - { - title: "Tutorials", - oneline: "Using TypeScript in several environments.", - id: "tutorials", - chronological: false, - - items: [ - { - title: "ASP.NET Core", - id: "3asp.net-core", - permalink: "/docs/handbook/asp-net-core.html", - oneline: "Using TypeScript in ASP.NET Core", - }, - { - title: "Gulp", - id: "3gulp", - permalink: "/docs/handbook/gulp.html", - oneline: "Using TypeScript with Gulp", - }, - { - title: "DOM Manipulation", - id: "3dom-manipulation", - permalink: "/docs/handbook/dom-manipulation.html", - oneline: "Using the DOM with TypeScript", - }, - { - title: "Migrating from JavaScript", - id: "3migrating-from-javascript", - permalink: "/docs/handbook/migrating-from-javascript.html", - oneline: "How to migrate from JavaScript to TypeScript", - }, - { - title: "Using Babel with TypeScript", - id: "3using-babel-with-typescript", - permalink: "/ko/docs/handbook/babel-with-typescript.html", - oneline: "How to create a hybrid Babel + TypeScript project", - }, - ], - }, - { - title: "What's New", - oneline: - "Find out how TypeScript has evolved and what's new in the releases.", - id: "what's-new", - chronological: false, - - items: [ - { - title: "Overview", - id: "4overview", - permalink: "/docs/handbook/release-notes/overview.html", - oneline: "All TypeScript release notes", - }, - { - title: "TypeScript 4.1", - id: "4typescript-4.1", - permalink: "/docs/handbook/release-notes/typescript-4-1.html", - oneline: "TypeScript 4.1 Release Notes", - }, - { - title: "TypeScript 4.0", - id: "4typescript-4.0", - permalink: "/docs/handbook/release-notes/typescript-4-0.html", - oneline: "TypeScript 4.0 Release Notes", - }, - { - title: "TypeScript 3.9", - id: "4typescript-3.9", - permalink: "/docs/handbook/release-notes/typescript-3-9.html", - oneline: "TypeScript 3.9 Release Notes", - }, - { - title: "TypeScript 3.8", - id: "4typescript-3.8", - permalink: "/docs/handbook/release-notes/typescript-3-8.html", - oneline: "TypeScript 3.8 Release Notes", - }, - { - title: "TypeScript 3.7", - id: "4typescript-3.7", - permalink: "/docs/handbook/release-notes/typescript-3-7.html", - oneline: "TypeScript 3.7 Release Notes", - }, - { - title: "TypeScript 3.6", - id: "4typescript-3.6", - permalink: "/docs/handbook/release-notes/typescript-3-6.html", - oneline: "TypeScript 3.6 Release Notes", - }, - { - title: "TypeScript 3.5", - id: "4typescript-3.5", - permalink: "/docs/handbook/release-notes/typescript-3-5.html", - oneline: "TypeScript 3.5 Release Notes", - }, - { - title: "TypeScript 3.4", - id: "4typescript-3.4", - permalink: "/docs/handbook/release-notes/typescript-3-4.html", - oneline: "TypeScript 3.4 Release Notes", - }, - { - title: "TypeScript 3.3", - id: "4typescript-3.3", - permalink: "/docs/handbook/release-notes/typescript-3-3.html", - oneline: "TypeScript 3.3 Release Notes", - }, - { - title: "TypeScript 3.2", - id: "4typescript-3.2", - permalink: "/docs/handbook/release-notes/typescript-3-2.html", - oneline: "TypeScript 3.2 Release Notes", - }, - { - title: "TypeScript 3.1", - id: "4typescript-3.1", - permalink: "/docs/handbook/release-notes/typescript-3-1.html", - oneline: "TypeScript 3.1 Release Notes", - }, - { - title: "TypeScript 3.0", - id: "4typescript-3.0", - permalink: "/docs/handbook/release-notes/typescript-3-0.html", - oneline: "TypeScript 3.0 Release Notes", - }, - { - title: "TypeScript 2.9", - id: "4typescript-2.9", - permalink: "/docs/handbook/release-notes/typescript-2-9.html", - oneline: "TypeScript 2.9 Release Notes", - }, - { - title: "TypeScript 2.8", - id: "4typescript-2.8", - permalink: "/docs/handbook/release-notes/typescript-2-8.html", - oneline: "TypeScript 2.8 Release Notes", - }, - { - title: "TypeScript 2.7", - id: "4typescript-2.7", - permalink: "/docs/handbook/release-notes/typescript-2-7.html", - oneline: "TypeScript 2.7 Release Notes", - }, - { - title: "TypeScript 2.6", - id: "4typescript-2.6", - permalink: "/docs/handbook/release-notes/typescript-2-6.html", - oneline: "TypeScript 2.6 Release Notes", - }, - { - title: "TypeScript 2.5", - id: "4typescript-2.5", - permalink: "/docs/handbook/release-notes/typescript-2-5.html", - oneline: "TypeScript 2.5 Release Notes", - }, - { - title: "TypeScript 2.4", - id: "4typescript-2.4", - permalink: "/docs/handbook/release-notes/typescript-2-4.html", - oneline: "TypeScript 2.4 Release Notes", - }, - { - title: "TypeScript 2.3", - id: "4typescript-2.3", - permalink: "/docs/handbook/release-notes/typescript-2-3.html", - oneline: "TypeScript 2.3 Release Notes", - }, - { - title: "TypeScript 2.2", - id: "4typescript-2.2", - permalink: "/docs/handbook/release-notes/typescript-2-2.html", - oneline: "TypeScript 2.2 Release Notes", - }, - { - title: "TypeScript 2.1", - id: "4typescript-2.1", - permalink: "/docs/handbook/release-notes/typescript-2-1.html", - oneline: "TypeScript 2.1 Release Notes", - }, - { - title: "TypeScript 2.0", - id: "4typescript-2.0", - permalink: "/docs/handbook/release-notes/typescript-2-0.html", - oneline: "TypeScript 2.0 Release Notes", - }, - { - title: "TypeScript 1.8", - id: "4typescript-1.8", - permalink: "/docs/handbook/release-notes/typescript-1-8.html", - oneline: "TypeScript 1.8 Release Notes", - }, - { - title: "TypeScript 1.7", - id: "4typescript-1.7", - permalink: "/docs/handbook/release-notes/typescript-1-7.html", - oneline: "TypeScript 1.7 Release Notes", - }, - { - title: "TypeScript 1.6", - id: "4typescript-1.6", - permalink: "/docs/handbook/release-notes/typescript-1-6.html", - oneline: "TypeScript 1.6 Release Notes", - }, - { - title: "TypeScript 1.5", - id: "4typescript-1.5", - permalink: "/docs/handbook/release-notes/typescript-1-5.html", - oneline: "TypeScript 1.5 Release Notes", - }, - { - title: "TypeScript 1.4", - id: "4typescript-1.4", - permalink: "/docs/handbook/release-notes/typescript-1-4.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.3", - id: "4typescript-1.3", - permalink: "/docs/handbook/release-notes/typescript-1-3.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.1", - id: "4typescript-1.1", - permalink: "/docs/handbook/release-notes/typescript-1-1.html", - oneline: "TypeScript 1.1 Release Notes", - }, - ], - }, - { - title: "Declaration Files", - oneline: - "Learn how to write declaration files to describe existing JavaScript. Important for DefinitelyTyped contributions.", - id: "declaration-files", - chronological: true, - - items: [ - { - title: "Introduction", - id: "5introduction", - permalink: "/docs/handbook/declaration-files/introduction.html", - oneline: - "How to write a high-quality TypeScript Declaration (d.ts) file", - }, - { - title: "Declaration Reference", - id: "5declaration-reference", - permalink: "/docs/handbook/declaration-files/by-example.html", - oneline: "How to create a d.ts file for a module", - }, - { - title: "Library Structures", - id: "5library-structures", - permalink: "/docs/handbook/declaration-files/library-structures.html", - oneline: "How to structure your d.ts files", - }, - { - title: ".d.ts Templates", - id: "5.d.ts-templates", - oneline: "undefined", - - items: [ - { - title: "Modules .d.ts", - id: "5modules-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/module-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Plugin", - id: "5module:-plugin", - permalink: - "/docs/handbook/declaration-files/templates/module-plugin-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Class", - id: "5module:-class", - permalink: - "/docs/handbook/declaration-files/templates/module-class-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Function", - id: "5module:-function", - permalink: - "/docs/handbook/declaration-files/templates/module-function-d-ts.html", - oneline: "undefined", - }, - { - title: "Global .d.ts", - id: "5global-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/global-d-ts.html", - oneline: "undefined", - }, - { - title: "Global: Modifying Module", - id: "5global:-modifying-module", - permalink: - "/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html", - oneline: "undefined", - }, - ], - }, - { - title: "Do's and Don'ts", - id: "5do's-and-don'ts", - permalink: "/docs/handbook/declaration-files/do-s-and-don-ts.html", - oneline: "Recommendations for writing d.ts files", - }, - { - title: "Deep Dive", - id: "5deep-dive", - permalink: "/docs/handbook/declaration-files/deep-dive.html", - oneline: "How do d.ts files work, a deep dive", - }, - { - title: "Publishing", - id: "5publishing", - permalink: "/docs/handbook/declaration-files/publishing.html", - oneline: "How to get your d.ts files to users", - }, - { - title: "Consumption", - id: "5consumption", - permalink: "/docs/handbook/declaration-files/consumption.html", - oneline: "How to download d.ts files for your project", - }, - ], - }, - { - title: "JavaScript", - oneline: "How to use TypeScript-powered JavaScript tooling.", - id: "javascript", - chronological: true, - - items: [ - { - title: "JS Projects Utilizing TypeScript", - id: "6js-projects-utilizing-typescript", - permalink: "/docs/handbook/intro-to-js-ts.html", - oneline: - "How to add type checking to JavaScript files using TypeScript", - }, - { - title: "Type Checking JavaScript Files", - id: "6type-checking-javascript-files", - permalink: "/docs/handbook/type-checking-javascript-files.html", - oneline: - "How to add type checking to JavaScript files using TypeScript", - }, - { - title: "JSDoc Reference", - id: "6jsdoc-reference", - permalink: "/docs/handbook/jsdoc-supported-types.html", - oneline: "What JSDoc does TypeScript-powered JavaScript support?", - }, - { - title: "Creating .d.ts Files from .js files", - id: "6creating-.d.ts-files-from-.js-files", - permalink: "/docs/handbook/declaration-files/dts-from-js.html", - oneline: "How to add d.ts generation to JavaScript projects", - }, - ], - }, - { - title: "Project Configuration", - oneline: "Compiler configuration reference.", - id: "project-configuration", - chronological: false, - - items: [ - { - title: "What is a tsconfig.json", - id: "7what-is-a-tsconfig.json", - permalink: "/docs/handbook/tsconfig-json.html", - oneline: "Learn about how a TSConfig works", - }, - { - title: "Compiler Options in MSBuild", - id: "7compiler-options-in-msbuild", - permalink: "/docs/handbook/compiler-options-in-msbuild.html", - oneline: "Which compiler options are available in MSBuild projects.", - }, - { - title: "TSConfig Reference", - id: "7tsconfig-reference", - permalink: "/tsconfig", - oneline: "The page covering every TSConfig option", - }, - { - title: "tsc CLI Options", - id: "7tsc-cli-options", - permalink: "/docs/handbook/compiler-options.html", - oneline: - "A very high-level overview of the CLI compiler options for tsc", - }, - { - title: "Project References", - id: "7project-references", - permalink: "/docs/handbook/project-references.html", - oneline: "How to split up a large TypeScript project", - }, - { - title: "Integrating with Build Tools", - id: "7integrating-with-build-tools", - permalink: "/docs/handbook/integrating-with-build-tools.html", - oneline: "How to use TypeScript with other build tools", - }, - { - title: "Configuring Watch", - id: "7configuring-watch", - permalink: "/docs/handbook/configuring-watch.html", - oneline: "How to configure the watch mode of TypeScript", - }, - { - title: "Nightly Builds", - id: "7nightly-builds", - permalink: "/docs/handbook/nightly-builds.html", - oneline: "How to use a nightly build of TypeScript", - }, - ], - }, - { - title: "Handbook v2: Beta", - oneline: "The new handbook which is a work in progress.", - id: "handbook-v2:-beta", - chronological: true, - - items: [ - { - title: "The Basics", - id: "8the-basics", - permalink: "/docs/handbook/2/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Everyday Types", - id: "8everyday-types", - permalink: "/docs/handbook/2/everyday-types.html", - oneline: "The language primitives.", - }, - { - title: "Narrowing", - id: "8narrowing", - permalink: "/docs/handbook/2/narrowing.html", - oneline: - "Understand how TypeScript uses JavaScript knowledge to reduce the amount of type syntax in your projects.", - }, - { - title: "More on Functions", - id: "8more-on-functions", - permalink: "/docs/handbook/2/functions.html", - oneline: "Learn about how Functions work in TypeScript.", - }, - { - title: "Object Types", - id: "8object-types", - permalink: "/docs/handbook/2/objects.html", - oneline: "How TypeScript describes the shapes of JavaScript objects.", - }, - { - title: "Type Manipulation", - id: "8type-manipulation", - oneline: "undefined", - - items: [ - { - title: "Creating Types from Types", - id: "8creating-types-from-types", - permalink: "/docs/handbook/2/types-from-types.html", - oneline: "Step one in learning TypeScript: The basics types.", - }, - { - title: "Generics", - id: "8generics", - permalink: "/docs/handbook/2/generics.html", - oneline: "Types which take parameters", - }, - { - title: "Keyof Type Operator", - id: "8keyof-type-operator", - permalink: "/docs/handbook/2/keyof-types.html", - oneline: "Using the keyof operator in type contexts.", - }, - { - title: "Typeof Type Operator", - id: "8typeof-type-operator", - permalink: "/docs/handbook/2/typeof-types.html", - oneline: "Using the typeof operator in type contexts.", - }, - { - title: "Indexed Access Types", - id: "8indexed-access-types", - permalink: "/docs/handbook/2/indexed-access-types.html", - oneline: "Using Type['a'] syntax to access a subset of a type.", - }, - { - title: "Conditional Types", - id: "8conditional-types", - permalink: "/docs/handbook/2/conditional-types.html", - oneline: - "Create types which act like if statements in the type system.", - }, - { - title: "Mapped Types", - id: "8mapped-types", - permalink: "/docs/handbook/2/mapped-types.html", - oneline: "Generating types by re-using an existing type.", - }, - { - title: "Template Literal Types", - id: "8template-literal-types", - permalink: "/docs/handbook/2/template-literal-types.html", - oneline: - "Generating mapping types which change properties via template literal strings.", - }, - ], - }, - { - title: "Classes", - id: "8classes", - permalink: "/docs/handbook/2/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Modules", - id: "8modules", - permalink: "/docs/handbook/2/modules.html", - oneline: "Learn how TypeScript handles different module styles.", - }, - ], - }, - ] - navigations.pl = [ - { - title: "Get Started", - oneline: "Quick introductions based on your background or preference.", - id: "get-started", - chronological: false, - - items: [ - { - title: "TS for the New Programmer", - id: "0typescript-for-the-new-programmer", - permalink: "/docs/handbook/typescript-from-scratch.html", - oneline: "Learn TypeScript from scratch", - }, - { - title: "TypeScript for JS Programmers", - id: "0typescript-for-javascript-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes.html", - oneline: "Learn how TypeScript extends JavaScript", - }, - { - title: "TS for Java/C# Programmers", - id: "0typescript-for-java/c#-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-oop.html", - oneline: - "Learn TypeScript if you have a background in object-oriented languages", - }, - { - title: "TS for Functional Programmers", - id: "0typescript-for-functional-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-func.html", - oneline: - "Learn TypeScript if you have a background in functional programming", - }, - { - title: "TypeScript Tooling in 5 minutes", - id: "0typescript-tooling-in-5-minutes", - permalink: "/docs/handbook/typescript-tooling-in-5-minutes.html", - oneline: - "A tutorial to understand how to create a small website with TypeScript", - }, - ], - }, - { - title: "Handbook", - oneline: "A good first read for your daily TS work.", - id: "handbook", - chronological: true, - - items: [ - { - title: "Przewodnik po TypeScript", - id: "1przewodnik-po-typescript", - permalink: "/pl/docs/handbook/intro.html", - oneline: "Twoje pierwsze kroki w nauce TypeScript", - }, - { - title: "Basic Types", - id: "1basic-types", - permalink: "/docs/handbook/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Interfaces", - id: "1interfaces", - permalink: "/docs/handbook/interfaces.html", - oneline: "How to write an interface with TypeScript", - }, - { - title: "Functions", - id: "1functions", - permalink: "/docs/handbook/functions.html", - oneline: "How to add types to a function", - }, - { - title: "Literal Types", - id: "1literal-types", - permalink: "/docs/handbook/literal-types.html", - oneline: "Using literal types with TypeScript", - }, - { - title: "Unions and Intersection Types", - id: "1unions-and-intersection-types", - permalink: "/docs/handbook/unions-and-intersections.html", - oneline: "How to use unions and intersection types in TypeScript", - }, - { - title: "Classes", - id: "1classes", - permalink: "/docs/handbook/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Enums", - id: "1enums", - permalink: "/docs/handbook/enums.html", - oneline: "How TypeScript enums work", - }, - { - title: "Generics", - id: "1generics", - permalink: "/docs/handbook/generics.html", - oneline: "Introduction to TypeScript and Generics", - }, - ], - }, - { - title: "Handbook Reference", - oneline: "Deep dive reference materials.", - id: "handbook-reference", - chronological: false, - - items: [ - { - title: "Advanced Types", - id: "2advanced-types", - permalink: "/docs/handbook/advanced-types.html", - oneline: "Advanced concepts around types in TypeScript", - }, - { - title: "Utility Types", - id: "2utility-types", - permalink: "/docs/handbook/utility-types.html", - oneline: "Types which are globally included in TypeScript", - }, - { - title: "Decorators", - id: "2decorators", - permalink: "/docs/handbook/decorators.html", - oneline: "TypeScript Decorators overview", - }, - { - title: "Declaration Merging", - id: "2declaration-merging", - permalink: "/docs/handbook/declaration-merging.html", - oneline: "How merging namespaces and interfaces works", - }, - { - title: "Iterators and Generators", - id: "2iterators-and-generators", - permalink: "/docs/handbook/iterators-and-generators.html", - oneline: "How Iterators and Generators work in TypeScript", - }, - { - title: "JSX", - id: "2jsx", - permalink: "/docs/handbook/jsx.html", - oneline: "Using JSX with TypeScript", - }, - { - title: "Mixins", - id: "2mixins", - permalink: "/docs/handbook/mixins.html", - oneline: "Using the mixin pattern with TypeScript", - }, - { - title: "Modules", - id: "2modules", - permalink: "/docs/handbook/modules.html", - oneline: "How modules work in TypeScript", - }, - { - title: "Module Resolution", - id: "2module-resolution", - permalink: "/docs/handbook/module-resolution.html", - oneline: "How TypeScript resolves modules in JavaScript", - }, - { - title: "Namespaces", - id: "2namespaces", - permalink: "/docs/handbook/namespaces.html", - oneline: "How TypeScript namespaces work", - }, - { - title: "Namespaces and Modules", - id: "2namespaces-and-modules", - permalink: "/docs/handbook/namespaces-and-modules.html", - oneline: - "How to organize code in TypeScript via modules or namespaces", - }, - { - title: "Symbols", - id: "2symbols", - permalink: "/docs/handbook/symbols.html", - oneline: "Using the JavaScript Symbol primitive in TypeScript", - }, - { - title: "Triple-Slash Directives", - id: "2triple-slash-directives", - permalink: "/docs/handbook/triple-slash-directives.html", - oneline: "How to use triple slash directives in TypeScript", - }, - { - title: "Type Compatibility", - id: "2type-compatibility", - permalink: "/docs/handbook/type-compatibility.html", - oneline: "How type-checking works in TypeScript", - }, - { - title: "Type Inference", - id: "2type-inference", - permalink: "/docs/handbook/type-inference.html", - oneline: "How code flow analysis works in TypeScript", - }, - { - title: "Variable Declaration", - id: "2variable-declaration", - permalink: "/docs/handbook/variable-declarations.html", - oneline: "How TypeScript handles variable declaration", - }, - ], - }, - { - title: "Tutorials", - oneline: "Using TypeScript in several environments.", - id: "tutorials", - chronological: false, - - items: [ - { - title: "ASP.NET Core", - id: "3asp.net-core", - permalink: "/docs/handbook/asp-net-core.html", - oneline: "Using TypeScript in ASP.NET Core", - }, - { - title: "Gulp", - id: "3gulp", - permalink: "/docs/handbook/gulp.html", - oneline: "Using TypeScript with Gulp", - }, - { - title: "DOM Manipulation", - id: "3dom-manipulation", - permalink: "/docs/handbook/dom-manipulation.html", - oneline: "Using the DOM with TypeScript", - }, - { - title: "Migrating from JavaScript", - id: "3migrating-from-javascript", - permalink: "/docs/handbook/migrating-from-javascript.html", - oneline: "How to migrate from JavaScript to TypeScript", - }, - { - title: "Using Babel with TypeScript", - id: "3using-babel-with-typescript", - permalink: "/docs/handbook/babel-with-typescript.html", - oneline: "How to create a hybrid Babel + TypeScript project", - }, - ], - }, - { - title: "What's New", - oneline: - "Find out how TypeScript has evolved and what's new in the releases.", - id: "what's-new", - chronological: false, - - items: [ - { - title: "Overview", - id: "4overview", - permalink: "/docs/handbook/release-notes/overview.html", - oneline: "All TypeScript release notes", - }, - { - title: "TypeScript 4.1", - id: "4typescript-4.1", - permalink: "/docs/handbook/release-notes/typescript-4-1.html", - oneline: "TypeScript 4.1 Release Notes", - }, - { - title: "TypeScript 4.0", - id: "4typescript-4.0", - permalink: "/docs/handbook/release-notes/typescript-4-0.html", - oneline: "TypeScript 4.0 Release Notes", - }, - { - title: "TypeScript 3.9", - id: "4typescript-3.9", - permalink: "/docs/handbook/release-notes/typescript-3-9.html", - oneline: "TypeScript 3.9 Release Notes", - }, - { - title: "TypeScript 3.8", - id: "4typescript-3.8", - permalink: "/docs/handbook/release-notes/typescript-3-8.html", - oneline: "TypeScript 3.8 Release Notes", - }, - { - title: "TypeScript 3.7", - id: "4typescript-3.7", - permalink: "/docs/handbook/release-notes/typescript-3-7.html", - oneline: "TypeScript 3.7 Release Notes", - }, - { - title: "TypeScript 3.6", - id: "4typescript-3.6", - permalink: "/docs/handbook/release-notes/typescript-3-6.html", - oneline: "TypeScript 3.6 Release Notes", - }, - { - title: "TypeScript 3.5", - id: "4typescript-3.5", - permalink: "/docs/handbook/release-notes/typescript-3-5.html", - oneline: "TypeScript 3.5 Release Notes", - }, - { - title: "TypeScript 3.4", - id: "4typescript-3.4", - permalink: "/docs/handbook/release-notes/typescript-3-4.html", - oneline: "TypeScript 3.4 Release Notes", - }, - { - title: "TypeScript 3.3", - id: "4typescript-3.3", - permalink: "/docs/handbook/release-notes/typescript-3-3.html", - oneline: "TypeScript 3.3 Release Notes", - }, - { - title: "TypeScript 3.2", - id: "4typescript-3.2", - permalink: "/docs/handbook/release-notes/typescript-3-2.html", - oneline: "TypeScript 3.2 Release Notes", - }, - { - title: "TypeScript 3.1", - id: "4typescript-3.1", - permalink: "/docs/handbook/release-notes/typescript-3-1.html", - oneline: "TypeScript 3.1 Release Notes", - }, - { - title: "TypeScript 3.0", - id: "4typescript-3.0", - permalink: "/docs/handbook/release-notes/typescript-3-0.html", - oneline: "TypeScript 3.0 Release Notes", - }, - { - title: "TypeScript 2.9", - id: "4typescript-2.9", - permalink: "/docs/handbook/release-notes/typescript-2-9.html", - oneline: "TypeScript 2.9 Release Notes", - }, - { - title: "TypeScript 2.8", - id: "4typescript-2.8", - permalink: "/docs/handbook/release-notes/typescript-2-8.html", - oneline: "TypeScript 2.8 Release Notes", - }, - { - title: "TypeScript 2.7", - id: "4typescript-2.7", - permalink: "/docs/handbook/release-notes/typescript-2-7.html", - oneline: "TypeScript 2.7 Release Notes", - }, - { - title: "TypeScript 2.6", - id: "4typescript-2.6", - permalink: "/docs/handbook/release-notes/typescript-2-6.html", - oneline: "TypeScript 2.6 Release Notes", - }, - { - title: "TypeScript 2.5", - id: "4typescript-2.5", - permalink: "/docs/handbook/release-notes/typescript-2-5.html", - oneline: "TypeScript 2.5 Release Notes", - }, - { - title: "TypeScript 2.4", - id: "4typescript-2.4", - permalink: "/docs/handbook/release-notes/typescript-2-4.html", - oneline: "TypeScript 2.4 Release Notes", - }, - { - title: "TypeScript 2.3", - id: "4typescript-2.3", - permalink: "/docs/handbook/release-notes/typescript-2-3.html", - oneline: "TypeScript 2.3 Release Notes", - }, - { - title: "TypeScript 2.2", - id: "4typescript-2.2", - permalink: "/docs/handbook/release-notes/typescript-2-2.html", - oneline: "TypeScript 2.2 Release Notes", - }, - { - title: "TypeScript 2.1", - id: "4typescript-2.1", - permalink: "/docs/handbook/release-notes/typescript-2-1.html", - oneline: "TypeScript 2.1 Release Notes", - }, - { - title: "TypeScript 2.0", - id: "4typescript-2.0", - permalink: "/docs/handbook/release-notes/typescript-2-0.html", - oneline: "TypeScript 2.0 Release Notes", - }, - { - title: "TypeScript 1.8", - id: "4typescript-1.8", - permalink: "/docs/handbook/release-notes/typescript-1-8.html", - oneline: "TypeScript 1.8 Release Notes", - }, - { - title: "TypeScript 1.7", - id: "4typescript-1.7", - permalink: "/docs/handbook/release-notes/typescript-1-7.html", - oneline: "TypeScript 1.7 Release Notes", - }, - { - title: "TypeScript 1.6", - id: "4typescript-1.6", - permalink: "/docs/handbook/release-notes/typescript-1-6.html", - oneline: "TypeScript 1.6 Release Notes", - }, - { - title: "TypeScript 1.5", - id: "4typescript-1.5", - permalink: "/docs/handbook/release-notes/typescript-1-5.html", - oneline: "TypeScript 1.5 Release Notes", - }, - { - title: "TypeScript 1.4", - id: "4typescript-1.4", - permalink: "/docs/handbook/release-notes/typescript-1-4.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.3", - id: "4typescript-1.3", - permalink: "/docs/handbook/release-notes/typescript-1-3.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.1", - id: "4typescript-1.1", - permalink: "/docs/handbook/release-notes/typescript-1-1.html", - oneline: "TypeScript 1.1 Release Notes", - }, - ], - }, - { - title: "Declaration Files", - oneline: - "Learn how to write declaration files to describe existing JavaScript. Important for DefinitelyTyped contributions.", - id: "declaration-files", - chronological: true, - - items: [ - { - title: "Introduction", - id: "5introduction", - permalink: "/docs/handbook/declaration-files/introduction.html", - oneline: - "How to write a high-quality TypeScript Declaration (d.ts) file", - }, - { - title: "Declaration Reference", - id: "5declaration-reference", - permalink: "/docs/handbook/declaration-files/by-example.html", - oneline: "How to create a d.ts file for a module", - }, - { - title: "Library Structures", - id: "5library-structures", - permalink: "/docs/handbook/declaration-files/library-structures.html", - oneline: "How to structure your d.ts files", - }, - { - title: ".d.ts Templates", - id: "5.d.ts-templates", - oneline: "undefined", - - items: [ - { - title: "Modules .d.ts", - id: "5modules-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/module-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Plugin", - id: "5module:-plugin", - permalink: - "/docs/handbook/declaration-files/templates/module-plugin-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Class", - id: "5module:-class", - permalink: - "/docs/handbook/declaration-files/templates/module-class-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Function", - id: "5module:-function", - permalink: - "/docs/handbook/declaration-files/templates/module-function-d-ts.html", - oneline: "undefined", - }, - { - title: "Global .d.ts", - id: "5global-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/global-d-ts.html", - oneline: "undefined", - }, - { - title: "Global: Modifying Module", - id: "5global:-modifying-module", - permalink: - "/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html", - oneline: "undefined", - }, - ], - }, - { - title: "Do's and Don'ts", - id: "5do's-and-don'ts", - permalink: "/docs/handbook/declaration-files/do-s-and-don-ts.html", - oneline: "Recommendations for writing d.ts files", - }, - { - title: "Deep Dive", - id: "5deep-dive", - permalink: "/docs/handbook/declaration-files/deep-dive.html", - oneline: "How do d.ts files work, a deep dive", - }, - { - title: "Publishing", - id: "5publishing", - permalink: "/docs/handbook/declaration-files/publishing.html", - oneline: "How to get your d.ts files to users", - }, - { - title: "Consumption", - id: "5consumption", - permalink: "/docs/handbook/declaration-files/consumption.html", - oneline: "How to download d.ts files for your project", - }, - ], - }, - { - title: "JavaScript", - oneline: "How to use TypeScript-powered JavaScript tooling.", - id: "javascript", - chronological: true, - - items: [ - { - title: "JS Projects Utilizing TypeScript", - id: "6js-projects-utilizing-typescript", - permalink: "/docs/handbook/intro-to-js-ts.html", - oneline: - "How to add type checking to JavaScript files using TypeScript", - }, - { - title: "Type Checking JavaScript Files", - id: "6type-checking-javascript-files", - permalink: "/docs/handbook/type-checking-javascript-files.html", - oneline: - "How to add type checking to JavaScript files using TypeScript", - }, - { - title: "JSDoc Reference", - id: "6jsdoc-reference", - permalink: "/docs/handbook/jsdoc-supported-types.html", - oneline: "What JSDoc does TypeScript-powered JavaScript support?", - }, - { - title: "Creating .d.ts Files from .js files", - id: "6creating-.d.ts-files-from-.js-files", - permalink: "/docs/handbook/declaration-files/dts-from-js.html", - oneline: "How to add d.ts generation to JavaScript projects", - }, - ], - }, - { - title: "Project Configuration", - oneline: "Compiler configuration reference.", - id: "project-configuration", - chronological: false, - - items: [ - { - title: "What is a tsconfig.json", - id: "7what-is-a-tsconfig.json", - permalink: "/docs/handbook/tsconfig-json.html", - oneline: "Learn about how a TSConfig works", - }, - { - title: "Compiler Options in MSBuild", - id: "7compiler-options-in-msbuild", - permalink: "/docs/handbook/compiler-options-in-msbuild.html", - oneline: "Which compiler options are available in MSBuild projects.", - }, - { - title: "TSConfig Reference", - id: "7tsconfig-reference", - permalink: "/tsconfig", - oneline: "The page covering every TSConfig option", - }, - { - title: "tsc CLI Options", - id: "7tsc-cli-options", - permalink: "/docs/handbook/compiler-options.html", - oneline: - "A very high-level overview of the CLI compiler options for tsc", - }, - { - title: "Project References", - id: "7project-references", - permalink: "/docs/handbook/project-references.html", - oneline: "How to split up a large TypeScript project", - }, - { - title: "Integrating with Build Tools", - id: "7integrating-with-build-tools", - permalink: "/docs/handbook/integrating-with-build-tools.html", - oneline: "How to use TypeScript with other build tools", - }, - { - title: "Configuring Watch", - id: "7configuring-watch", - permalink: "/docs/handbook/configuring-watch.html", - oneline: "How to configure the watch mode of TypeScript", - }, - { - title: "Nightly Builds", - id: "7nightly-builds", - permalink: "/docs/handbook/nightly-builds.html", - oneline: "How to use a nightly build of TypeScript", - }, - ], - }, - { - title: "Handbook v2: Beta", - oneline: "The new handbook which is a work in progress.", - id: "handbook-v2:-beta", - chronological: true, - - items: [ - { - title: "The Basics", - id: "8the-basics", - permalink: "/docs/handbook/2/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Everyday Types", - id: "8everyday-types", - permalink: "/docs/handbook/2/everyday-types.html", - oneline: "The language primitives.", - }, - { - title: "Narrowing", - id: "8narrowing", - permalink: "/docs/handbook/2/narrowing.html", - oneline: - "Understand how TypeScript uses JavaScript knowledge to reduce the amount of type syntax in your projects.", - }, - { - title: "More on Functions", - id: "8more-on-functions", - permalink: "/docs/handbook/2/functions.html", - oneline: "Learn about how Functions work in TypeScript.", - }, - { - title: "Object Types", - id: "8object-types", - permalink: "/docs/handbook/2/objects.html", - oneline: "How TypeScript describes the shapes of JavaScript objects.", - }, - { - title: "Type Manipulation", - id: "8type-manipulation", - oneline: "undefined", - - items: [ - { - title: "Creating Types from Types", - id: "8creating-types-from-types", - permalink: "/docs/handbook/2/types-from-types.html", - oneline: "Step one in learning TypeScript: The basics types.", - }, - { - title: "Generics", - id: "8generics", - permalink: "/docs/handbook/2/generics.html", - oneline: "Types which take parameters", - }, - { - title: "Keyof Type Operator", - id: "8keyof-type-operator", - permalink: "/docs/handbook/2/keyof-types.html", - oneline: "Using the keyof operator in type contexts.", - }, - { - title: "Typeof Type Operator", - id: "8typeof-type-operator", - permalink: "/docs/handbook/2/typeof-types.html", - oneline: "Using the typeof operator in type contexts.", - }, - { - title: "Indexed Access Types", - id: "8indexed-access-types", - permalink: "/docs/handbook/2/indexed-access-types.html", - oneline: "Using Type['a'] syntax to access a subset of a type.", - }, - { - title: "Conditional Types", - id: "8conditional-types", - permalink: "/docs/handbook/2/conditional-types.html", - oneline: - "Create types which act like if statements in the type system.", - }, - { - title: "Mapped Types", - id: "8mapped-types", - permalink: "/docs/handbook/2/mapped-types.html", - oneline: "Generating types by re-using an existing type.", - }, - { - title: "Template Literal Types", - id: "8template-literal-types", - permalink: "/docs/handbook/2/template-literal-types.html", - oneline: - "Generating mapping types which change properties via template literal strings.", - }, - ], - }, - { - title: "Classes", - id: "8classes", - permalink: "/docs/handbook/2/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Modules", - id: "8modules", - permalink: "/docs/handbook/2/modules.html", - oneline: "Learn how TypeScript handles different module styles.", - }, - ], - }, - ] - navigations.pt = [ - { - title: "Get Started", - oneline: "Quick introductions based on your background or preference.", - id: "get-started", - chronological: false, - - items: [ - { - title: "TS for the New Programmer", - id: "0typescript-for-the-new-programmer", - permalink: "/docs/handbook/typescript-from-scratch.html", - oneline: "Learn TypeScript from scratch", - }, - { - title: "TypeScript for JS Programmers", - id: "0typescript-for-javascript-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes.html", - oneline: "Learn how TypeScript extends JavaScript", - }, - { - title: "TS for Java/C# Programmers", - id: "0typescript-for-java/c#-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-oop.html", - oneline: - "Learn TypeScript if you have a background in object-oriented languages", - }, - { - title: "TS for Functional Programmers", - id: "0typescript-for-functional-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-func.html", - oneline: - "Learn TypeScript if you have a background in functional programming", - }, - { - title: "Ferramentas TypeScript em 5 minutos", - id: "0ferramentas-typescript-em-5-minutos", - permalink: "/pt/docs/handbook/typescript-tooling-in-5-minutes.html", - oneline: - "Um tutorial para entender como criar um pequeno site com TypeScript", - }, - ], - }, - { - title: "Handbook", - oneline: "A good first read for your daily TS work.", - id: "handbook", - chronological: true, - - items: [ - { - title: "The TypeScript Handbook", - id: "1the-typescript-handbook", - permalink: "/docs/handbook/intro.html", - oneline: "Your first step to learn TypeScript", - }, - { - title: "Basic Types", - id: "1basic-types", - permalink: "/docs/handbook/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Interfaces", - id: "1interfaces", - permalink: "/docs/handbook/interfaces.html", - oneline: "How to write an interface with TypeScript", - }, - { - title: "Functions", - id: "1functions", - permalink: "/docs/handbook/functions.html", - oneline: "How to add types to a function", - }, - { - title: "Literal Types", - id: "1literal-types", - permalink: "/docs/handbook/literal-types.html", - oneline: "Using literal types with TypeScript", - }, - { - title: "Unions and Intersection Types", - id: "1unions-and-intersection-types", - permalink: "/docs/handbook/unions-and-intersections.html", - oneline: "How to use unions and intersection types in TypeScript", - }, - { - title: "Classes", - id: "1classes", - permalink: "/docs/handbook/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Enums", - id: "1enums", - permalink: "/docs/handbook/enums.html", - oneline: "How TypeScript enums work", - }, - { - title: "Generics", - id: "1generics", - permalink: "/docs/handbook/generics.html", - oneline: "Introduction to TypeScript and Generics", - }, - ], - }, - { - title: "Handbook Reference", - oneline: "Deep dive reference materials.", - id: "handbook-reference", - chronological: false, - - items: [ - { - title: "Advanced Types", - id: "2advanced-types", - permalink: "/docs/handbook/advanced-types.html", - oneline: "Advanced concepts around types in TypeScript", - }, - { - title: "Tipos Utilitários", - id: "2tipos-utilitários", - permalink: "/pt/docs/handbook/utility-types.html", - oneline: "Tipos que são inclusos globalmente em TypeScript", - }, - { - title: "Decoradores", - id: "2decoradores", - permalink: "/pt/docs/handbook/Decorators.html", - oneline: "Visão geral dos Decoradores no TypeScript", - }, - { - title: "Fusão de Declarações", - id: "2fusão-de-declarações", - permalink: "/pt/docs/handbook/declaration-merging.html", - oneline: "Como a fusão de namespaces e interfaces funciona", - }, - { - title: "Iteradores e Geradores", - id: "2iteradores-e-geradores", - permalink: "/pt/docs/handbook/iterators-and-generators.html", - oneline: "Como os Iteradores e Geradores funcionam no TypeScript", - }, - { - title: "JSX", - id: "2jsx", - permalink: "/pt/docs/handbook/jsx.html", - oneline: "Utilizando JSX com TypeScript", - }, - { - title: "Mixins", - id: "2mixins", - permalink: "/pt/docs/handbook/mixins.html", - oneline: "Usando o padrão Mixin com TypeScript", - }, - { - title: "Modules", - id: "2modules", - permalink: "/pt/docs/handbook/modules.html", - oneline: "Como módulos funcionam no TypeScript", - }, - { - title: "Resolução de módulos", - id: "2resolução-de-módulos", - permalink: "/pt/docs/handbook/module-resolution.html", - oneline: "Como o TypeScript resolve módulos em JavaScript", - }, - { - title: "Namespaces", - id: "2namespaces", - permalink: "/pt/docs/handbook/namespaces.html", - oneline: "Como funcionam os Namespaces no TypeScript", - }, - { - title: "Namespaces e Módulos", - id: "2namespaces-e-módulos", - permalink: "/pt/docs/handbook/namespaces-and-modules.html", - oneline: - "Como organizar o código em TypeScript através de módulos ou namespaces", - }, - { - title: "Símbolos (Symbols)", - id: "2símbolos-(symbols)", - permalink: "/pt/docs/handbook/symbols.html", - oneline: "Usando o símbolo primitivo do JavaScript no TypeScript", - }, - { - title: "Diretivas de barra tripla", - id: "2diretivas-de-barra-tripla", - permalink: "/pt/docs/handbook/triple-slash-directives.html", - oneline: "Como usar diretivas de barra tripla no TypeScript", - }, - { - title: "Compatibilidade de Tipos", - id: "2compatibilidade-de-tipos", - permalink: "/pt/docs/handbook/type-compatibility.html", - oneline: "Como checagem de tipos funciona em TypeScript", - }, - { - title: "Inferência de Tipo", - id: "2inferência-de-tipo", - permalink: "/pt/docs/handbook/type-inference.html", - oneline: "Como a analise do fluxo de código funciona em TypeScript", - }, - { - title: "Declarações de variáveis", - id: "2declarações-de-variáveis", - permalink: "/pt/docs/handbook/variable-declarations.html", - oneline: "Como TypeScript lida com declarações de variáveis", - }, - ], - }, - { - title: "Tutorials", - oneline: "Using TypeScript in several environments.", - id: "tutorials", - chronological: false, - - items: [ - { - title: "ASP.NET Core", - id: "3asp.net-core", - permalink: "/docs/handbook/asp-net-core.html", - oneline: "Using TypeScript in ASP.NET Core", - }, - { - title: "Gulp", - id: "3gulp", - permalink: "/docs/handbook/gulp.html", - oneline: "Using TypeScript with Gulp", - }, - { - title: "Manipulação do DOM", - id: "3manipulação-do-dom", - permalink: "/pt/docs/handbook/manipulacao-dom.html", - oneline: "Usando o DOM com TypeScript", - }, - { - title: "Migrating from JavaScript", - id: "3migrating-from-javascript", - permalink: "/docs/handbook/migrating-from-javascript.html", - oneline: "How to migrate from JavaScript to TypeScript", - }, - { - title: "Usando Babel com TypeScript", - id: "3usando-babel-com-typescript", - permalink: "/pt/docs/handbook/babel-with-typescript.html", - oneline: "Como criar um projeto híbrido com Babel + TypeScript", - }, - ], - }, - { - title: "What's New", - oneline: - "Find out how TypeScript has evolved and what's new in the releases.", - id: "what's-new", - chronological: false, - - items: [ - { - title: "Overview", - id: "4overview", - permalink: "/docs/handbook/release-notes/overview.html", - oneline: "All TypeScript release notes", - }, - { - title: "TypeScript 4.1", - id: "4typescript-4.1", - permalink: "/docs/handbook/release-notes/typescript-4-1.html", - oneline: "TypeScript 4.1 Release Notes", - }, - { - title: "TypeScript 4.0", - id: "4typescript-4.0", - permalink: "/docs/handbook/release-notes/typescript-4-0.html", - oneline: "TypeScript 4.0 Release Notes", - }, - { - title: "TypeScript 3.9", - id: "4typescript-3.9", - permalink: "/docs/handbook/release-notes/typescript-3-9.html", - oneline: "TypeScript 3.9 Release Notes", - }, - { - title: "TypeScript 3.8", - id: "4typescript-3.8", - permalink: "/docs/handbook/release-notes/typescript-3-8.html", - oneline: "TypeScript 3.8 Release Notes", - }, - { - title: "TypeScript 3.7", - id: "4typescript-3.7", - permalink: "/docs/handbook/release-notes/typescript-3-7.html", - oneline: "TypeScript 3.7 Release Notes", - }, - { - title: "TypeScript 3.6", - id: "4typescript-3.6", - permalink: "/docs/handbook/release-notes/typescript-3-6.html", - oneline: "TypeScript 3.6 Release Notes", - }, - { - title: "TypeScript 3.5", - id: "4typescript-3.5", - permalink: "/docs/handbook/release-notes/typescript-3-5.html", - oneline: "TypeScript 3.5 Release Notes", - }, - { - title: "TypeScript 3.4", - id: "4typescript-3.4", - permalink: "/docs/handbook/release-notes/typescript-3-4.html", - oneline: "TypeScript 3.4 Release Notes", - }, - { - title: "TypeScript 3.3", - id: "4typescript-3.3", - permalink: "/docs/handbook/release-notes/typescript-3-3.html", - oneline: "TypeScript 3.3 Release Notes", - }, - { - title: "TypeScript 3.2", - id: "4typescript-3.2", - permalink: "/docs/handbook/release-notes/typescript-3-2.html", - oneline: "TypeScript 3.2 Release Notes", - }, - { - title: "TypeScript 3.1", - id: "4typescript-3.1", - permalink: "/docs/handbook/release-notes/typescript-3-1.html", - oneline: "TypeScript 3.1 Release Notes", - }, - { - title: "TypeScript 3.0", - id: "4typescript-3.0", - permalink: "/docs/handbook/release-notes/typescript-3-0.html", - oneline: "TypeScript 3.0 Release Notes", - }, - { - title: "TypeScript 2.9", - id: "4typescript-2.9", - permalink: "/docs/handbook/release-notes/typescript-2-9.html", - oneline: "TypeScript 2.9 Release Notes", - }, - { - title: "TypeScript 2.8", - id: "4typescript-2.8", - permalink: "/docs/handbook/release-notes/typescript-2-8.html", - oneline: "TypeScript 2.8 Release Notes", - }, - { - title: "TypeScript 2.7", - id: "4typescript-2.7", - permalink: "/docs/handbook/release-notes/typescript-2-7.html", - oneline: "TypeScript 2.7 Release Notes", - }, - { - title: "TypeScript 2.6", - id: "4typescript-2.6", - permalink: "/docs/handbook/release-notes/typescript-2-6.html", - oneline: "TypeScript 2.6 Release Notes", - }, - { - title: "TypeScript 2.5", - id: "4typescript-2.5", - permalink: "/docs/handbook/release-notes/typescript-2-5.html", - oneline: "TypeScript 2.5 Release Notes", - }, - { - title: "TypeScript 2.4", - id: "4typescript-2.4", - permalink: "/docs/handbook/release-notes/typescript-2-4.html", - oneline: "TypeScript 2.4 Release Notes", - }, - { - title: "TypeScript 2.3", - id: "4typescript-2.3", - permalink: "/docs/handbook/release-notes/typescript-2-3.html", - oneline: "TypeScript 2.3 Release Notes", - }, - { - title: "TypeScript 2.2", - id: "4typescript-2.2", - permalink: "/docs/handbook/release-notes/typescript-2-2.html", - oneline: "TypeScript 2.2 Release Notes", - }, - { - title: "TypeScript 2.1", - id: "4typescript-2.1", - permalink: "/docs/handbook/release-notes/typescript-2-1.html", - oneline: "TypeScript 2.1 Release Notes", - }, - { - title: "TypeScript 2.0", - id: "4typescript-2.0", - permalink: "/docs/handbook/release-notes/typescript-2-0.html", - oneline: "TypeScript 2.0 Release Notes", - }, - { - title: "TypeScript 1.8", - id: "4typescript-1.8", - permalink: "/docs/handbook/release-notes/typescript-1-8.html", - oneline: "TypeScript 1.8 Release Notes", - }, - { - title: "TypeScript 1.7", - id: "4typescript-1.7", - permalink: "/docs/handbook/release-notes/typescript-1-7.html", - oneline: "TypeScript 1.7 Release Notes", - }, - { - title: "TypeScript 1.6", - id: "4typescript-1.6", - permalink: "/docs/handbook/release-notes/typescript-1-6.html", - oneline: "TypeScript 1.6 Release Notes", - }, - { - title: "TypeScript 1.5", - id: "4typescript-1.5", - permalink: "/docs/handbook/release-notes/typescript-1-5.html", - oneline: "TypeScript 1.5 Release Notes", - }, - { - title: "TypeScript 1.4", - id: "4typescript-1.4", - permalink: "/docs/handbook/release-notes/typescript-1-4.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.3", - id: "4typescript-1.3", - permalink: "/docs/handbook/release-notes/typescript-1-3.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.1", - id: "4typescript-1.1", - permalink: "/docs/handbook/release-notes/typescript-1-1.html", - oneline: "TypeScript 1.1 Release Notes", - }, - ], - }, - { - title: "Declaration Files", - oneline: - "Learn how to write declaration files to describe existing JavaScript. Important for DefinitelyTyped contributions.", - id: "declaration-files", - chronological: true, - - items: [ - { - title: "Introduction", - id: "5introduction", - permalink: "/docs/handbook/declaration-files/introduction.html", - oneline: - "How to write a high-quality TypeScript Declaration (d.ts) file", - }, - { - title: "Declaration Reference", - id: "5declaration-reference", - permalink: "/docs/handbook/declaration-files/by-example.html", - oneline: "How to create a d.ts file for a module", - }, - { - title: "Library Structures", - id: "5library-structures", - permalink: "/docs/handbook/declaration-files/library-structures.html", - oneline: "How to structure your d.ts files", - }, - { - title: ".d.ts Templates", - id: "5.d.ts-templates", - oneline: "undefined", - - items: [ - { - title: "Modules .d.ts", - id: "5modules-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/module-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Plugin", - id: "5module:-plugin", - permalink: - "/docs/handbook/declaration-files/templates/module-plugin-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Class", - id: "5module:-class", - permalink: - "/docs/handbook/declaration-files/templates/module-class-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Function", - id: "5module:-function", - permalink: - "/docs/handbook/declaration-files/templates/module-function-d-ts.html", - oneline: "undefined", - }, - { - title: "Global .d.ts", - id: "5global-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/global-d-ts.html", - oneline: "undefined", - }, - { - title: "Global: Modifying Module", - id: "5global:-modifying-module", - permalink: - "/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html", - oneline: "undefined", - }, - ], - }, - { - title: "Do's and Don'ts", - id: "5do's-and-don'ts", - permalink: "/docs/handbook/declaration-files/do-s-and-don-ts.html", - oneline: "Recommendations for writing d.ts files", - }, - { - title: "Deep Dive", - id: "5deep-dive", - permalink: "/docs/handbook/declaration-files/deep-dive.html", - oneline: "How do d.ts files work, a deep dive", - }, - { - title: "Publishing", - id: "5publishing", - permalink: "/docs/handbook/declaration-files/publishing.html", - oneline: "How to get your d.ts files to users", - }, - { - title: "Consumption", - id: "5consumption", - permalink: "/docs/handbook/declaration-files/consumption.html", - oneline: "How to download d.ts files for your project", - }, - ], - }, - { - title: "JavaScript", - oneline: "How to use TypeScript-powered JavaScript tooling.", - id: "javascript", - chronological: true, - - items: [ - { - title: "Projetos JS utilizando TypeScript", - id: "6projetos-js-utilizando-typescript", - permalink: "/pt/docs/handbook/intro-to-js-ts.html", - oneline: - "Como adicionar verificação de tipo a arquivos JavaScript usando TypeScript", - }, - { - title: "Checando tipos de arquivos JavaScript", - id: "6checando-tipos-de-arquivos-javascript", - permalink: "/pt/docs/handbook/type-checking-javascript-files.html", - oneline: - "Como adicionar checagem de tipos a arquivos JavaScript usando Typescript", - }, - { - title: "Referência JSDoc", - id: "6referência-jsdoc", - permalink: "/pt/docs/handbook/jsdoc-supported-types.html", - oneline: "Quais JSDoc Javascript baseado em Typescript suporta?", - }, - { - title: "Criação de arquivos .d.ts a partir de arquivos .js", - id: "6criação-de-arquivos-.d.ts-a-partir-de-arquivos-.js", - permalink: "/pt/docs/handbook/declaration-files/dts-from-js.html", - oneline: "Como adicionar geração d.ts a projetos JavaScript", - }, - ], - }, - { - title: "Project Configuration", - oneline: "Compiler configuration reference.", - id: "project-configuration", - chronological: false, - - items: [ - { - title: "tsconfig.json", - id: "7tsconfig.json", - permalink: "/pt/docs/handbook/tsconfig-json.html", - oneline: "Aprenda sobre como o TSConfig funciona", - }, - { - title: "Compiler Options in MSBuild", - id: "7compiler-options-in-msbuild", - permalink: "/docs/handbook/compiler-options-in-msbuild.html", - oneline: "Which compiler options are available in MSBuild projects.", - }, - { - title: "TSConfig Reference", - id: "7tsconfig-reference", - permalink: "/tsconfig", - oneline: "The page covering every TSConfig option", - }, - { - title: "tsc CLI Options", - id: "7tsc-cli-options", - permalink: "/docs/handbook/compiler-options.html", - oneline: - "A very high-level overview of the CLI compiler options for tsc", - }, - { - title: "Referência de Projeto", - id: "7referência-de-projeto", - permalink: "/pt/docs/handbook/project-references.html", - oneline: "Como dividir um projeto Typescript grande", - }, - { - title: "Integrating with Build Tools", - id: "7integrating-with-build-tools", - permalink: "/docs/handbook/integrating-with-build-tools.html", - oneline: "How to use TypeScript with other build tools", - }, - { - title: "Configurando Watch", - id: "7configurando-watch", - permalink: "/pt/docs/handbook/configuring-watch.html", - oneline: "Como configurar o modo de observação do Typescript", - }, - { - title: "Compilação Noturna", - id: "7compilação-noturna", - permalink: "/pt/docs/handbook/nightly-builds.html", - oneline: "Como usar uma compilação noturna de TypeScript", - }, - ], - }, - { - title: "Handbook v2: Beta", - oneline: "The new handbook which is a work in progress.", - id: "handbook-v2:-beta", - chronological: true, - - items: [ - { - title: "The Basics", - id: "8the-basics", - permalink: "/docs/handbook/2/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Everyday Types", - id: "8everyday-types", - permalink: "/docs/handbook/2/everyday-types.html", - oneline: "The language primitives.", - }, - { - title: "Narrowing", - id: "8narrowing", - permalink: "/docs/handbook/2/narrowing.html", - oneline: - "Understand how TypeScript uses JavaScript knowledge to reduce the amount of type syntax in your projects.", - }, - { - title: "More on Functions", - id: "8more-on-functions", - permalink: "/docs/handbook/2/functions.html", - oneline: "Learn about how Functions work in TypeScript.", - }, - { - title: "Object Types", - id: "8object-types", - permalink: "/docs/handbook/2/objects.html", - oneline: "How TypeScript describes the shapes of JavaScript objects.", - }, - { - title: "Type Manipulation", - id: "8type-manipulation", - oneline: "undefined", - - items: [ - { - title: "Creating Types from Types", - id: "8creating-types-from-types", - permalink: "/docs/handbook/2/types-from-types.html", - oneline: "Step one in learning TypeScript: The basics types.", - }, - { - title: "Generics", - id: "8generics", - permalink: "/docs/handbook/2/generics.html", - oneline: "Types which take parameters", - }, - { - title: "Keyof Type Operator", - id: "8keyof-type-operator", - permalink: "/docs/handbook/2/keyof-types.html", - oneline: "Using the keyof operator in type contexts.", - }, - { - title: "Typeof Type Operator", - id: "8typeof-type-operator", - permalink: "/docs/handbook/2/typeof-types.html", - oneline: "Using the typeof operator in type contexts.", - }, - { - title: "Indexed Access Types", - id: "8indexed-access-types", - permalink: "/docs/handbook/2/indexed-access-types.html", - oneline: "Using Type['a'] syntax to access a subset of a type.", - }, - { - title: "Conditional Types", - id: "8conditional-types", - permalink: "/docs/handbook/2/conditional-types.html", - oneline: - "Create types which act like if statements in the type system.", - }, - { - title: "Mapped Types", - id: "8mapped-types", - permalink: "/docs/handbook/2/mapped-types.html", - oneline: "Generating types by re-using an existing type.", - }, - { - title: "Template Literal Types", - id: "8template-literal-types", - permalink: "/docs/handbook/2/template-literal-types.html", - oneline: - "Generating mapping types which change properties via template literal strings.", - }, - ], - }, - { - title: "Classes", - id: "8classes", - permalink: "/docs/handbook/2/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Modules", - id: "8modules", - permalink: "/docs/handbook/2/modules.html", - oneline: "Learn how TypeScript handles different module styles.", - }, - ], - }, - ] - navigations.vo = [ - { - title: "Get Started", - oneline: "Quick introductions based on your background or preference.", - id: "get-started", - chronological: false, - - items: [ - { - title: "TS for the New Programmer", - id: "0typescript-for-the-new-programmer", - permalink: "/docs/handbook/typescript-from-scratch.html", - oneline: "Learn TypeScript from scratch", - }, - { - title: "TypeScript for JS Programmers", - id: "0typescript-for-javascript-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes.html", - oneline: "Learn how TypeScript extends JavaScript", - }, - { - title: "TS for Java/C# Programmers", - id: "0typescript-for-java/c#-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-oop.html", - oneline: - "Learn TypeScript if you have a background in object-oriented languages", - }, - { - title: "TS for Functional Programmers", - id: "0typescript-for-functional-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-func.html", - oneline: - "Learn TypeScript if you have a background in functional programming", - }, - { - title: "TypeScript Tooling in 5 minutes", - id: "0typescript-tooling-in-5-minutes", - permalink: "/docs/handbook/typescript-tooling-in-5-minutes.html", - oneline: - "A tutorial to understand how to create a small website with TypeScript", - }, - ], - }, - { - title: "Handbook", - oneline: "A good first read for your daily TS work.", - id: "handbook", - chronological: true, - - items: [ - { - title: "The TypeScript Handbook", - id: "1the-typescript-handbook", - permalink: "/docs/handbook/intro.html", - oneline: "Your first step to learn TypeScript", - }, - { - title: "B4s1c Typ3s", - id: "1b4s1c-typ3s", - permalink: "/vo/docs/handbook/basic-types.html", - oneline: "5tep on3 in learning 7ype5cript: The basics types.", - }, - { - title: "Interfaces", - id: "1interfaces", - permalink: "/docs/handbook/interfaces.html", - oneline: "How to write an interface with TypeScript", - }, - { - title: "Functions", - id: "1functions", - permalink: "/docs/handbook/functions.html", - oneline: "How to add types to a function", - }, - { - title: "Literal Types", - id: "1literal-types", - permalink: "/docs/handbook/literal-types.html", - oneline: "Using literal types with TypeScript", - }, - { - title: "Unions and Intersection Types", - id: "1unions-and-intersection-types", - permalink: "/docs/handbook/unions-and-intersections.html", - oneline: "How to use unions and intersection types in TypeScript", - }, - { - title: "Classes", - id: "1classes", - permalink: "/docs/handbook/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Enums", - id: "1enums", - permalink: "/docs/handbook/enums.html", - oneline: "How TypeScript enums work", - }, - { - title: "Generics", - id: "1generics", - permalink: "/docs/handbook/generics.html", - oneline: "Introduction to TypeScript and Generics", - }, - ], - }, - { - title: "Handbook Reference", - oneline: "Deep dive reference materials.", - id: "handbook-reference", - chronological: false, - - items: [ - { - title: "Advanced Types", - id: "2advanced-types", - permalink: "/docs/handbook/advanced-types.html", - oneline: "Advanced concepts around types in TypeScript", - }, - { - title: "Utility Types", - id: "2utility-types", - permalink: "/docs/handbook/utility-types.html", - oneline: "Types which are globally included in TypeScript", - }, - { - title: "Decorators", - id: "2decorators", - permalink: "/docs/handbook/decorators.html", - oneline: "TypeScript Decorators overview", - }, - { - title: "Declaration Merging", - id: "2declaration-merging", - permalink: "/docs/handbook/declaration-merging.html", - oneline: "How merging namespaces and interfaces works", - }, - { - title: "Iterators and Generators", - id: "2iterators-and-generators", - permalink: "/docs/handbook/iterators-and-generators.html", - oneline: "How Iterators and Generators work in TypeScript", - }, - { - title: "JSX", - id: "2jsx", - permalink: "/docs/handbook/jsx.html", - oneline: "Using JSX with TypeScript", - }, - { - title: "Mixins", - id: "2mixins", - permalink: "/docs/handbook/mixins.html", - oneline: "Using the mixin pattern with TypeScript", - }, - { - title: "Modules", - id: "2modules", - permalink: "/docs/handbook/modules.html", - oneline: "How modules work in TypeScript", - }, - { - title: "Module Resolution", - id: "2module-resolution", - permalink: "/docs/handbook/module-resolution.html", - oneline: "How TypeScript resolves modules in JavaScript", - }, - { - title: "Namespaces", - id: "2namespaces", - permalink: "/docs/handbook/namespaces.html", - oneline: "How TypeScript namespaces work", - }, - { - title: "Namespaces and Modules", - id: "2namespaces-and-modules", - permalink: "/docs/handbook/namespaces-and-modules.html", - oneline: - "How to organize code in TypeScript via modules or namespaces", - }, - { - title: "Symbols", - id: "2symbols", - permalink: "/docs/handbook/symbols.html", - oneline: "Using the JavaScript Symbol primitive in TypeScript", - }, - { - title: "Triple-Slash Directives", - id: "2triple-slash-directives", - permalink: "/docs/handbook/triple-slash-directives.html", - oneline: "How to use triple slash directives in TypeScript", - }, - { - title: "Type Compatibility", - id: "2type-compatibility", - permalink: "/docs/handbook/type-compatibility.html", - oneline: "How type-checking works in TypeScript", - }, - { - title: "Type Inference", - id: "2type-inference", - permalink: "/docs/handbook/type-inference.html", - oneline: "How code flow analysis works in TypeScript", - }, - { - title: "Variable Declaration", - id: "2variable-declaration", - permalink: "/docs/handbook/variable-declarations.html", - oneline: "How TypeScript handles variable declaration", - }, - ], - }, - { - title: "Tutorials", - oneline: "Using TypeScript in several environments.", - id: "tutorials", - chronological: false, - - items: [ - { - title: "ASP.NET Core", - id: "3asp.net-core", - permalink: "/docs/handbook/asp-net-core.html", - oneline: "Using TypeScript in ASP.NET Core", - }, - { - title: "Gulp", - id: "3gulp", - permalink: "/docs/handbook/gulp.html", - oneline: "Using TypeScript with Gulp", - }, - { - title: "DOM Manipulation", - id: "3dom-manipulation", - permalink: "/docs/handbook/dom-manipulation.html", - oneline: "Using the DOM with TypeScript", - }, - { - title: "Migrating from JavaScript", - id: "3migrating-from-javascript", - permalink: "/docs/handbook/migrating-from-javascript.html", - oneline: "How to migrate from JavaScript to TypeScript", - }, - { - title: "Using Babel with TypeScript", - id: "3using-babel-with-typescript", - permalink: "/docs/handbook/babel-with-typescript.html", - oneline: "How to create a hybrid Babel + TypeScript project", - }, - ], - }, - { - title: "What's New", - oneline: - "Find out how TypeScript has evolved and what's new in the releases.", - id: "what's-new", - chronological: false, - - items: [ - { - title: "Overview", - id: "4overview", - permalink: "/docs/handbook/release-notes/overview.html", - oneline: "All TypeScript release notes", - }, - { - title: "TypeScript 4.1", - id: "4typescript-4.1", - permalink: "/docs/handbook/release-notes/typescript-4-1.html", - oneline: "TypeScript 4.1 Release Notes", - }, - { - title: "TypeScript 4.0", - id: "4typescript-4.0", - permalink: "/docs/handbook/release-notes/typescript-4-0.html", - oneline: "TypeScript 4.0 Release Notes", - }, - { - title: "TypeScript 3.9", - id: "4typescript-3.9", - permalink: "/docs/handbook/release-notes/typescript-3-9.html", - oneline: "TypeScript 3.9 Release Notes", - }, - { - title: "TypeScript 3.8", - id: "4typescript-3.8", - permalink: "/docs/handbook/release-notes/typescript-3-8.html", - oneline: "TypeScript 3.8 Release Notes", - }, - { - title: "TypeScript 3.7", - id: "4typescript-3.7", - permalink: "/docs/handbook/release-notes/typescript-3-7.html", - oneline: "TypeScript 3.7 Release Notes", - }, - { - title: "TypeScript 3.6", - id: "4typescript-3.6", - permalink: "/docs/handbook/release-notes/typescript-3-6.html", - oneline: "TypeScript 3.6 Release Notes", - }, - { - title: "TypeScript 3.5", - id: "4typescript-3.5", - permalink: "/docs/handbook/release-notes/typescript-3-5.html", - oneline: "TypeScript 3.5 Release Notes", - }, - { - title: "TypeScript 3.4", - id: "4typescript-3.4", - permalink: "/docs/handbook/release-notes/typescript-3-4.html", - oneline: "TypeScript 3.4 Release Notes", - }, - { - title: "TypeScript 3.3", - id: "4typescript-3.3", - permalink: "/docs/handbook/release-notes/typescript-3-3.html", - oneline: "TypeScript 3.3 Release Notes", - }, - { - title: "TypeScript 3.2", - id: "4typescript-3.2", - permalink: "/docs/handbook/release-notes/typescript-3-2.html", - oneline: "TypeScript 3.2 Release Notes", - }, - { - title: "TypeScript 3.1", - id: "4typescript-3.1", - permalink: "/docs/handbook/release-notes/typescript-3-1.html", - oneline: "TypeScript 3.1 Release Notes", - }, - { - title: "TypeScript 3.0", - id: "4typescript-3.0", - permalink: "/docs/handbook/release-notes/typescript-3-0.html", - oneline: "TypeScript 3.0 Release Notes", - }, - { - title: "TypeScript 2.9", - id: "4typescript-2.9", - permalink: "/docs/handbook/release-notes/typescript-2-9.html", - oneline: "TypeScript 2.9 Release Notes", - }, - { - title: "TypeScript 2.8", - id: "4typescript-2.8", - permalink: "/docs/handbook/release-notes/typescript-2-8.html", - oneline: "TypeScript 2.8 Release Notes", - }, - { - title: "TypeScript 2.7", - id: "4typescript-2.7", - permalink: "/docs/handbook/release-notes/typescript-2-7.html", - oneline: "TypeScript 2.7 Release Notes", - }, - { - title: "TypeScript 2.6", - id: "4typescript-2.6", - permalink: "/docs/handbook/release-notes/typescript-2-6.html", - oneline: "TypeScript 2.6 Release Notes", - }, - { - title: "TypeScript 2.5", - id: "4typescript-2.5", - permalink: "/docs/handbook/release-notes/typescript-2-5.html", - oneline: "TypeScript 2.5 Release Notes", - }, - { - title: "TypeScript 2.4", - id: "4typescript-2.4", - permalink: "/docs/handbook/release-notes/typescript-2-4.html", - oneline: "TypeScript 2.4 Release Notes", - }, - { - title: "TypeScript 2.3", - id: "4typescript-2.3", - permalink: "/docs/handbook/release-notes/typescript-2-3.html", - oneline: "TypeScript 2.3 Release Notes", - }, - { - title: "TypeScript 2.2", - id: "4typescript-2.2", - permalink: "/docs/handbook/release-notes/typescript-2-2.html", - oneline: "TypeScript 2.2 Release Notes", - }, - { - title: "TypeScript 2.1", - id: "4typescript-2.1", - permalink: "/docs/handbook/release-notes/typescript-2-1.html", - oneline: "TypeScript 2.1 Release Notes", - }, - { - title: "TypeScript 2.0", - id: "4typescript-2.0", - permalink: "/docs/handbook/release-notes/typescript-2-0.html", - oneline: "TypeScript 2.0 Release Notes", - }, - { - title: "TypeScript 1.8", - id: "4typescript-1.8", - permalink: "/docs/handbook/release-notes/typescript-1-8.html", - oneline: "TypeScript 1.8 Release Notes", - }, - { - title: "TypeScript 1.7", - id: "4typescript-1.7", - permalink: "/docs/handbook/release-notes/typescript-1-7.html", - oneline: "TypeScript 1.7 Release Notes", - }, - { - title: "TypeScript 1.6", - id: "4typescript-1.6", - permalink: "/docs/handbook/release-notes/typescript-1-6.html", - oneline: "TypeScript 1.6 Release Notes", - }, - { - title: "TypeScript 1.5", - id: "4typescript-1.5", - permalink: "/docs/handbook/release-notes/typescript-1-5.html", - oneline: "TypeScript 1.5 Release Notes", - }, - { - title: "TypeScript 1.4", - id: "4typescript-1.4", - permalink: "/docs/handbook/release-notes/typescript-1-4.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.3", - id: "4typescript-1.3", - permalink: "/docs/handbook/release-notes/typescript-1-3.html", - oneline: "TypeScript 1.3 Release Notes", - }, - { - title: "TypeScript 1.1", - id: "4typescript-1.1", - permalink: "/docs/handbook/release-notes/typescript-1-1.html", - oneline: "TypeScript 1.1 Release Notes", - }, - ], - }, - { - title: "Declaration Files", - oneline: - "Learn how to write declaration files to describe existing JavaScript. Important for DefinitelyTyped contributions.", - id: "declaration-files", - chronological: true, - - items: [ - { - title: "Introduction", - id: "5introduction", - permalink: "/docs/handbook/declaration-files/introduction.html", - oneline: - "How to write a high-quality TypeScript Declaration (d.ts) file", - }, - { - title: "Declaration Reference", - id: "5declaration-reference", - permalink: "/docs/handbook/declaration-files/by-example.html", - oneline: "How to create a d.ts file for a module", - }, - { - title: "Library Structures", - id: "5library-structures", - permalink: "/docs/handbook/declaration-files/library-structures.html", - oneline: "How to structure your d.ts files", - }, - { - title: ".d.ts Templates", - id: "5.d.ts-templates", - oneline: "undefined", - - items: [ - { - title: "Modules .d.ts", - id: "5modules-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/module-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Plugin", - id: "5module:-plugin", - permalink: - "/docs/handbook/declaration-files/templates/module-plugin-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Class", - id: "5module:-class", - permalink: - "/docs/handbook/declaration-files/templates/module-class-d-ts.html", - oneline: "undefined", - }, - { - title: "Module: Function", - id: "5module:-function", - permalink: - "/docs/handbook/declaration-files/templates/module-function-d-ts.html", - oneline: "undefined", - }, - { - title: "Global .d.ts", - id: "5global-.d.ts", - permalink: - "/docs/handbook/declaration-files/templates/global-d-ts.html", - oneline: "undefined", - }, - { - title: "Global: Modifying Module", - id: "5global:-modifying-module", - permalink: - "/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html", - oneline: "undefined", - }, - ], - }, - { - title: "Do's and Don'ts", - id: "5do's-and-don'ts", - permalink: "/docs/handbook/declaration-files/do-s-and-don-ts.html", - oneline: "Recommendations for writing d.ts files", - }, - { - title: "Deep Dive", - id: "5deep-dive", - permalink: "/docs/handbook/declaration-files/deep-dive.html", - oneline: "How do d.ts files work, a deep dive", - }, - { - title: "Publishing", - id: "5publishing", - permalink: "/docs/handbook/declaration-files/publishing.html", - oneline: "How to get your d.ts files to users", - }, - { - title: "Consumption", - id: "5consumption", - permalink: "/docs/handbook/declaration-files/consumption.html", - oneline: "How to download d.ts files for your project", - }, - ], - }, - { - title: "JavaScript", - oneline: "How to use TypeScript-powered JavaScript tooling.", - id: "javascript", - chronological: true, - - items: [ - { - title: "JS Projects Utilizing TypeScript", - id: "6js-projects-utilizing-typescript", - permalink: "/docs/handbook/intro-to-js-ts.html", - oneline: - "How to add type checking to JavaScript files using TypeScript", - }, - { - title: "Type Checking JavaScript Files", - id: "6type-checking-javascript-files", - permalink: "/docs/handbook/type-checking-javascript-files.html", - oneline: - "How to add type checking to JavaScript files using TypeScript", - }, - { - title: "JSDoc Reference", - id: "6jsdoc-reference", - permalink: "/docs/handbook/jsdoc-supported-types.html", - oneline: "What JSDoc does TypeScript-powered JavaScript support?", - }, - { - title: "Creating .d.ts Files from .js files", - id: "6creating-.d.ts-files-from-.js-files", - permalink: "/docs/handbook/declaration-files/dts-from-js.html", - oneline: "How to add d.ts generation to JavaScript projects", - }, - ], - }, - { - title: "Project Configuration", - oneline: "Compiler configuration reference.", - id: "project-configuration", - chronological: false, - - items: [ - { - title: "What is a tsconfig.json", - id: "7what-is-a-tsconfig.json", - permalink: "/docs/handbook/tsconfig-json.html", - oneline: "Learn about how a TSConfig works", - }, - { - title: "Compiler Options in MSBuild", - id: "7compiler-options-in-msbuild", - permalink: "/docs/handbook/compiler-options-in-msbuild.html", - oneline: "Which compiler options are available in MSBuild projects.", - }, - { - title: "TSConfig Reference", - id: "7tsconfig-reference", - permalink: "/tsconfig", - oneline: "The page covering every TSConfig option", - }, - { - title: "tsc CLI Options", - id: "7tsc-cli-options", - permalink: "/docs/handbook/compiler-options.html", - oneline: - "A very high-level overview of the CLI compiler options for tsc", - }, - { - title: "Project References", - id: "7project-references", - permalink: "/docs/handbook/project-references.html", - oneline: "How to split up a large TypeScript project", - }, - { - title: "Integrating with Build Tools", - id: "7integrating-with-build-tools", - permalink: "/docs/handbook/integrating-with-build-tools.html", - oneline: "How to use TypeScript with other build tools", - }, - { - title: "Configuring Watch", - id: "7configuring-watch", - permalink: "/docs/handbook/configuring-watch.html", - oneline: "How to configure the watch mode of TypeScript", - }, - { - title: "Nightly Builds", - id: "7nightly-builds", - permalink: "/docs/handbook/nightly-builds.html", - oneline: "How to use a nightly build of TypeScript", - }, - ], - }, - { - title: "Handbook v2: Beta", - oneline: "The new handbook which is a work in progress.", - id: "handbook-v2:-beta", - chronological: true, - - items: [ { title: "The Basics", - id: "8the-basics", + id: "1-the-basics", permalink: "/docs/handbook/2/basic-types.html", oneline: "Step one in learning TypeScript: The basic types.", }, { title: "Everyday Types", - id: "8everyday-types", + id: "1-everyday-types", permalink: "/docs/handbook/2/everyday-types.html", oneline: "The language primitives.", }, { title: "Narrowing", - id: "8narrowing", + id: "1-narrowing", permalink: "/docs/handbook/2/narrowing.html", oneline: "Understand how TypeScript uses JavaScript knowledge to reduce the amount of type syntax in your projects.", }, { title: "More on Functions", - id: "8more-on-functions", + id: "1-more-on-functions", permalink: "/docs/handbook/2/functions.html", oneline: "Learn about how Functions work in TypeScript.", }, { title: "Object Types", - id: "8object-types", + id: "1-object-types", permalink: "/docs/handbook/2/objects.html", oneline: "How TypeScript describes the shapes of JavaScript objects.", }, { title: "Type Manipulation", - id: "8type-manipulation", + id: "1-type-manipulation", oneline: "undefined", items: [ { title: "Creating Types from Types", - id: "8creating-types-from-types", + id: "1-creating-types-from-types", permalink: "/docs/handbook/2/types-from-types.html", oneline: "Step one in learning TypeScript: The basics types.", }, { title: "Generics", - id: "8generics", + id: "1-generics", permalink: "/docs/handbook/2/generics.html", oneline: "Types which take parameters", }, { title: "Keyof Type Operator", - id: "8keyof-type-operator", + id: "1-keyof-type-operator", permalink: "/docs/handbook/2/keyof-types.html", oneline: "Using the keyof operator in type contexts.", }, { title: "Typeof Type Operator", - id: "8typeof-type-operator", + id: "1-typeof-type-operator", permalink: "/docs/handbook/2/typeof-types.html", oneline: "Using the typeof operator in type contexts.", }, { title: "Indexed Access Types", - id: "8indexed-access-types", + id: "1-indexed-access-types", permalink: "/docs/handbook/2/indexed-access-types.html", oneline: "Using Type['a'] syntax to access a subset of a type.", }, { title: "Conditional Types", - id: "8conditional-types", + id: "1-conditional-types", permalink: "/docs/handbook/2/conditional-types.html", oneline: "Create types which act like if statements in the type system.", }, { title: "Mapped Types", - id: "8mapped-types", + id: "1-mapped-types", permalink: "/docs/handbook/2/mapped-types.html", oneline: "Generating types by re-using an existing type.", }, { title: "Template Literal Types", - id: "8template-literal-types", + id: "1-template-literal-types", permalink: "/docs/handbook/2/template-literal-types.html", oneline: "Generating mapping types which change properties via template literal strings.", @@ -5248,226 +171,120 @@ export function getDocumentationNavForLanguage( }, { title: "Classes", - id: "8classes", + id: "1-classes", permalink: "/docs/handbook/2/classes.html", oneline: "How classes work in TypeScript", }, { title: "Modules", - id: "8modules", + id: "1-modules", permalink: "/docs/handbook/2/modules.html", - oneline: "Learn how TypeScript handles different module styles.", - }, - ], - }, - ] - navigations.zh = [ - { - title: "Get Started", - oneline: "Quick introductions based on your background or preference.", - id: "get-started", - chronological: false, - - items: [ - { - title: "TS for the New Programmer", - id: "0typescript-for-the-new-programmer", - permalink: "/docs/handbook/typescript-from-scratch.html", - oneline: "Learn TypeScript from scratch", - }, - { - title: "TypeScript for JS Programmers", - id: "0typescript-for-javascript-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes.html", - oneline: "Learn how TypeScript extends JavaScript", - }, - { - title: "TS for Java/C# Programmers", - id: "0typescript-for-java/c#-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-oop.html", - oneline: - "Learn TypeScript if you have a background in object-oriented languages", - }, - { - title: "TS for Functional Programmers", - id: "0typescript-for-functional-programmers", - permalink: "/docs/handbook/typescript-in-5-minutes-func.html", - oneline: - "Learn TypeScript if you have a background in functional programming", - }, - { - title: "TypeScript Tooling in 5 minutes", - id: "0typescript-tooling-in-5-minutes", - permalink: "/docs/handbook/typescript-tooling-in-5-minutes.html", oneline: - "A tutorial to understand how to create a small website with TypeScript", - }, - ], - }, - { - title: "Handbook", - oneline: "A good first read for your daily TS work.", - id: "handbook", - chronological: true, - - items: [ - { - title: "The TypeScript Handbook", - id: "1the-typescript-handbook", - permalink: "/docs/handbook/intro.html", - oneline: "Your first step to learn TypeScript", - }, - { - title: "Basic Types", - id: "1basic-types", - permalink: "/docs/handbook/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Interfaces", - id: "1interfaces", - permalink: "/docs/handbook/interfaces.html", - oneline: "How to write an interface with TypeScript", - }, - { - title: "Functions", - id: "1functions", - permalink: "/docs/handbook/functions.html", - oneline: "How to add types to a function", - }, - { - title: "Literal Types", - id: "1literal-types", - permalink: "/docs/handbook/literal-types.html", - oneline: "Using literal types with TypeScript", - }, - { - title: "Unions and Intersection Types", - id: "1unions-and-intersection-types", - permalink: "/docs/handbook/unions-and-intersections.html", - oneline: "How to use unions and intersection types in TypeScript", - }, - { - title: "Classes", - id: "1classes", - permalink: "/docs/handbook/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Enums", - id: "1enums", - permalink: "/docs/handbook/enums.html", - oneline: "How TypeScript enums work", - }, - { - title: "Generics", - id: "1generics", - permalink: "/docs/handbook/generics.html", - oneline: "Introduction to TypeScript and Generics", + "How JavaScript handles communicating across file boundaries.", }, ], }, { - title: "Handbook Reference", + title: "Reference", oneline: "Deep dive reference materials.", - id: "handbook-reference", + id: "reference", chronological: false, items: [ - { - title: "Advanced Types", - id: "2advanced-types", - permalink: "/docs/handbook/advanced-types.html", - oneline: "Advanced concepts around types in TypeScript", - }, { title: "Utility Types", - id: "2utility-types", + id: "2-utility-types", permalink: "/docs/handbook/utility-types.html", oneline: "Types which are globally included in TypeScript", }, { title: "Decorators", - id: "2decorators", + id: "2-decorators", permalink: "/docs/handbook/decorators.html", oneline: "TypeScript Decorators overview", }, { title: "Declaration Merging", - id: "2declaration-merging", + id: "2-declaration-merging", permalink: "/docs/handbook/declaration-merging.html", oneline: "How merging namespaces and interfaces works", }, + { + title: "Enums", + id: "2-enums", + permalink: "/docs/handbook/enums.html", + oneline: "How TypeScript enums work", + }, { title: "Iterators and Generators", - id: "2iterators-and-generators", + id: "2-iterators-and-generators", permalink: "/docs/handbook/iterators-and-generators.html", oneline: "How Iterators and Generators work in TypeScript", }, { title: "JSX", - id: "2jsx", + id: "2-jsx", permalink: "/docs/handbook/jsx.html", oneline: "Using JSX with TypeScript", }, { title: "Mixins", - id: "2mixins", + id: "2-mixins", permalink: "/docs/handbook/mixins.html", oneline: "Using the mixin pattern with TypeScript", }, { title: "Modules", - id: "2modules", + id: "2-modules", permalink: "/docs/handbook/modules.html", oneline: "How modules work in TypeScript", }, { title: "Module Resolution", - id: "2module-resolution", + id: "2-module-resolution", permalink: "/docs/handbook/module-resolution.html", oneline: "How TypeScript resolves modules in JavaScript", }, { title: "Namespaces", - id: "2namespaces", + id: "2-namespaces", permalink: "/docs/handbook/namespaces.html", oneline: "How TypeScript namespaces work", }, { title: "Namespaces and Modules", - id: "2namespaces-and-modules", + id: "2-namespaces-and-modules", permalink: "/docs/handbook/namespaces-and-modules.html", oneline: "How to organize code in TypeScript via modules or namespaces", }, { title: "Symbols", - id: "2symbols", + id: "2-symbols", permalink: "/docs/handbook/symbols.html", oneline: "Using the JavaScript Symbol primitive in TypeScript", }, { title: "Triple-Slash Directives", - id: "2triple-slash-directives", + id: "2-triple-slash-directives", permalink: "/docs/handbook/triple-slash-directives.html", oneline: "How to use triple slash directives in TypeScript", }, { title: "Type Compatibility", - id: "2type-compatibility", + id: "2-type-compatibility", permalink: "/docs/handbook/type-compatibility.html", oneline: "How type-checking works in TypeScript", }, { title: "Type Inference", - id: "2type-inference", + id: "2-type-inference", permalink: "/docs/handbook/type-inference.html", oneline: "How code flow analysis works in TypeScript", }, { title: "Variable Declaration", - id: "2variable-declaration", + id: "2-variable-declaration", permalink: "/docs/handbook/variable-declarations.html", oneline: "How TypeScript handles variable declaration", }, @@ -5482,31 +299,31 @@ export function getDocumentationNavForLanguage( items: [ { title: "ASP.NET Core", - id: "3asp.net-core", + id: "3-asp.net-core", permalink: "/docs/handbook/asp-net-core.html", oneline: "Using TypeScript in ASP.NET Core", }, { title: "Gulp", - id: "3gulp", + id: "3-gulp", permalink: "/docs/handbook/gulp.html", oneline: "Using TypeScript with Gulp", }, { title: "DOM Manipulation", - id: "3dom-manipulation", + id: "3-dom-manipulation", permalink: "/docs/handbook/dom-manipulation.html", oneline: "Using the DOM with TypeScript", }, { title: "Migrating from JavaScript", - id: "3migrating-from-javascript", + id: "3-migrating-from-javascript", permalink: "/docs/handbook/migrating-from-javascript.html", oneline: "How to migrate from JavaScript to TypeScript", }, { title: "Using Babel with TypeScript", - id: "3using-babel-with-typescript", + id: "3-using-babel-with-typescript", permalink: "/docs/handbook/babel-with-typescript.html", oneline: "How to create a hybrid Babel + TypeScript project", }, @@ -5522,181 +339,187 @@ export function getDocumentationNavForLanguage( items: [ { title: "Overview", - id: "4overview", + id: "4-overview", permalink: "/docs/handbook/release-notes/overview.html", oneline: "All TypeScript release notes", }, + { + title: "TypeScript 4.2", + id: "4-typescript-4.2", + permalink: "/docs/handbook/release-notes/typescript-4-2.html", + oneline: "TypeScript 4.2 Release Notes", + }, { title: "TypeScript 4.1", - id: "4typescript-4.1", + id: "4-typescript-4.1", permalink: "/docs/handbook/release-notes/typescript-4-1.html", oneline: "TypeScript 4.1 Release Notes", }, { title: "TypeScript 4.0", - id: "4typescript-4.0", + id: "4-typescript-4.0", permalink: "/docs/handbook/release-notes/typescript-4-0.html", oneline: "TypeScript 4.0 Release Notes", }, { title: "TypeScript 3.9", - id: "4typescript-3.9", + id: "4-typescript-3.9", permalink: "/docs/handbook/release-notes/typescript-3-9.html", oneline: "TypeScript 3.9 Release Notes", }, { title: "TypeScript 3.8", - id: "4typescript-3.8", + id: "4-typescript-3.8", permalink: "/docs/handbook/release-notes/typescript-3-8.html", oneline: "TypeScript 3.8 Release Notes", }, { title: "TypeScript 3.7", - id: "4typescript-3.7", + id: "4-typescript-3.7", permalink: "/docs/handbook/release-notes/typescript-3-7.html", oneline: "TypeScript 3.7 Release Notes", }, { title: "TypeScript 3.6", - id: "4typescript-3.6", + id: "4-typescript-3.6", permalink: "/docs/handbook/release-notes/typescript-3-6.html", oneline: "TypeScript 3.6 Release Notes", }, { title: "TypeScript 3.5", - id: "4typescript-3.5", + id: "4-typescript-3.5", permalink: "/docs/handbook/release-notes/typescript-3-5.html", oneline: "TypeScript 3.5 Release Notes", }, { title: "TypeScript 3.4", - id: "4typescript-3.4", + id: "4-typescript-3.4", permalink: "/docs/handbook/release-notes/typescript-3-4.html", oneline: "TypeScript 3.4 Release Notes", }, { title: "TypeScript 3.3", - id: "4typescript-3.3", + id: "4-typescript-3.3", permalink: "/docs/handbook/release-notes/typescript-3-3.html", oneline: "TypeScript 3.3 Release Notes", }, { title: "TypeScript 3.2", - id: "4typescript-3.2", + id: "4-typescript-3.2", permalink: "/docs/handbook/release-notes/typescript-3-2.html", oneline: "TypeScript 3.2 Release Notes", }, { title: "TypeScript 3.1", - id: "4typescript-3.1", + id: "4-typescript-3.1", permalink: "/docs/handbook/release-notes/typescript-3-1.html", oneline: "TypeScript 3.1 Release Notes", }, { title: "TypeScript 3.0", - id: "4typescript-3.0", + id: "4-typescript-3.0", permalink: "/docs/handbook/release-notes/typescript-3-0.html", oneline: "TypeScript 3.0 Release Notes", }, { title: "TypeScript 2.9", - id: "4typescript-2.9", + id: "4-typescript-2.9", permalink: "/docs/handbook/release-notes/typescript-2-9.html", oneline: "TypeScript 2.9 Release Notes", }, { title: "TypeScript 2.8", - id: "4typescript-2.8", + id: "4-typescript-2.8", permalink: "/docs/handbook/release-notes/typescript-2-8.html", oneline: "TypeScript 2.8 Release Notes", }, { title: "TypeScript 2.7", - id: "4typescript-2.7", + id: "4-typescript-2.7", permalink: "/docs/handbook/release-notes/typescript-2-7.html", oneline: "TypeScript 2.7 Release Notes", }, { title: "TypeScript 2.6", - id: "4typescript-2.6", + id: "4-typescript-2.6", permalink: "/docs/handbook/release-notes/typescript-2-6.html", oneline: "TypeScript 2.6 Release Notes", }, { title: "TypeScript 2.5", - id: "4typescript-2.5", + id: "4-typescript-2.5", permalink: "/docs/handbook/release-notes/typescript-2-5.html", oneline: "TypeScript 2.5 Release Notes", }, { title: "TypeScript 2.4", - id: "4typescript-2.4", + id: "4-typescript-2.4", permalink: "/docs/handbook/release-notes/typescript-2-4.html", oneline: "TypeScript 2.4 Release Notes", }, { title: "TypeScript 2.3", - id: "4typescript-2.3", + id: "4-typescript-2.3", permalink: "/docs/handbook/release-notes/typescript-2-3.html", oneline: "TypeScript 2.3 Release Notes", }, { title: "TypeScript 2.2", - id: "4typescript-2.2", + id: "4-typescript-2.2", permalink: "/docs/handbook/release-notes/typescript-2-2.html", oneline: "TypeScript 2.2 Release Notes", }, { title: "TypeScript 2.1", - id: "4typescript-2.1", + id: "4-typescript-2.1", permalink: "/docs/handbook/release-notes/typescript-2-1.html", oneline: "TypeScript 2.1 Release Notes", }, { title: "TypeScript 2.0", - id: "4typescript-2.0", + id: "4-typescript-2.0", permalink: "/docs/handbook/release-notes/typescript-2-0.html", oneline: "TypeScript 2.0 Release Notes", }, { title: "TypeScript 1.8", - id: "4typescript-1.8", + id: "4-typescript-1.8", permalink: "/docs/handbook/release-notes/typescript-1-8.html", oneline: "TypeScript 1.8 Release Notes", }, { title: "TypeScript 1.7", - id: "4typescript-1.7", + id: "4-typescript-1.7", permalink: "/docs/handbook/release-notes/typescript-1-7.html", oneline: "TypeScript 1.7 Release Notes", }, { title: "TypeScript 1.6", - id: "4typescript-1.6", + id: "4-typescript-1.6", permalink: "/docs/handbook/release-notes/typescript-1-6.html", oneline: "TypeScript 1.6 Release Notes", }, { title: "TypeScript 1.5", - id: "4typescript-1.5", + id: "4-typescript-1.5", permalink: "/docs/handbook/release-notes/typescript-1-5.html", oneline: "TypeScript 1.5 Release Notes", }, { title: "TypeScript 1.4", - id: "4typescript-1.4", + id: "4-typescript-1.4", permalink: "/docs/handbook/release-notes/typescript-1-4.html", oneline: "TypeScript 1.3 Release Notes", }, { title: "TypeScript 1.3", - id: "4typescript-1.3", + id: "4-typescript-1.3", permalink: "/docs/handbook/release-notes/typescript-1-3.html", oneline: "TypeScript 1.3 Release Notes", }, { title: "TypeScript 1.1", - id: "4typescript-1.1", + id: "4-typescript-1.1", permalink: "/docs/handbook/release-notes/typescript-1-1.html", oneline: "TypeScript 1.1 Release Notes", }, @@ -5712,67 +535,67 @@ export function getDocumentationNavForLanguage( items: [ { title: "Introduction", - id: "5introduction", + id: "5-introduction", permalink: "/docs/handbook/declaration-files/introduction.html", oneline: "How to write a high-quality TypeScript Declaration (d.ts) file", }, { title: "Declaration Reference", - id: "5declaration-reference", + id: "5-declaration-reference", permalink: "/docs/handbook/declaration-files/by-example.html", oneline: "How to create a d.ts file for a module", }, { title: "Library Structures", - id: "5library-structures", + id: "5-library-structures", permalink: "/docs/handbook/declaration-files/library-structures.html", oneline: "How to structure your d.ts files", }, { title: ".d.ts Templates", - id: "5.d.ts-templates", + id: "5-.d.ts-templates", oneline: "undefined", items: [ { title: "Modules .d.ts", - id: "5modules-.d.ts", + id: "5-modules-.d.ts", permalink: "/docs/handbook/declaration-files/templates/module-d-ts.html", oneline: "undefined", }, { title: "Module: Plugin", - id: "5module:-plugin", + id: "5-module:-plugin", permalink: "/docs/handbook/declaration-files/templates/module-plugin-d-ts.html", oneline: "undefined", }, { title: "Module: Class", - id: "5module:-class", + id: "5-module:-class", permalink: "/docs/handbook/declaration-files/templates/module-class-d-ts.html", oneline: "undefined", }, { title: "Module: Function", - id: "5module:-function", + id: "5-module:-function", permalink: "/docs/handbook/declaration-files/templates/module-function-d-ts.html", oneline: "undefined", }, { title: "Global .d.ts", - id: "5global-.d.ts", + id: "5-global-.d.ts", permalink: "/docs/handbook/declaration-files/templates/global-d-ts.html", oneline: "undefined", }, { title: "Global: Modifying Module", - id: "5global:-modifying-module", + id: "5-global:-modifying-module", permalink: "/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html", oneline: "undefined", @@ -5781,25 +604,25 @@ export function getDocumentationNavForLanguage( }, { title: "Do's and Don'ts", - id: "5do's-and-don'ts", + id: "5-do's-and-don'ts", permalink: "/docs/handbook/declaration-files/do-s-and-don-ts.html", oneline: "Recommendations for writing d.ts files", }, { title: "Deep Dive", - id: "5deep-dive", + id: "5-deep-dive", permalink: "/docs/handbook/declaration-files/deep-dive.html", oneline: "How do d.ts files work, a deep dive", }, { title: "Publishing", - id: "5publishing", + id: "5-publishing", permalink: "/docs/handbook/declaration-files/publishing.html", oneline: "How to get your d.ts files to users", }, { title: "Consumption", - id: "5consumption", + id: "5-consumption", permalink: "/docs/handbook/declaration-files/consumption.html", oneline: "How to download d.ts files for your project", }, @@ -5814,27 +637,27 @@ export function getDocumentationNavForLanguage( items: [ { title: "JS Projects Utilizing TypeScript", - id: "6js-projects-utilizing-typescript", + id: "6-js-projects-utilizing-typescript", permalink: "/docs/handbook/intro-to-js-ts.html", oneline: "How to add type checking to JavaScript files using TypeScript", }, { title: "Type Checking JavaScript Files", - id: "6type-checking-javascript-files", + id: "6-type-checking-javascript-files", permalink: "/docs/handbook/type-checking-javascript-files.html", oneline: "How to add type checking to JavaScript files using TypeScript", }, { title: "JSDoc Reference", - id: "6jsdoc-reference", + id: "6-jsdoc-reference", permalink: "/docs/handbook/jsdoc-supported-types.html", oneline: "What JSDoc does TypeScript-powered JavaScript support?", }, { title: "Creating .d.ts Files from .js files", - id: "6creating-.d.ts-files-from-.js-files", + id: "6-creating-.d.ts-files-from-.js-files", permalink: "/docs/handbook/declaration-files/dts-from-js.html", oneline: "How to add d.ts generation to JavaScript projects", }, @@ -5849,168 +672,58 @@ export function getDocumentationNavForLanguage( items: [ { title: "What is a tsconfig.json", - id: "7what-is-a-tsconfig.json", + id: "7-what-is-a-tsconfig.json", permalink: "/docs/handbook/tsconfig-json.html", oneline: "Learn about how a TSConfig works", }, { title: "Compiler Options in MSBuild", - id: "7compiler-options-in-msbuild", + id: "7-compiler-options-in-msbuild", permalink: "/docs/handbook/compiler-options-in-msbuild.html", oneline: "Which compiler options are available in MSBuild projects.", }, { title: "TSConfig Reference", - id: "7tsconfig-reference", + id: "7-tsconfig-reference", permalink: "/tsconfig", oneline: "The page covering every TSConfig option", }, { title: "tsc CLI Options", - id: "7tsc-cli-options", + id: "7-tsc-cli-options", permalink: "/docs/handbook/compiler-options.html", oneline: "A very high-level overview of the CLI compiler options for tsc", }, { title: "Project References", - id: "7project-references", + id: "7-project-references", permalink: "/docs/handbook/project-references.html", oneline: "How to split up a large TypeScript project", }, { title: "Integrating with Build Tools", - id: "7integrating-with-build-tools", + id: "7-integrating-with-build-tools", permalink: "/docs/handbook/integrating-with-build-tools.html", oneline: "How to use TypeScript with other build tools", }, { title: "Configuring Watch", - id: "7configuring-watch", + id: "7-configuring-watch", permalink: "/docs/handbook/configuring-watch.html", oneline: "How to configure the watch mode of TypeScript", }, { - title: "每日构建", - id: "7每日构建", - permalink: "/zh/docs/handbook/nightly-builds.html", - oneline: "如何使用TypeScript的每日构建版本", - }, - ], - }, - { - title: "Handbook v2: Beta", - oneline: "The new handbook which is a work in progress.", - id: "handbook-v2:-beta", - chronological: true, - - items: [ - { - title: "The Basics", - id: "8the-basics", - permalink: "/docs/handbook/2/basic-types.html", - oneline: "Step one in learning TypeScript: The basic types.", - }, - { - title: "Everyday Types", - id: "8everyday-types", - permalink: "/docs/handbook/2/everyday-types.html", - oneline: "The language primitives.", - }, - { - title: "Narrowing", - id: "8narrowing", - permalink: "/docs/handbook/2/narrowing.html", - oneline: - "Understand how TypeScript uses JavaScript knowledge to reduce the amount of type syntax in your projects.", - }, - { - title: "More on Functions", - id: "8more-on-functions", - permalink: "/docs/handbook/2/functions.html", - oneline: "Learn about how Functions work in TypeScript.", - }, - { - title: "Object Types", - id: "8object-types", - permalink: "/docs/handbook/2/objects.html", - oneline: "How TypeScript describes the shapes of JavaScript objects.", - }, - { - title: "Type Manipulation", - id: "8type-manipulation", - oneline: "undefined", - - items: [ - { - title: "Creating Types from Types", - id: "8creating-types-from-types", - permalink: "/docs/handbook/2/types-from-types.html", - oneline: "Step one in learning TypeScript: The basics types.", - }, - { - title: "Generics", - id: "8generics", - permalink: "/docs/handbook/2/generics.html", - oneline: "Types which take parameters", - }, - { - title: "Keyof Type Operator", - id: "8keyof-type-operator", - permalink: "/docs/handbook/2/keyof-types.html", - oneline: "Using the keyof operator in type contexts.", - }, - { - title: "Typeof Type Operator", - id: "8typeof-type-operator", - permalink: "/docs/handbook/2/typeof-types.html", - oneline: "Using the typeof operator in type contexts.", - }, - { - title: "Indexed Access Types", - id: "8indexed-access-types", - permalink: "/docs/handbook/2/indexed-access-types.html", - oneline: "Using Type['a'] syntax to access a subset of a type.", - }, - { - title: "Conditional Types", - id: "8conditional-types", - permalink: "/docs/handbook/2/conditional-types.html", - oneline: - "Create types which act like if statements in the type system.", - }, - { - title: "Mapped Types", - id: "8mapped-types", - permalink: "/docs/handbook/2/mapped-types.html", - oneline: "Generating types by re-using an existing type.", - }, - { - title: "Template Literal Types", - id: "8template-literal-types", - permalink: "/docs/handbook/2/template-literal-types.html", - oneline: - "Generating mapping types which change properties via template literal strings.", - }, - ], - }, - { - title: "Classes", - id: "8classes", - permalink: "/docs/handbook/2/classes.html", - oneline: "How classes work in TypeScript", - }, - { - title: "Modules", - id: "8modules", - permalink: "/docs/handbook/2/modules.html", - oneline: "Learn how TypeScript handles different module styles.", + title: "Nightly Builds", + id: "7-nightly-builds", + permalink: "/docs/handbook/nightly-builds.html", + oneline: "How to use a nightly build of TypeScript", }, ], }, - ] + ]; - return navigations[lang] + return navigations[lang]; } /** ---INSERT-END--- */ @@ -6021,40 +734,40 @@ const findInNav = ( ): SidebarNavItem | undefined => { if (Array.isArray(item)) { for (const subItem of item) { - const sub = findInNav(subItem, fun) - if (sub) return sub + const sub = findInNav(subItem, fun); + if (sub) return sub; } } else { - if (fun(item)) return item - if (!item.items) return undefined + if (fun(item)) return item; + if (!item.items) return undefined; for (const subItem of item.items) { - const sub = findInNav(subItem, fun) - if (sub) return sub + const sub = findInNav(subItem, fun); + if (sub) return sub; } - return undefined + return undefined; } -} +}; export function getNextPageID(navs: SidebarNavItem[], currentID: string) { // prettier-ignore const section = findInNav(navs, (i) => i && !!i.items && !!i.items.find(i => i.id === currentID)) || false - if (!section) return undefined - if (!section.chronological) return undefined - if (!section.items) return + if (!section) return undefined; + if (!section.chronological) return undefined; + if (!section.items) return; - const currentIndex = section.items.findIndex(i => i.id === currentID) - const next = section.items[currentIndex + 1] + const currentIndex = section.items.findIndex((i) => i.id === currentID); + const next = section.items[currentIndex + 1]; if (next) { if (next.items) { return { path: next.items[0].permalink, ...section.items[currentIndex + 1], - } + }; } else { return { path: next.permalink, ...section.items[currentIndex + 1], - } + }; } } } @@ -6063,17 +776,17 @@ export function getPreviousPageID(navs: SidebarNavItem[], currentID: string) { // prettier-ignore const section = findInNav(navs, (i) => i && !!i.items && !!i.items.find(i => i.id === currentID)) || false - if (!section) return undefined - if (!section.chronological) return undefined - if (!section.items) return + if (!section) return undefined; + if (!section.chronological) return undefined; + if (!section.items) return; - const currentIndex = section.items.findIndex(i => i.id === currentID) - const prev = section.items[currentIndex - 1] + const currentIndex = section.items.findIndex((i) => i.id === currentID); + const prev = section.items[currentIndex - 1]; if (prev) { return { path: prev.permalink, ...section.items[currentIndex - 1], - } + }; } } diff --git a/packages/typescriptlang-org/src/lib/release-plan.json b/packages/typescriptlang-org/src/lib/release-plan.json index f1a60908dac2..c2b01bff8655 100644 --- a/packages/typescriptlang-org/src/lib/release-plan.json +++ b/packages/typescriptlang-org/src/lib/release-plan.json @@ -1,9 +1,9 @@ { "_format": "mm/dd/yyyy - these get put into new Date()", - "upcoming_version": "4.2", - "iteration_plan_url": "https://github.com/microsoft/TypeScript/issues/41601", - "last_release_date": "11/19/2020", - "upcoming_beta_date": "01/07/2021", - "upcoming_rc_date": "02/09/2021", - "upcoming_release_date": "02/23/2021" + "upcoming_version": "4.3", + "iteration_plan_url": "https://github.com/microsoft/TypeScript/issues/42762", + "last_release_date": "02/32/2021", + "upcoming_beta_date": "03/30/2021", + "upcoming_rc_date": "05/11/2021", + "upcoming_release_date": "05/25/2021" } diff --git a/packages/typescriptlang-org/src/templates/documentation.scss b/packages/typescriptlang-org/src/templates/documentation.scss index ce6a61e7e4f1..e27a2efea77a 100644 --- a/packages/typescriptlang-org/src/templates/documentation.scss +++ b/packages/typescriptlang-org/src/templates/documentation.scss @@ -76,6 +76,9 @@ nav { position: sticky; top: 30px; + &.deprecated { + top: 7rem; + } margin-bottom: 1rem; } @@ -237,6 +240,72 @@ } } } + + #deprecated { + background-color: #fff4cf; + margin: 0 -2rem; + padding: 1rem 2rem 1rem 0; + display: flex; + justify-content: space-between; + align-items: center; + position: sticky; + top: 0; + z-index: 100; + + @media (max-width: $screen-sm) { + margin: 0 0 0 0; + padding: 1rem; + flex-direction: column; + h3 { + font-size: 0.8rem; + } + + #deprecated-icon { + margin-right: 1rem; + } + #deprecated-action { + margin-top: 1rem; + } + } + + #deprecated-content { + display: flex; + align-items: center; + + #deprecated-icon { + width: 2rem; + text-align: center; + } + } + + h3 { + margin-top: 0; + font-weight: normal; + font-size: 1.5rem; + margin-bottom: 0.5rem; + } + + p { + margin-top: 0; + margin-bottom: 0.2rem; + } + + #deprecated-action { + flex-shrink: 0; + + a { + padding: 0.2rem 0.5rem; + background-color: white; + border: 1px solid black; + text-decoration: none; + color: black; + + &:hover { + background-color: #eee; + } + } + } + } } .circle-bg { diff --git a/packages/typescriptlang-org/src/templates/documentation.tsx b/packages/typescriptlang-org/src/templates/documentation.tsx index 1fc57b617e14..cc981a7dcc60 100644 --- a/packages/typescriptlang-org/src/templates/documentation.tsx +++ b/packages/typescriptlang-org/src/templates/documentation.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from "react" +import React, { useEffect, useState } from "react" import { graphql } from "gatsby" import { Layout } from "../components/layout" import { Sidebar, SidebarToggleButton } from "../components/layout/Sidebar" @@ -21,6 +21,7 @@ import { Contributors } from "../components/handbook/Contributors" import { overrideSubNavLinksWithSmoothScroll, updateSidebarOnScroll } from "./scripts/setupSubNavigationSidebar" import { setupLikeDislikeButtons } from "./scripts/setupLikeDislikeButtons" import { DislikeUnfilledSVG, LikeUnfilledSVG } from "../components/svgs/documentation" +import Helmet from "react-helmet" type Props = { pageContext: { @@ -44,10 +45,20 @@ const HandbookTemplate: React.FC = (props) => { return } + const [deprecationURL, setDeprecationURL] = useState(post.frontmatter!.deprecated_by) + const i = createInternational (useIntl()) const IntlLink = createIntlLink(props.pageContext.lang) useEffect(() => { + if (document.location.hash) { + const redirects = post.frontmatter?.deprecation_redirects || [] + const indexOfHash = redirects.indexOf(document.location.hash.slice(1)) + if (indexOfHash !== -1) { + setDeprecationURL(redirects[indexOfHash + 1]) + } + } + overrideSubNavLinksWithSmoothScroll() // Handles setting the scroll @@ -58,6 +69,7 @@ const HandbookTemplate: React.FC = (props) => { setupTwoslashHovers() setupLikeDislikeButtons(props.pageContext.slug, i) + return () => { window.removeEventListener("scroll", updateSidebarOnScroll) } @@ -74,10 +86,11 @@ const HandbookTemplate: React.FC = (props) => { const navigation = getDocumentationNavForLanguage(props.pageContext.lang) const isHandbook = post.frontmatter.handbook const prefix = isHandbook ? "Handbook" : "Documentation" + + const slug = slugger() return ( - {post.frontmatter.beta && Warning: This page is a work in progress}@@ -100,6 +113,28 @@ const HandbookTemplate: React.FC = (props) => { + { deprecationURL && + <> +{showSidebar &&+ + +++ > + } ++++ ++++{i("handb_deprecated_title")}
+{i("handb_deprecated_subtitle")}
+{i("handb_deprecated_subtitle_link")} ++{i("handb_deprecated_subtitle_action")} . +{post.frontmatter.title}
{post.frontmatter.preamble && }@@ -108,7 +143,7 @@ const HandbookTemplate: React.FC = (props) => {