SlideShare uma empresa Scribd logo
1 de 24
TypeScript
Udaiappa Ramachandran ( Udai )
//linkedin.com/in/udair
Who am I?
• Udaiappa Ramachandran ( Udai )
• CTO, Akumina, Inc.,
• Consultant
• Azure Insider
• New Hampshire Cloud User Group (http://www.meetup.com/nashuaug )
• Focus on Cloud Computing (Microsoft Azure and AWS), IoT, SharePoint
Online
• http://cloudycode.wordpress.com
• @nhcloud
TypeScript - Agenda
• Why & What
• Basic Types
• Interfaces
• Functions
• Classes
• Generics
• Modules
• Demo
• References
• Q & A
Typescript
• Why
• Javascript is dynamic type
• Pro– can hold any object, type on the fly
• Con- Can get messy over the time
• Migration from server-side to client-side will be hard
• Hard to manage, difficult to ensure property types
• What
• Any valid JavaScript is a typescript
• Typescriptlang.org
• Typescript lets you write JavaScript the way you really want to.
• Typescript is a typed superset of JavaScript that compiles to plain JavaScript.
• Any browser. Any host. Any OS. Open Source.
Typescript Alternatives
• Pure JavaScript
• Apply JavaScript patterns
• Functions as abstractions
• Functions to build modules
• Functions to avoid global variables
• CoffeeScript
• Dart
Typescript Key Features
• Supports standard JavaScript code
• Provide static typing
• Encapsulation through classes and modules
• Support for constructors, properties, functions
• Define interfaces
• Lambda style function support
• Intellisense and syntax checking
Typescript tools
• Typescript playground
• Visual Studio
• sublime
• Node.js
• WebStorm
• Eclipse
• Vi
• IntelliJ
• Emacs
Typescript to JavaScript
Tyepscript BasicTypes
• Boolean
• Number
• String
• Array
• Enum
• Enum as Bit Flag 1,2,4,8,16,32,64,128 and so on
• Any
• Void
Tyepscript Annotation
• Type Annotation
• var [identifier]:[type annotation]=value
• var [identifier]:[type annotation];
• var [identifier]=value;
• Example
Typescript Functions
• Optional Parameters using ?
• function getAverage(a: number, b: number, c?: number): void { }
• Default parameters using =value
• function concatenate(items: string[], separator = ",", beginAt = 0, endAt = items.length) :void{ }
• Rest parameter using …
• Only one allowed, it must appear last in the parameter list and must be an array type
• function getSum(...a: number[]): number {
• var t = 0;a.forEach(p=>t=t+ p);
• return t;
• }
• var result = getSum(1, 2, 3, 4);
• Overloads
• Overloads in typescript cannot have own implementation but decorate a single implementation
• function getSum(a: string, b: string, c: string): number;
• function getSum(a: number, b: number, c: number): number;
• function getSum(a: any, b: any, c: any): number {
• // implementation signature
• return parseInt(a, 10) + parseInt(b, 10) + parseInt(c, 10);
• }
• Arrow function
• var getSum: (a: number, b: number) => number =(x, y) => (x + y);
Typescript Interfaces
• Interfaces are used at design time to provide auto completion and at compile time
to provide type checking
• Supported features
• Optional properties
• Function Types
• Array Types
• Class Types
• Extending Interfaces
• Hybrid Types
Typescript Interfaces
Typescript Classes
• Object-oriented class based approach
• Key features
• Inheritance
• Private/public modifiers
• Accessors
• Static properties
• Constructor functions
• Using class as an interface
Typescript Classes
Typescript Generics
• Supports generic type variables, types, interfaces, classes and constraints
Typescript Modules
• Encapsulate variables, interfaces, and classes
• Define unique namespaces
• Organize symbols and identifiers into a logical namespace hierarchy
• Similar to namespaces/packages
• Splitting across files
• Multiple files can use the same module name
• One file can contain multiple module
• Can define Alias to module
• Transpiles to IIFE
• Can define modules as internal or external
• External modules required only when used with node.js and require.js
Typescript Modules
Typescript Declaration Merging
• Concept
• Merging Interfaces
• Merging Modules
• Merging Modules with classes, functions, and Enums
• Disallowed Merges
Typescript Type inference and Compatibility
• Type inference
• Basics
• Best common type
• Contextual Type
• Type Compatibility
• Starting out
• Comparing two functions
• Enums
• Classes
• Generics
• Advanced Topics
• Common Errors
• Mixins
Typescript Definition Files
• Describes the types defined in external libraries
• .d.ts
• Not deployed
• Usually from DefinitelyTyped
• TypeScript Definition manager (tsd)
• Specialized package manager
• Locates and installs typescript definition files(d.ts)
• From the definitelytyped repository
Demo
Reference
• //typescriptlang.org
Q & A

Mais conteĂşdo relacionado

Mais procurados

TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painSander Mak (@Sander_Mak)
 
Type script - advanced usage and practices
Type script  - advanced usage and practicesType script  - advanced usage and practices
Type script - advanced usage and practicesIwan van der Kleijn
 
Typescript overview
Typescript overviewTypescript overview
Typescript overviewThanvilahari
 
TypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideTypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideNascenia IT
 
Typescript ppt
Typescript pptTypescript ppt
Typescript pptakhilsreyas
 
TypeScript intro
TypeScript introTypeScript intro
TypeScript introAts Uiboupin
 
Introducing type script
Introducing type scriptIntroducing type script
Introducing type scriptRemo Jansen
 
TypeScript Seminar
TypeScript SeminarTypeScript Seminar
TypeScript SeminarHaim Michael
 
API Asynchrones en Java 8
API Asynchrones en Java 8API Asynchrones en Java 8
API Asynchrones en Java 8JosĂŠ Paumard
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type scriptDmitrii Stoian
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass SlidesNir Kaufman
 
Clean code slide
Clean code slideClean code slide
Clean code slideAnh Huan Miu
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Aijaz Ali Abro
 
NestJS
NestJSNestJS
NestJSWilson Su
 

Mais procurados (20)

TypeScript Presentation
TypeScript PresentationTypeScript Presentation
TypeScript Presentation
 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the pain
 
TypeScript - An Introduction
TypeScript - An IntroductionTypeScript - An Introduction
TypeScript - An Introduction
 
Type script - advanced usage and practices
Type script  - advanced usage and practicesType script  - advanced usage and practices
Type script - advanced usage and practices
 
Typescript overview
Typescript overviewTypescript overview
Typescript overview
 
TypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideTypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation Guide
 
Typescript ppt
Typescript pptTypescript ppt
Typescript ppt
 
TypeScript intro
TypeScript introTypeScript intro
TypeScript intro
 
Introducing type script
Introducing type scriptIntroducing type script
Introducing type script
 
Javascript best practices
Javascript best practicesJavascript best practices
Javascript best practices
 
TypeScript Seminar
TypeScript SeminarTypeScript Seminar
TypeScript Seminar
 
Quick introduction to scala
Quick introduction to scalaQuick introduction to scala
Quick introduction to scala
 
Clean coding-practices
Clean coding-practicesClean coding-practices
Clean coding-practices
 
API Asynchrones en Java 8
API Asynchrones en Java 8API Asynchrones en Java 8
API Asynchrones en Java 8
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type script
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass Slides
 
Clean code slide
Clean code slideClean code slide
Clean code slide
 
Introduction to Scala
Introduction to ScalaIntroduction to Scala
Introduction to Scala
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
 
NestJS
NestJSNestJS
NestJS
 

Destaque

TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersRutenis Turcinas
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java DevelopersYakov Fain
 
Александр Русаков - TypeScript 2 in action
Александр Русаков - TypeScript 2 in actionАлександр Русаков - TypeScript 2 in action
Александр Русаков - TypeScript 2 in actionMoscowJS
 
Typescript + Graphql = <3
Typescript + Graphql = <3Typescript + Graphql = <3
Typescript + Graphql = <3felixbillon
 
Angular 2 - Typescript
Angular 2  - TypescriptAngular 2  - Typescript
Angular 2 - TypescriptNathan Krasney
 
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)Ontico
 
