Giter VIP home page Giter VIP logo

typescript-handbook's Introduction

TypeScript-Handbook Repo Deprecated

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


TypeScript-Handbook

Build Status

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

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

How To Contribute

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

typescript-handbook's People

Contributors

brettcannon avatar bricewilson avatar chiumax avatar csantos42 avatar d4nyll avatar danielrose avatar danielrosenwasser avatar danmarshall avatar drmacm avatar freezestudio avatar fyodore82 avatar gburdeti avatar gcrev93 avatar marzelin avatar mauricedb avatar mhegazy avatar orta avatar rbuckton avatar rickcarlino avatar riknoll avatar ryancavanaugh avatar sandersn avatar settrend avatar sheetalkamat avatar styfle avatar vkrol avatar wanderer06 avatar weswigham avatar yuit avatar zhongsp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

typescript-handbook's Issues

Documentation about `any` type does not reflect difference with `object`

Current documentation for any type does not reflect the difference between any and Object.

If you take a look here, you may find following example:

var notSure: any = 4;
notSure = "maybe a string instead";
notSure = false; // okay, definitely a boolean

But this example shows only one part of the any nature: an ability to assign anything to the variable of type any. Looking into this example it is really hard to understand the difference between any and Object, because following code would behave in the same way:

var notSure: Object = 4;
notSure = "maybe a string instead";
notSure = false; // okay, definitely a boolean

Proper example should show that the TypeScript type checker gives up and allows to call any method or access any properties on the variable of type any without any errors:

var notSure: any = 4;
notSure.weCanCallAnyMethodWithoutAnError();
notSure = "maybe a string instead";
var f = notSure.andAccessSomeFields;
notSure = false; // okay, definitely a boolean

Use single/double quotes consistently

The Handbook currently uses both single and double quotes, sometimes even in the same example:

var name: string = "bob";
name = 'smith';

Settling on just one style would look better.

Destructuring

Declarations with destructuring, assignments, and samples.

Update README

Spell out contribution guidelines, style guide, PR process, etc.

Module transition guide

Given a project written with internal modules and --out, how do I turn this into an ES6-module project?

Given a TypeScript project using old-style import x = require('foo');, export class Bar, or export =, how do I transition these to equivalent ES6 module import/exports?

let and const

Scoping rules, differences between var, let and const.

Decorators

What are decorators? How do they work? What can/should I use them for? What is the codegen, and how are they typechecked?

Contributors

Integrate contribution information into this repo so we can properly credit any external contributors

Hybrid Types section expansion

I was having a hard time understanding how one would create a class implementing a hybrid type, and then ran across this posting which explained this issue:
http://stackoverflow.com/questions/25340601/typescript-hybrid-type-implementation

It would be nice of the Hybrid Types section could include an example function returning the hybrid type as was done in the posting, and further explain that one cannot create a TypeScript class that implements a hybrid type interface.

function getCounter():Counter{
var counter = function(start:number){};
counter.interval = 123;
counter.reset = function(){};
return counter;
}

var c: Counter = getCounter();
...

Enums

regular enums, Const enums, different in lining rules

Copy-edit all existing content for Markdown compliance

I did a rough transition from CodePlex wiki to Markdown, but we need to do a detailed scan of each page to look for any formatting problems.

  • Two spaces after periods
  • Language tags after triple-ticks (need a bunch of these)
  • Headings level (standardize on one-hash as top-level heading size)
  • Fix link formatting

Fix up typescriptlang.org 'Learn' link

Figure out how to merge in our .md files the way we did the CodePlex wiki content, host a 'master' MD page that links everything together, or some other way to let people read all the content in an organized fashion.

There should be some tools out there for this already.

Parameter Decorators Take 3 Arguments (Not 2)

Link to handbook -- Explicitly mentions 2 arguments and then only shows the use of 2 arguments in the example as well.

From the lib.d.ts (I checked 1.6.2 & 1.8.0 versions) it seems like propertyKey is the one missing from the documentation:

declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;

update http://www.typescriptlang.org/Handbook

I first had a read through the above mentioned website before looking in the language spec and then realised that a lot of the syntax and concepts described on the above mentioned website is out-of-date, already deprecated respectively. For instance, it does still use the term internal module instead of namespace or uses the import ... require instead of import ... from.
IMO the website should either be updated or a notice should be shown that it is outdated and one should have a look at the language spec

Add an out of date notice

The handbook currently doesn't mention things like tuples, and this makes it confusing if you learn about tuples from a different source and then try to look them up in the handbook. The handbook is also the main form of documentation in the TS website, so it's natural to expect it being up to date, which is an another reason to add a notice that it doesn't cover all the TS features.

String templates

Templates, escaping rules, diffrences from string literals and tagged templates

Cover `async`/`await`

It's okay to say this is behind an experimental flag, but it needs to be covered.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.