Skip to content
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

Correct spelling mistakes #662

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion code/tips/nominalTyping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Literal {
type FooId = Id<'foo'>;
type BarId = Id<'bar'>;

/** Optional: contructors functions */
/** Optional: constructors functions */
const createFoo = (value: string): FooId => ({ type: 'foo', value });
const createBar = (value: string): BarId => ({ type: 'bar', value });

Expand Down
2 changes: 1 addition & 1 deletion code/types/freshness/index-signatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ module mustConform2 {

module dual {
interface ArrStr {
[key: string]: string | number; // Must accomodate all members
[key: string]: string | number; // Must accommodate all members

[index: number]: string; // Can be a subset of string indexer

Expand Down
6 changes: 3 additions & 3 deletions code/types/type-compatibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export namespace FunctionArgsCount {
}

export namespace FunctionReturnCo {
/** Type Heirarchy */
/** Type Hierarchy */
interface Point2D { x: number; y: number; }
interface Point3D { x: number; y: number; z: number; }

Expand All @@ -42,7 +42,7 @@ export namespace FunctionRest {
}

export namespace FunctionArgsBi {
/** Type Heirarchy */
/** Type Hierarchy */
interface Point2D { x: number; y: number; }
interface Point3D { x: number; y: number; z: number; }

Expand Down Expand Up @@ -76,7 +76,7 @@ namespace NominalClassMemebers {


export namespace invariance {
/** Heirarchy */
/** Hierarchy */
class Animal { constructor(public name: string){} }
class Cat extends Animal { meow() { } }

Expand Down
2 changes: 1 addition & 1 deletion docs/jsx/others.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import {jsxFactory} from "jsxFactory";
var div = <div>Hello JSX!</div>
```

With `--jsx react` this file will emit to use the factory specfied in the jsx pragma:
With `--jsx react` this file will emit to use the factory specified in the jsx pragma:
```js
"use strict";
var jsxFactory_1 = require("jsxFactory");
Expand Down
2 changes: 1 addition & 1 deletion docs/tips/nominalTyping.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ foo = foo; // Okay
* Advantages
- No need for any type assertions
* Disadvantage
- The structure `{type,value}` might not be desireable and need server serialization support
- The structure `{type,value}` might not be desirable and need server serialization support

## Using Enums
[Enums in TypeScript](../enums.md) offer a certain level of nominal typing. Two enum types aren't equal if they differ by name. We can use this fact to provide nominal typing for types that are otherwise structurally compatible.
Expand Down
2 changes: 1 addition & 1 deletion docs/types/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Functions

## Optional
The `?` annotation can be used before a function argument or member of an interface to denote that a member is optional. That is to say that you can provide it if you want (and it will be type checked), but if it is ommited its *okay*. This is shown in the following example:
The `?` annotation can be used before a function argument or member of an interface to denote that a member is optional. That is to say that you can provide it if you want (and it will be type checked), but if it is omitted its *okay*. This is shown in the following example:

## Specialized Parameters

Expand Down
6 changes: 3 additions & 3 deletions docs/types/never.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,15 @@ const failExpression = function(message: string) {
};
```

Of course you can fix it by an explict annotation:
Of course you can fix it by an explicit annotation:

```ts
function failDeclaration(message: string): never {
throw new Error(message);
}
```

Key reason is backword compatability with real world JavaScript code:
Key reason is backward compatibility with real world JavaScript code:

```ts
class Base {
Expand All @@ -100,7 +100,7 @@ class Derived extends Base {

If `Base.overrideMe` .

> Real world TypeScript can overcome this with `abstract` functions but this inferrence is maintained for compatability.
> Real world TypeScript can overcome this with `abstract` functions but this inference is maintained for compatibility.

<!--
PR: https://github.com/Microsoft/TypeScript/pull/8652
Expand Down
2 changes: 1 addition & 1 deletion docs/types/type-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ status = num; // OKAY
num = status; // OKAY
```

* Enum values from different enum types are considered incompatible. This makes enums useable *nominally* (as opposed to structurally)
* Enum values from different enum types are considered incompatible. This makes enums usable *nominally* (as opposed to structurally)

```ts
enum Status { Ready, Waiting };
Expand Down