TypeScript: Un lenguaje aburrido para programadores torpes y tristes
TypeScript: Un lenguaje aburrido para programadores torpes y tristesTypeScript: Un lenguaje aburrido para programadores torpes y tristes
TypeScript: Un lenguaje aburrido para programadores torpes y tristesMicael Gallego
 
TypeScript
TypeScriptTypeScript
TypeScriptGetDev.NET
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScriptOffirmo
 
Typescript tips & tricks
Typescript tips & tricksTypescript tips & tricks
Typescript tips & tricksOri Calvo
 
TypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponTypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponLaurent Duveau
 
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21MoscowJS
 
TypeScriptで忍遊javascript
TypeScriptで忍遊javascriptTypeScriptで忍遊javascript
TypeScriptで忍遊javascriptAfiruPain NaokiSoga
 

Destaque (14)

TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack Developers
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
 
Александр Русаков - TypeScript 2 in action
Александр Русаков - TypeScript 2 in actionАлександр Русаков - TypeScript 2 in action
Александр Русаков - TypeScript 2 in action
 
Typescript + Graphql = <3
Typescript + Graphql = <3Typescript + Graphql = <3
Typescript + Graphql = <3
 
Angular 2 - Typescript
Angular 2  - TypescriptAngular 2  - Typescript
Angular 2 - Typescript
 
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
 
