Download presentation
Presentation is loading. Please wait.
Published byAriel Hunt Modified over 9 years ago
1
Leveraging TypeScript in Cross-functional development teams Aaron McGee, Richard Brookes M216
6
var typeScriptBoolean: boolean = true; var typeScriptNumber: number = 10; var typeScriptString: string = "Hello World"; var anyOldType: any = "what evs";
7
var typeScriptBoolean = true; var typeScriptNumber = 10; var typeScriptString = "Hello World"; var anyOldType = "what evs";
8
enum Color { Red, Green, Blue }; var c: Color = Color.Green;
9
var Color; (function (Color) { Color[Color["Red"] = 0] = "Red"; Color[Color["Green"] = 1] = "Green"; Color[Color["Blue"] = 2] = "Blue"; })(Color || (Color = {})); ; var c = 1 /* Green */;
10
var list: number[] = [1, 2, 3]; var list: Array = [1, 2, 3];
11
var list = [1, 2, 3];
12
interface ILabelledValue { label: string; } function printLabel(labelledObj: ILabelledValue) { console.log(labelledObj.label); } var myObj = { size: 10, label: "Size 10" }; printLabel(myObj);
13
function printLabel(labelledObj) { console.log(labelledObj.label); } var myObj = { size: 10, label: "Size 10" }; printLabel(myObj);
14
interface SearchFunc { (source: string, subString:string): boolean; } var mySearch: SearchFunc; mySearch = function(src: string, sub: string) { //some implementation return true; }
15
var mySearch; mySearch = function (src, sub) { //some implementation return true; };
16
interface ClockInterface { currentTime: Date; } class Clock implements ClockInterface { currentTime: Date; constructor(h: number, m: number) { } }
17
var Clock = (function () { function Clock(h, m) { } return Clock; })();
18
module Time { export interface ClockInterface { currentTime: Date; } export class Clock implements ClockInterface { currentTime: Date; constructor(h: number, m: number) { } }
19
var Time; (function (Time) { var Clock = (function () { function Clock(h, m) { } return Clock; })(); Time.Clock = Clock; })(Time || (Time = {}));
28
http://bka.co.nz/model-generation Contact us: aaron@bka.co.nz
31
Subscribe to our fortnightly newsletter http://aka.ms/technetnz http://aka.ms/msdnnz http://aka.ms/ch9nz Free Online Learning http://aka.ms/mva Sessions on Demand
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.