Skip to content

Start of handbook style pages #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Nov 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"files.exclude": {
"**/.rts2_cache*": true
"**/.rts2_cache*": true,
"**/packages/typescriptlang-org/public/*": true,
"**/packages/typescriptlang-org/.cache/*": true
},
"workbench.colorCustomizations": {
"activityBar.background": "#5592d5",
Expand All @@ -11,4 +13,5 @@
"activityBarBadge.foreground": "#15202b"
},
"peacock.color": "#3178C6",
"typescript.tsdk": "node_modules/typescript/lib",
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
"danger-plugin-lighthouse": "^0.0.1",
"danger-plugin-spellcheck": "^1.5.0",
"git-branch-is": "^3.0.0",
"husky": "^3.0.8"
"husky": "^3.0.9"
},
"scripts": {
"bootstrap": "yarn build-tsconfig-reference-md",
"start": "yarn workspace typescriptlang-org start",
"build-site": "yarn workspace typescriptlang-org build",
"build-tsconfig-reference-md": "yarn workspace tsconfig-reference build",
"build": "yarn build-tsconfig-reference-md && yarn build-site",
"update-snapshots": "yarn workspace typescriptlang-org update-snapshots",
"clean": "yarn workspace typescriptlang-org gatsby clean",
"test": "yarn jest",
"playground": "concurrently -p \"[{name}]\" -n \"TS,WEB\" -c \"bgBlue.bold,bgMagenta.bold\" \"yarn workspace playground start\" \"yarn workspace playground-sandbox start\"",
Expand Down
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Advanced Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Advanced Types
layout: docs
permalink: /docs/handbook/advanced-types.html
---
{% raw %}# Table of contents
# Table of contents

[Intersection Types](#intersection-types)

Expand Down Expand Up @@ -1313,5 +1313,3 @@ type T24 = InstanceType<Function>; // Error

> Note: The `Exclude` type is a proper implementation of the `Diff` type suggested [here](https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-307871458). We've used the name `Exclude` to avoid breaking existing code that defines a `Diff`, plus we feel that name better conveys the semantics of the type.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Basic Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Basic Types
layout: docs
permalink: /docs/handbook/basic-types.html
---
{% raw %}# Introduction
# Introduction

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.
In TypeScript, we support much the same types as you would expect in JavaScript, with a convenient enumeration type thrown in to help things along.
Expand Down Expand Up @@ -296,5 +296,3 @@ You may've noticed that so far, we've been using the `let` keyword instead of Ja
The `let` keyword is actually a newer JavaScript construct that TypeScript makes available.
We'll discuss the details later, but many common problems in JavaScript are alleviated by using `let`, so you should use it instead of `var` whenever possible.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Classes
layout: docs
permalink: /docs/handbook/classes.html
---
{% raw %}# Introduction
# Introduction

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.
Starting with ECMAScript 2015, also known as ECMAScript 6, JavaScript programmers will be able to build their applications using this object-oriented class-based approach.
Expand Down Expand Up @@ -539,5 +539,3 @@ interface Point3d extends Point {
let point3d: Point3d = {x: 1, y: 2, z: 3};
```


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Compiler Options in MSBuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Compiler Options in MSBuild
layout: docs
permalink: /docs/handbook/compiler-options-in-msbuild.html
---
{% raw %}## Overview
## Overview

Compiler options can be specified using MSBuild properties within an MSBuild project.

Expand Down Expand Up @@ -124,5 +124,3 @@ Users using newer versions of TS, will see a prompt to upgrade their project on
If you are using a different build tool to build your project (e.g. gulp, grunt , etc.) and VS for the development and debugging experience, set `<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>` in your project.
This should give you all the editing support, but not the build when you hit F5.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Compiler Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Compiler Options
layout: docs
permalink: /docs/handbook/compiler-options.html
---
{% raw %}## Compiler Options
## Compiler Options

Option | Type | Default | Description
-----------------------------------------------|-----------|--------------------------------|----------------------------------------------------------------------
Expand Down Expand Up @@ -106,5 +106,3 @@ Option | Type | Default
* Setting compiler options in [`tsconfig.json`](./tsconfig.json.md) files.
* Setting compiler options in [MSBuild projects](./Compiler%20Options%20in%20MSBuild.md).


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Configuring Watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Configuring Watch
layout: docs
permalink: /docs/handbook/configuring-watch.html
---
{% raw %}Compiler supports configuring how to watch files and directories using the environment variables.
Compiler supports configuring how to watch files and directories using the environment variables.

## Configuring file watching using environment variable `TSC_WATCHFILE`

Expand Down Expand Up @@ -34,5 +34,3 @@ default (no value specified) | Use `fs.watch` to watch directo

`fs.watchFile` uses polling and thus involves CPU cycles. But this is the most reliable mechanism to get the update on the status of file/directory. Compiler typically uses `fs.watchFile` to watch source files, config files and missing files (missing file references) that means the CPU usage depends on number of files in the program.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Declaration Merging.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Declaration Merging
layout: docs
permalink: /docs/handbook/declaration-merging.html
---
{% raw %}# Introduction
# Introduction

Some of the unique concepts in TypeScript describe the shape of JavaScript objects at the type level.
One example that is especially unique to TypeScript is the concept of 'declaration merging'.
Expand Down Expand Up @@ -327,5 +327,3 @@ Array.prototype.toObservable = function () {

Global augmentations have the same behavior and limits as module augmentations.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Decorators.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Decorators
layout: docs
permalink: /docs/handbook/decorators.html
---
{% raw %}# Introduction
# Introduction

With the introduction of Classes in TypeScript and ES6, there now exist certain scenarios that require additional features to support annotating or modifying classes and class members.
Decorators provide a way to add both annotations and a meta-programming syntax for class declarations and members.
Expand Down Expand Up @@ -504,5 +504,3 @@ class Line {

> NOTE&emsp; Decorator metadata is an experimental feature and may introduce breaking changes in future releases.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Enums.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Enums
layout: docs
permalink: /docs/handbook/enums.html
---
{% raw %}# Enums
# Enums

Enums allow us to define a set of named constants.
Using enums can make it easier to document intent, or create a set of distinct cases.
Expand Down Expand Up @@ -334,5 +334,3 @@ 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.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Functions
layout: docs
permalink: /docs/handbook/functions.html
---
{% raw %}# Introduction
# Introduction

Functions are the fundamental building block of any application in JavaScript.
They're how you build up layers of abstraction, mimicking classes, information hiding, and modules.
Expand Down Expand Up @@ -478,5 +478,3 @@ For this reason, it's customary to order overloads from most specific to least s
Note that the `function pickCard(x): any` piece is not part of the overload list, so it only has two overloads: one that takes an object and one that takes a number.
Calling `pickCard` with any other parameter types would cause an error.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Generics
layout: docs
permalink: /docs/handbook/generics.html
---
{% raw %}# Introduction
# Introduction

A major part of software engineering is building components that not only have well-defined and consistent APIs, but are also reusable.
Components that are capable of working on the data of today as well as the data of tomorrow will give you the most flexible capabilities for building up large software systems.
Expand Down Expand Up @@ -329,5 +329,3 @@ createInstance(Lion).keeper.nametag; // typechecks!
createInstance(Bee).keeper.hasMask; // typechecks!
```


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Integrating with Build Tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Integrating with Build Tools
layout: docs
permalink: /docs/handbook/integrating-with-build-tools.html
---
{% raw %}Build tools
Build tools

* [Babel](#babel)
* [Browserify](#browserify)
Expand Down Expand Up @@ -277,5 +277,3 @@ More details about defining MSBuild compiler options: [Setting Compiler Options

More details can be found at [Package Manager Dialog](http://docs.nuget.org/Consume/Package-Manager-Dialog) and [using nightly builds with NuGet](https://github.com/Microsoft/TypeScript/wiki/Nightly-drops#using-nuget-with-msbuild)


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Interfaces
layout: docs
permalink: /docs/handbook/interfaces.html
---
{% raw %}# Introduction
# Introduction

One of TypeScript's core principles is that type checking focuses on the *shape* that values have.
This is sometimes called "duck typing" or "structural subtyping".
Expand Down Expand Up @@ -571,5 +571,3 @@ Within the `Control` class it is possible to access the `state` private member t
Effectively, a `SelectableControl` acts like a `Control` that is known to have a `select` method.
The `Button` and `TextBox` classes are subtypes of `SelectableControl` (because they both inherit from `Control` and have a `select` method), but the `Image` and `Location` classes are not.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Iterators and Generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Iterators and Generators
layout: docs
permalink: /docs/handbook/iterators-and-generators.html
---
{% raw %}# Iterables
# Iterables

An object is deemed iterable if it has an implementation for the [`Symbol.iterator`](Symbols.md#symboliterator) property.
Some built-in types like `Array`, `Map`, `Set`, `String`, `Int32Array`, `Uint32Array`, etc. have their `Symbol.iterator` property already implemented.
Expand Down Expand Up @@ -86,5 +86,3 @@ for (var _i = 0; _i < numbers.length; _i++) {

When targeting an ECMAScipt 2015-compliant engine, the compiler will generate `for..of` loops to target the built-in iterator implementation in the engine.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/JSDoc Supported Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: JSDoc Supported Types
layout: docs
permalink: /docs/handbook/jsdoc-supported-types.html
---
{% raw %}The list below outlines which constructs are currently supported
The list below outlines which constructs are currently supported
when using JSDoc annotations to provide type information in JavaScript files.

Note any tags which are not explicitly listed below (such as `@async`) are not yet supported.
Expand Down Expand Up @@ -587,5 +587,3 @@ The following tags have open issues to support them:
- `@yields` ([issue #23857](https://github.com/Microsoft/TypeScript/issues/23857))
- `{@link …}` ([issue #16498](https://github.com/Microsoft/TypeScript/issues/16498))


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/JSX.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: JSX
layout: docs
permalink: /docs/handbook/jsx.html
---
{% raw %}# Table of contents
# Table of contents

[Introduction](#introduction)

Expand Down Expand Up @@ -473,5 +473,3 @@ const x = preact.h("div", null);

The factory chosen will also affect where the `JSX` namespace is looked up (for type checking information) before falling back to the global one. If the factory is defined as `React.createElement` (the default), the compiler will check for `React.JSX` before checking for a global `JSX`. If the factory is defined as `h`, it will check for `h.JSX` before a global `JSX`.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Mixins.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Mixins
layout: docs
permalink: /docs/handbook/mixins.html
---
{% raw %}# Table of contents
# Table of contents

[Introduction](#introduction)

Expand Down Expand Up @@ -138,5 +138,3 @@ function applyMixins(derivedCtor: any, baseCtors: any[]) {

```


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Module Resolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Module Resolution
layout: docs
permalink: /docs/handbook/module-resolution.html
---
{% raw %}> This section assumes some basic knowledge about modules.
> This section assumes some basic knowledge about modules.
Please see the [Modules](./Modules.md) documentation for more information.

*Module resolution* is the process the compiler uses to figure out what an import refers to.
Expand Down Expand Up @@ -463,5 +463,3 @@ If the compiler identified a file as a target of a module import, it will be inc

So to exclude a file from the compilation, you need to exclude it and **all** files that have an `import` or `/// <reference path="..." />` directive to it.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Modules
layout: docs
permalink: /docs/handbook/modules.html
---
{% raw %}> **A note about terminology:**
> **A note about terminology:**
It's important to note that in TypeScript 1.5, the nomenclature has changed.
"Internal modules" are now "namespaces".
"External modules" are now simply "modules", as to align with [ECMAScript 2015](http://www.ecma-international.org/ecma-262/6.0/)'s terminology, (namely that `module X {` is equivalent to the now-preferred `namespace X {`).
Expand Down Expand Up @@ -839,5 +839,3 @@ All of the following are red flags for module structuring. Double-check that you
* A file whose only top-level declaration is `export namespace Foo { ... }` (remove `Foo` and move everything 'up' a level)
* Multiple files that have the same `export namespace Foo {` at top-level (don't think that these are going to combine into one `Foo`!)


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Namespaces and Modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Namespaces and Modules
layout: docs
permalink: /docs/handbook/namespaces-and-modules.html
---
{% raw %}> **A note about terminology:**
> **A note about terminology:**
It's important to note that in TypeScript 1.5, the nomenclature has changed.
"Internal modules" are now "namespaces".
"External modules" are now simply "modules", as to align with [ECMAScript 2015](http://www.ecma-international.org/ecma-262/6.0/)'s terminology, (namely that `module X {` is equivalent to the now-preferred `namespace X {`).
Expand Down Expand Up @@ -122,5 +122,3 @@ Just as there is a one-to-one correspondence between JS files and modules, TypeS
One effect of this is that it's not possible to concatenate multiple module source files depending on the module system you target.
For instance, you can't use the `outFile` option while targeting `commonjs` or `umd`, but with TypeScript 1.8 and later, [it's possible](./release%20notes/TypeScript%201.8.md#concatenate-amd-and-system-modules-with---outfile) to use `outFile` when targeting `amd` or `system`.


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Namespaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Namespaces
layout: docs
permalink: /docs/handbook/namespaces.html
---
{% raw %}# Table of contents
# Table of contents

[Introduction](#introduction)

Expand Down Expand Up @@ -299,5 +299,3 @@ declare namespace D3 {
declare var d3: D3.Base;
```


{% endraw %}
4 changes: 1 addition & 3 deletions packages/handbook-v1/en/Nightly Builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Nightly Builds
layout: docs
permalink: /docs/handbook/nightly-builds.html
---
{% raw %}A nightly build from the [TypeScript's `master`](https://github.com/Microsoft/TypeScript/tree/master) branch is published by midnight PST to NPM and NuGet.
A nightly build from the [TypeScript's `master`](https://github.com/Microsoft/TypeScript/tree/master) branch is published by midnight PST to NPM and NuGet.
Here is how you can get it and use it with your tools.

## Using npm
Expand Down Expand Up @@ -86,5 +86,3 @@ Go to `Preferences` > `Languages & Frameworks` > `TypeScript`:
Go to `File` > `Settings` > `Languages & Frameworks` > `TypeScript`:
> TypeScript Version: If you installed with npm: `C:\Users\USERNAME\AppData\Roaming\npm\node_modules\typescript\lib`


{% endraw %}
Loading