TypeScript: Un lenguaje aburrido para programadores torpes y tristes
TypeScript: Un lenguaje aburrido para programadores torpes y tristesTypeScript: Un lenguaje aburrido para programadores torpes y tristes
TypeScript: Un lenguaje aburrido para programadores torpes y tristes
 
TypeScript
TypeScriptTypeScript
TypeScript
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScript
 
Typescript tips & tricks
Typescript tips & tricksTypescript tips & tricks
Typescript tips & tricks
 
TypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponTypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret Weapon
 
Typescript
TypescriptTypescript
Typescript
 
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
 
TypeScriptで忍遊javascript
TypeScriptで忍遊javascriptTypeScriptで忍遊javascript
TypeScriptで忍遊javascript
 

Semelhante a TypeScript

Php Online Training
Php Online TrainingPhp Online Training
Php Online TrainingNagendra Kumar
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)Igor Talevski
 
Web development basics (Part-7)
Web development basics (Part-7)Web development basics (Part-7)
Web development basics (Part-7)Rajat Pratap Singh
 
Abhilash front end ppt.pdf
Abhilash front end ppt.pdfAbhilash front end ppt.pdf
Abhilash front end ppt.pdfvinodpatil406281
 
saikiran front end ppt.pptx
saikiran front end ppt.pptxsaikiran front end ppt.pptx
saikiran front end ppt.pptxvinodpatil406281
 
TypeScript 101
TypeScript 101TypeScript 101
TypeScript 101rachelterman
 
Getting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGetting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGil Fink
 
Selenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfSelenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfAnanthReddy38
 
Selenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfSelenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfAnanthReddy38
 
West Coast DevCon 2014: Programming in UE4 - A Quick Orientation for Coders
West Coast DevCon 2014: Programming in UE4 - A Quick Orientation for CodersWest Coast DevCon 2014: Programming in UE4 - A Quick Orientation for Coders
West Coast DevCon 2014: Programming in UE4 - A Quick Orientation for CodersGerke Max Preussner
 
