# Introduction

Most popular programming language on the web.

## Agenda

### Types

### Interface

### Class

### Module

### Function

### Generics

## References

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

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

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

## Insatll Typescript

```
npm install typescript -g
```

## Using Typescript

```
tsc myfile.ts myoutput.js

// compile multiple ts file in one shot
tsc 1.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_vf4uPP5VEk4VgMKT)

it also help in code completion...

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

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: 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/javascript-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.
