TypeScript SPS Melb
TypeScript SPS Melb
• User Groups,
SharePoint Saturday,
SharePoint
Conferences,
• http://johnliu.net
• @johnnliu
Contents
• What is TypeScript
• Why do we need TypeScript
• How
• Demo
• Pinteresp
• Working with your existing JavaScript
What is TypeScript
• var x = 1; x = "hello";
// NOT OK, type is mixed up. We can't assume what type is x.
• var i = 1;
if (i == 1) {
var i = 2;
}
var y = function { var i = 3; }
Problem - object inheritance is
hard
• Based on object extension. Not class inheritance
(at a syntax level)
• var animal = {
var name;
};
• // js
function f(x, y) {
return x * y;
}
• // ts
function f(x : number, y : number) : number {
return x * y;
}
• #3 Optional arguments in
your functions
• http://www.typescriptlang.org/
• http://blogs.msdn.com/b/typescript/
• http://visualstudiogallery.msdn.microsoft.com/
07d54d12-7133-4e15-becb-6f451ea3bea6
• http://channel9.msdn.com/Shows/
Going+Deep/Anders-Hejlsberg-and-Lars-Bak-
TypeScript-JavaScript-and-Dart
• https://github.com/borisyankov/DefinitelyTyped
• http://www.slideshare.net/jeremylikness/
introduction-to-typescript
• http://prezi.com/zkhsz49ownaw/coffeescript-
vs-typescript/
References - SharePoint + TypeScript
• http://www.chaholl.com/archive/2013/01/03/
typescript-in-a-sharepoint-farm-solution.aspx
• http://sptypescript.codeplex.com/
• http://johnliu.net/blog/2013/3/13/building-
sharepoint-solutions-with-microsofts-
typescript-why.html
References - JavaScript
• http://javascript.crockford.com/
javascript.html
• http://javascript.crockford.com/
inheritance.html
• http://www.adequatelygood.com/2010/2/
JavaScript-Scoping-and-Hoisting
• http://www.jibbering.com/faq/notes/closures/
Questions?
Comments?
More info
[email protected]
@johnnliu
http://JohnLiu.net
Thanks for listening
Remember to submit your feedback