5variables in c#
5variables in c#5variables in c#
5variables in c#Sireesh K
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!Alessandro Giorgetti
 
David buksbaum a-briefintroductiontocsharp
David buksbaum a-briefintroductiontocsharpDavid buksbaum a-briefintroductiontocsharp
David buksbaum a-briefintroductiontocsharpJorge Antonio Contre Vargas
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaAbhishekMondal42
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesInductive Automation
 

Semelhante a TypeScript (20)

Php Online Training
Php Online TrainingPhp Online Training
Php Online Training
 
TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)TypeScript and Angular2 (Love at first sight)
TypeScript and Angular2 (Love at first sight)
 
Web development basics (Part-7)
Web development basics (Part-7)Web development basics (Part-7)
Web development basics (Part-7)
 
Abhilash front end ppt.pdf
Abhilash front end ppt.pdfAbhilash front end ppt.pdf
Abhilash front end ppt.pdf
 
saikiran front end ppt.pptx
saikiran front end ppt.pptxsaikiran front end ppt.pptx
saikiran front end ppt.pptx
 
TypeScript 101
TypeScript 101TypeScript 101
TypeScript 101
 
06.1 .Net memory management
06.1 .Net memory management06.1 .Net memory management
06.1 .Net memory management
 
Type script
Type scriptType script
Type script
 
Getting Started with the TypeScript Language
Getting Started with the TypeScript LanguageGetting Started with the TypeScript Language
Getting Started with the TypeScript Language
 
Selenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfSelenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdf
 
Selenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdfSelenium-with-Java-Course-Content-Magnitia.pdf
Selenium-with-Java-Course-Content-Magnitia.pdf
 
West Coast DevCon 2014: Programming in UE4 - A Quick Orientation for Coders
West Coast DevCon 2014: Programming in UE4 - A Quick Orientation for CodersWest Coast DevCon 2014: Programming in UE4 - A Quick Orientation for Coders
West Coast DevCon 2014: Programming in UE4 - A Quick Orientation for Coders
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
5variables in c#
5variables in c#5variables in c#
5variables in c#
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
c++ Unit III - PPT.pptx
c++ Unit III - PPT.pptxc++ Unit III - PPT.pptx
c++ Unit III - PPT.pptx
 
TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!TypeScript . the JavaScript developer best friend!
TypeScript . the JavaScript developer best friend!
 
David buksbaum a-briefintroductiontocsharp
David buksbaum a-briefintroductiontocsharpDavid buksbaum a-briefintroductiontocsharp
David buksbaum a-briefintroductiontocsharp
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Design Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best PracticesDesign Like a Pro: Scripting Best Practices
Design Like a Pro: Scripting Best Practices
 

Mais de Udaiappa Ramachandran

RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
Level up your security using Intune.pptx
Level up your security using Intune.pptxLevel up your security using Intune.pptx
Level up your security using Intune.pptxUdaiappa Ramachandran
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxUdaiappa Ramachandran
 
AI-Plugins-Planners-Persona-SemanticKernel.pptx
AI-Plugins-Planners-Persona-SemanticKernel.pptxAI-Plugins-Planners-Persona-SemanticKernel.pptx
AI-Plugins-Planners-Persona-SemanticKernel.pptxUdaiappa Ramachandran
 
Vector Search using OpenAI in Azure Cognitive Search.pptx
Vector Search using OpenAI in Azure Cognitive Search.pptxVector Search using OpenAI in Azure Cognitive Search.pptx
Vector Search using OpenAI in Azure Cognitive Search.pptxUdaiappa Ramachandran
 
SecureAzureServicesUsingADAuthentication.pptx
SecureAzureServicesUsingADAuthentication.pptxSecureAzureServicesUsingADAuthentication.pptx
SecureAzureServicesUsingADAuthentication.pptxUdaiappa Ramachandran
 
Azure Automation and Update Management
Azure Automation and Update ManagementAzure Automation and Update Management
Azure Automation and Update ManagementUdaiappa Ramachandran
 

