This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
marcin
committed
Mar 26, 2015
1 parent
2c3fa1d
commit e9700be
Showing
12 changed files
with
193 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
===== TypeScript Sample: AMD Module ===== | ||
|
||
=== Overview === | ||
This sample shows a simple Typescript application using an AMD module. | ||
|
||
=== Running === | ||
tsc --sourcemap --module amd app.ts | ||
start default.htm | ||
|
||
|
||
# TypeScript Sample: AMD Module | ||
|
||
## Overview | ||
This sample shows a simple Typescript application using an AMD module. | ||
|
||
## Running | ||
``` | ||
tsc --sourcemap --module amd app.ts | ||
start default.htm | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
===== TypeScript Sample: D3 ===== | ||
|
||
=== Overview === | ||
|
||
D3 visualization | ||
- Use of the D3 wrapper | ||
- Use of modules and interfaces | ||
|
||
=== Running === | ||
tsc --sourcemap data.ts | ||
start perf.html | ||
# TypeScript Sample: D3 | ||
|
||
## Overview | ||
|
||
D3 visualization | ||
- Use of the D3 wrapper | ||
- Use of modules and interfaces | ||
|
||
## Running | ||
``` | ||
tsc --sourcemap data.ts | ||
start perf.html | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
===== TypeScript Sample: Greeter ===== | ||
|
||
=== Overview === | ||
|
||
This sample shows basic class definition and instantiation. | ||
|
||
=== Running === | ||
tsc --sourcemap greeter.ts | ||
start greeter.html | ||
# TypeScript Sample: Greeter | ||
|
||
## Overview | ||
|
||
This sample shows basic class definition and instantiation. | ||
|
||
## Running | ||
``` | ||
tsc --sourcemap greeter.ts | ||
start greeter.html | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,35 @@ | ||
===== TypeScript Sample: Image Board ===== | ||
|
||
=== Overview === | ||
|
||
This sample implements a complete Node.js application. | ||
Notable features: | ||
- Typed usage of express for server side MVC | ||
- Typed usage of mongodb for server side database | ||
- Typed usage of Node.js | ||
- Use of TypeScript module syntax | ||
- Visual Studio project file for working with the project | ||
|
||
=== Running === | ||
|
||
Note: Perform steps 3 - 6 with your working directory set to the folder containing this README: | ||
|
||
1. Install MongoDB if necessary (see http://docs.mongodb.org/manual/installation/ ) | ||
|
||
2. Run the following command to launch the MongoDB process: | ||
|
||
<mongoinstalldir>\bin\mongod | ||
|
||
3. Restore the sample app data to MongoDB in another command prompt with the following command: | ||
|
||
<mongoinstalldir>\bin\mongorestore dump | ||
|
||
4. Install the app's node dependencies with the following command: | ||
|
||
npm install | ||
|
||
5. Compile the app with the following command: | ||
|
||
tsc --sourcemap --module commonjs app.ts | ||
|
||
6. Launch the Node process to serve the app using the following command: | ||
|
||
node app.js | ||
|
||
7. Open your favorite browser and going to the following URL to access the app: | ||
|
||
http://localhost:3000/ | ||
# TypeScript Sample: Image Board | ||
|
||
## Overview | ||
|
||
This sample implements a complete Node.js application. | ||
Notable features: | ||
- Typed usage of express for server side MVC | ||
- Typed usage of mongodb for server side database | ||
- Typed usage of Node.js | ||
- Use of TypeScript module syntax | ||
- Visual Studio project file for working with the project | ||
|
||
## Running | ||
|
||
Note: Perform steps 3 - 6 with your working directory set to the folder containing this README: | ||
|
||
1. Install MongoDB if necessary (see http://docs.mongodb.org/manual/installation/ ) | ||
|
||
2. Run the following command to launch the MongoDB process: | ||
`<mongoinstalldir>\bin\mongod` | ||
|
||
3. Restore the sample app data to MongoDB in another command prompt with the following command: | ||
`<mongoinstalldir>\bin\mongorestore dump` | ||
|
||
4. Install the app's node dependencies with the following command: | ||
`npm install` | ||
|
||
5. Compile the app with the following command: | ||
`tsc --sourcemap --module commonjs app.ts` | ||
|
||
6. Launch the Node process to serve the app using the following command: | ||
`node app.js` | ||
|
||
7. Open your favorite browser and going to the following URL to access the app: | ||
`http://localhost:3000/` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
===== TypeScript Sample: Simple ===== | ||
=== Overview === | ||
Simple use of classes and inheritance: | ||
- Interface: A simple interface that defines the interface for something that can drive. | ||
- Class: An implementation of a car. | ||
=== Keep Playing === | ||
Want to experiment? Try adding a second interface: Flyable. Implement it in a Helicopter class, then write a FlyingCar class that implements both Drivable and Flyable! | ||
interface Flyable { ... } | ||
class Helicopter implements Flyable { ... } | ||
class FlyingCar implements Drivable, Flyable { ... } | ||
=== Running === | ||
tsc --sourcemap interfaces.ts | ||
# TypeScript Sample: Simple | ||
|
||
## Overview | ||
|
||
Simple use of classes and inheritance: | ||
- Interface: A simple interface that defines the interface for something that can drive. | ||
- Class: An implementation of a car. | ||
|
||
## Keep Playing | ||
|
||
Want to experiment? Try adding a second interface: Flyable. Implement it in a Helicopter class, then write a FlyingCar class that implements both Drivable and Flyable! | ||
``` | ||
interface Flyable { ... } | ||
class Helicopter implements Flyable { ... } | ||
class FlyingCar implements Drivable, Flyable { ... } | ||
``` | ||
## Running | ||
`tsc --sourcemap interfaces.ts` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
===== TypeScript Sample: JQuery Parallax Starfield ===== | ||
|
||
=== Overview === | ||
|
||
This sample shows a simple jQuery application in TypeScript using a jQuery TypeScript typing. | ||
|
||
=== Usage === | ||
|
||
For best results, scroll the window using the scrollbar. | ||
|
||
=== Running === | ||
tsc --sourcemap --target ES5 parallax.ts | ||
start parallax.html | ||
# TypeScript Sample: JQuery Parallax Starfield | ||
|
||
## Overview | ||
|
||
This sample shows a simple jQuery application in TypeScript using a jQuery TypeScript typing. | ||
|
||
## Usage | ||
|
||
For best results, scroll the window using the scrollbar. | ||
|
||
## Running | ||
``` | ||
tsc --sourcemap --target ES5 parallax.ts | ||
start parallax.html | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
===== TypeScript Sample: Mankala ===== | ||
|
||
=== Overview === | ||
|
||
This sample implements the game logic for the Mankala board game. The following | ||
features of TypeScript are highlighted: | ||
- Multi-file compilation: The sample is compiled from several separate files | ||
- SVG: Geometry | ||
- Class inheritance: Rectangle and Square in geometry.ts | ||
- Command line: The game driver can be run as a command-line app using cscript | ||
|
||
|
||
=== Running === | ||
tsc Driver.ts --sourcemap -out game.js | ||
cscript game.js | ||
|
||
For web execution use play.htm. | ||
|
||
# TypeScript Sample: Mankala | ||
|
||
## Overview | ||
|
||
This sample implements the game logic for the Mankala board game. The following | ||
features of TypeScript are highlighted: | ||
- Multi-file compilation: The sample is compiled from several separate files | ||
- SVG: Geometry | ||
- Class inheritance: Rectangle and Square in geometry.ts | ||
- Command line: The game driver can be run as a command-line app using cscript | ||
|
||
|
||
## Running | ||
``` | ||
tsc Driver.ts --sourcemap -out game.js | ||
cscript game.js | ||
``` | ||
For web execution use play.htm. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
===== TypeScript Sample: Node.js ===== | ||
|
||
=== Overview === | ||
|
||
This sample implements a very basic node.js application using TypeScript | ||
|
||
=== Running === | ||
For HttpServer | ||
tsc --sourcemap --module commonjs HttpServer.ts | ||
node HttpServer.js | ||
|
||
For TcpServer | ||
tsc --sourcemap --module commonjs TcpServer.ts | ||
node TcpServer.js | ||
# TypeScript Sample: Node.js | ||
|
||
## Overview | ||
|
||
This sample implements a very basic node.js application using TypeScript | ||
|
||
## Running | ||
For HttpServer | ||
``` | ||
tsc --sourcemap --module commonjs HttpServer.ts | ||
node HttpServer.js | ||
``` | ||
|
||
For TcpServer | ||
``` | ||
tsc --sourcemap --module commonjs TcpServer.ts | ||
node TcpServer.js | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
===== TypeScript Sample: Raytracer ===== | ||
|
||
=== Overview === | ||
|
||
This sample shows a raytracer implementation in TypeScript. | ||
|
||
=== Running === | ||
tsc --sourcemap raytracer.ts | ||
start raytracer.html | ||
# TypeScript Sample: Raytracer | ||
|
||
## Overview | ||
|
||
This sample shows a raytracer implementation in TypeScript. | ||
|
||
## Running | ||
``` | ||
tsc --sourcemap raytracer.ts | ||
start raytracer.html | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
===== TypeScript Sample: Simple ===== | ||
|
||
=== Overview === | ||
|
||
Simple use of classes and inheritance: | ||
- Classes: A base class and two subclasses | ||
- Super calls: Derived classes make super calls | ||
|
||
|
||
=== Running === | ||
tsc --sourcemap animals.ts | ||
# TypeScript Sample: Simple | ||
|
||
## Overview | ||
|
||
Simple use of classes and inheritance: | ||
- Classes: A base class and two subclasses | ||
- Super calls: Derived classes make super calls | ||
|
||
|
||
## Running | ||
|
||
`tsc --sourcemap animals.ts` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
===== TypeScript Sample: Warship Combat ===== | ||
|
||
=== Overview === | ||
|
||
The classic grid-based warship combat game | ||
- Use of the jQuery and jQuery UI wrappers | ||
- Use of object-oriented techniques | ||
|
||
|
||
=== Running === | ||
tsc --sourcemap --target ES5 warship.ts | ||
start default.html | ||
# TypeScript Sample: Warship Combat | ||
|
||
## Overview | ||
|
||
The classic grid-based warship combat game | ||
- Use of the jQuery and jQuery UI wrappers | ||
- Use of object-oriented techniques | ||
|
||
|
||
## Running | ||
``` | ||
tsc --sourcemap --target ES5 warship.ts | ||
start default.html | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
===== TypeScript Sample: Windows 8.1 Windows store app ===== | ||
|
||
=== Overview === | ||
|
||
The encyclopedia includes a complete sample app for a Windows 8.1 app | ||
built using TypeScript. The following features of TypeScript are highlighted: | ||
- VS project integration: TypeScript compilation integrated into VS build | ||
- Typing WinJS and WinRT: Early work on typing these libraries | ||
- Mostly JS in TypeScript: Code is mostly the original JS, with a little | ||
TypeScript | ||
|
||
=== Running === | ||
Open encyclopedia\Encyclopedia.sln in Visual Studio 2013 | ||
F5 | ||
# TypeScript Sample: Windows 8.1 Windows store app | ||
|
||
## Overview | ||
|
||
The encyclopedia includes a complete sample app for a Windows 8.1 app | ||
built using TypeScript. The following features of TypeScript are highlighted: | ||
- VS project integration: TypeScript compilation integrated into VS build | ||
- Typing WinJS and WinRT: Early work on typing these libraries | ||
- Mostly JS in TypeScript: Code is mostly the original JS, with a little | ||
TypeScript | ||
|
||
## Running | ||
``` | ||
Open encyclopedia\Encyclopedia.sln in Visual Studio 2013 | ||
F5 | ||
``` |