TypeScript SPS Melb
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
John.Liu@SharepointGurus.net
@johnnliu
http://JohnLiu.net
Thanks for listening
Remember to submit your feedback