Mais de Udaiappa Ramachandran (20)

RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
Level up your security using Intune.pptx
Level up your security using Intune.pptxLevel up your security using Intune.pptx
Level up your security using Intune.pptx
 
Building AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptxBuilding AI-Driven Apps Using Semantic Kernel.pptx
Building AI-Driven Apps Using Semantic Kernel.pptx
 
AI-Plugins-Planners-Persona-SemanticKernel.pptx
AI-Plugins-Planners-Persona-SemanticKernel.pptxAI-Plugins-Planners-Persona-SemanticKernel.pptx
AI-Plugins-Planners-Persona-SemanticKernel.pptx
 
DOTNET8.pptx
DOTNET8.pptxDOTNET8.pptx
DOTNET8.pptx
 
AzureSynapse.pptx
AzureSynapse.pptxAzureSynapse.pptx
AzureSynapse.pptx
 
Vector Search using OpenAI in Azure Cognitive Search.pptx
Vector Search using OpenAI in Azure Cognitive Search.pptxVector Search using OpenAI in Azure Cognitive Search.pptx
Vector Search using OpenAI in Azure Cognitive Search.pptx
 
SecureAzureServicesUsingADAuthentication.pptx
SecureAzureServicesUsingADAuthentication.pptxSecureAzureServicesUsingADAuthentication.pptx
SecureAzureServicesUsingADAuthentication.pptx
 
AzureOpenAI.pptx
AzureOpenAI.pptxAzureOpenAI.pptx
AzureOpenAI.pptx
 
OpenAI-Copilot-ChatGPT.pptx
OpenAI-Copilot-ChatGPT.pptxOpenAI-Copilot-ChatGPT.pptx
OpenAI-Copilot-ChatGPT.pptx
 
DiagnoseAndSolveproblems.pptx
DiagnoseAndSolveproblems.pptxDiagnoseAndSolveproblems.pptx
DiagnoseAndSolveproblems.pptx
 
MAUI.pptx
MAUI.pptxMAUI.pptx
MAUI.pptx
 
CosmosDB.pptx
CosmosDB.pptxCosmosDB.pptx
CosmosDB.pptx
 
.NET7.pptx
.NET7.pptx.NET7.pptx
.NET7.pptx
 
AzureDevOps
AzureDevOpsAzureDevOps
AzureDevOps
 
AzureCostManagementAndBilling
AzureCostManagementAndBillingAzureCostManagementAndBilling
AzureCostManagementAndBilling
 
.NET6.pptx
.NET6.pptx.NET6.pptx
.NET6.pptx
 
Azure Automation and Update Management
Azure Automation and Update ManagementAzure Automation and Update Management
Azure Automation and Update Management
 
Azure staticwebapps
Azure staticwebappsAzure staticwebapps
Azure staticwebapps
 
Azure privatelink
Azure privatelinkAzure privatelink
Azure privatelink
 

