> For the complete documentation index, see [llms.txt](https://hemantajax-2.gitbook.io/typescript-step-by-step/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hemantajax-2.gitbook.io/typescript-step-by-step/master.md).

# Introduction

* Superset of Javascript
* Compiles to plain JavaScript
* Strongly Typed
* Class based Object-Oriantation

## References

Handbook - <http://www.typescriptlang.org/Handbook>

Playground - <http://www.typescriptlang.org/Playground>

Typescript Demo with Webpack - <https://github.com/hesing/typescript-webpack-demo>

## Install Typescript

```
// Install node js 1st
npm install typescript -g
```

## Using Typescript

```
// just simple
tsc test.ts

// watch changes
tsc test.ts -w

// change output filename
tsc myfile.ts myoutput.js

// compile multiple ts file in one shot
tsc a.ts b.ts --out myoutput.js
```

## Typescript compiltation with Sublime Text 3

install `TypeScript` plugin using sublime package manager. use `Ctrl + B` to compile typescript file.

![ts build](/files/-M7_vUYYux5asbs-jPqX)

it also help in code completion...

![code completion](/files/-M7_vUYZmoAPyxo8BAAU)

Also you want to install sublime text 3 `tslint` to get immediate error notification.

## Typescript compiltation with Webpack

```
npm install ts-loader --save-dev
```

in webpack.config.js include `ts-loader` ...

```javascript
module.exports = {  
  entry: './app.ts',
  output: {
    filename: 'bundle.js'
  },
  resolve: {
    extensions: ['', '.webpack.js', '.web.js', '.ts', '.js']
  },
  module: {
    loaders: [
      { test: /\.ts$/, loader: 'ts-loader' }
    ]
  }
}
```

now we can use typescript like below\...

```javascript
require('../tssample/test.js');
or
require('../tssample/test.ts');
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hemantajax-2.gitbook.io/typescript-step-by-step/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