Último

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Último (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

TypeScript

  • 1. TypeScript Udaiappa Ramachandran ( Udai ) //linkedin.com/in/udair
  • 2. Who am I? • Udaiappa Ramachandran ( Udai ) • CTO, Akumina, Inc., • Consultant • Azure Insider • New Hampshire Cloud User Group (http://www.meetup.com/nashuaug ) • Focus on Cloud Computing (Microsoft Azure and AWS), IoT, SharePoint Online • http://cloudycode.wordpress.com • @nhcloud
  • 3. TypeScript - Agenda • Why & What • Basic Types • Interfaces • Functions • Classes • Generics • Modules • Demo • References • Q & A
  • 4. Typescript • Why • Javascript is dynamic type • Pro– can hold any object, type on the fly • Con- Can get messy over the time • Migration from server-side to client-side will be hard • Hard to manage, difficult to ensure property types • What • Any valid JavaScript is a typescript • Typescriptlang.org • Typescript lets you write JavaScript the way you really want to. • Typescript is a typed superset of JavaScript that compiles to plain JavaScript. • Any browser. Any host. Any OS. Open Source.
  • 5. Typescript Alternatives • Pure JavaScript • Apply JavaScript patterns • Functions as abstractions • Functions to build modules • Functions to avoid global variables • CoffeeScript • Dart
  • 6. Typescript Key Features • Supports standard JavaScript code • Provide static typing • Encapsulation through classes and modules • Support for constructors, properties, functions • Define interfaces • Lambda style function support • Intellisense and syntax checking
  • 7. Typescript tools • Typescript playground • Visual Studio • sublime • Node.js • WebStorm • Eclipse • Vi • IntelliJ • Emacs
  • 9. Tyepscript BasicTypes • Boolean • Number • String • Array • Enum • Enum as Bit Flag 1,2,4,8,16,32,64,128 and so on • Any • Void
  • 10. Tyepscript Annotation • Type Annotation • var [identifier]:[type annotation]=value • var [identifier]:[type annotation]; • var [identifier]=value; • Example
  • 11. Typescript Functions • Optional Parameters using ? • function getAverage(a: number, b: number, c?: number): void { } • Default parameters using =value • function concatenate(items: string[], separator = ",", beginAt = 0, endAt = items.length) :void{ } • Rest parameter using … • Only one allowed, it must appear last in the parameter list and must be an array type • function getSum(...a: number[]): number { • var t = 0;a.forEach(p=>t=t+ p); • return t; • } • var result = getSum(1, 2, 3, 4); • Overloads • Overloads in typescript cannot have own implementation but decorate a single implementation • function getSum(a: string, b: string, c: string): number; • function getSum(a: number, b: number, c: number): number; • function getSum(a: any, b: any, c: any): number { • // implementation signature • return parseInt(a, 10) + parseInt(b, 10) + parseInt(c, 10); • } • Arrow function • var getSum: (a: number, b: number) => number =(x, y) => (x + y);
  • 12. Typescript Interfaces • Interfaces are used at design time to provide auto completion and at compile time to provide type checking • Supported features • Optional properties • Function Types • Array Types • Class Types • Extending Interfaces • Hybrid Types
  • 14. Typescript Classes • Object-oriented class based approach • Key features • Inheritance • Private/public modifiers • Accessors • Static properties • Constructor functions • Using class as an interface
  • 16. Typescript Generics • Supports generic type variables, types, interfaces, classes and constraints
  • 17. Typescript Modules • Encapsulate variables, interfaces, and classes • Define unique namespaces • Organize symbols and identifiers into a logical namespace hierarchy • Similar to namespaces/packages • Splitting across files • Multiple files can use the same module name • One file can contain multiple module • Can define Alias to module • Transpiles to IIFE • Can define modules as internal or external • External modules required only when used with node.js and require.js
  • 19. Typescript Declaration Merging • Concept • Merging Interfaces • Merging Modules • Merging Modules with classes, functions, and Enums • Disallowed Merges
  • 20. Typescript Type inference and Compatibility • Type inference • Basics • Best common type • Contextual Type • Type Compatibility • Starting out • Comparing two functions • Enums • Classes • Generics • Advanced Topics • Common Errors • Mixins
  • 21. Typescript Definition Files • Describes the types defined in external libraries • .d.ts • Not deployed • Usually from DefinitelyTyped • TypeScript Definition manager (tsd) • Specialized package manager • Locates and installs typescript definition files(d.ts) • From the definitelytyped repository
  • 22. Demo
  • 24. Q & A

Notas do Editor

  1. Typescript will still try to create sensible JS code even if compilation error, but it is important to fix the compilation error
  2. Module merging Class Car{ } Module Car { Export Engine{} Export XYZ{} }
  3. IIFE-Immediately Invoked Function Expressions