SlideShare uma empresa Scribd logo
1 de 53
Baixar para ler offline
var inx: number = 1,
   text: string = “Lorem”,
   isReady: bool = false,
   arr: string[],
   obj: ObjInterface = factory.getObj(),
   mixedVal: any;
var obj: { x: number, y: number },
   fn: ( x: number, y?: any ) => number,
   constr: new() => ObjInterface;
var treatItems = function( arr,
    callback ) {
   // do something
   return arr;
};
var treatItems = function(
   arr: string[],
   callback: (value: string,
              inx: number,
              arr: string[]) => string[]) {
       // do something
       return arr;
};
var treatItems = function( arr,
    callback ) {
   // do something
   return arr;
};
class Mamal
{
  private nickname: string;

    constructor( nickname: string = "Noname" ) {
      this.nickname = nickname;
    }

    public getNickname():string {
      return this.nickname;
    }
}
class Cat extends Mamal
{
  private family: string = "Felidae";

    constructor( nickname: string ) {
      super( nickname );
    }

    public getFamily():string {
      return this.family;
    }
}
// Generated JavaScript: helper

var __extends = this.__extends || function (d,
b) {
  function __() { this.constructor = d; }
  __.prototype = b.prototype;
  d.prototype = new __();
}
// Generated JavaScript: classes

var Mamal = (function () { … })();
var Cat = (function (_super) {
  __extends(Cat, _super);
  function Cat(nickname) {
     _super.call(this, nickname);
     this.family = "Felidae";
  }
  Cat.prototype.getFamily = function () {
     return this.family;
  };
  return Cat;
})(Mamal);
interface Point {
  x: number;
  y: number;
}

function getDistance( pointA: Point, pointB: Point ) {
  return Math.sqrt(
         Math.pow( pointB.x - pointA.x, 2 ) +
         Math.pow( pointB.y - pointA.y, 2 )
      );
}

var result = getDistance(
       { x: - 2, y: - 3 }, { x: - 4, y: 4 })
interface Mover
{
  move(): void;
}
interface Shaker
{
  shake(): void;
}
interface MoverShaker extends Mover, Shaker
{
}
module graphic
{
       export class Point
       {
              x: number;
              y: number;
              constructor( x: number = 0, y: number = 0 )
              {
              };
       }
}
var point = new graphic.Point( 10, 10 );
// File main.ts:
import log = module ( "log” );
log.message( "hello" );

// File log.js:
export function message(s: string) {
   console.log(s);
}
(x) => { return Math.sin(x); }
(x) => Math.sin(x);
x => { return Math.sin(x); }
x => Math.sin(x);
var messenger = {
   message: "Hello World",
   start: function() {
     setTimeout( () =>
       { alert( this.message ); }, 3000 );
   }
};
messenger.start();
class Shape { ... }
class Circle extends Shape { ... }

function createShape( kind: string ): Shape {
      if ( kind === "circle" ) return new Circle(); ...
}

var circle = <Circle> createShape( "circle" );
interface JQuery
{
       text(content: string);
}
interface JQueryStatic {
       get(url: string, callback: (data: string) => any);
       (query: string): JQuery;
}
declare var $: JQueryStatic;
/// <reference path="jquery.d.ts" />
module Parallax
{
  export class ParallaxContainer
  {
    private content: HTMLElement;

    constructor( scrollableContent: HTMLElement ) {
      $( scrollableContent ).scroll(( event: JQueryEventObject ) => {
        this.onContainerScroll( event );
      });
    }

    private onContainerScroll( e: JQueryEventObject ) : void {
      // do something
    }
}
gist.github.com/3845543
https://github.com/joyent/node/wiki/In
    stalling-Node.js-via-package-
               manager
npm install -g typescript
tsc example.ts
tsc --target ES5 example.ts
https://github.com/niutech/typescript-
                compile
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="tsc" basedir="." default="build">
  <target name="build">
    <!-- Compile all .ts files -->
    <apply executable="tsc" parallel="true">
      <srcfile/>
      <fileset dir="." includes="**/*.ts"/>
    </apply>
   <!-- Lint all required CSS, JS files -->
    <!-- Concatenate all required CSS, JS files -->
    <!-- Compress built CSS, JS files -->
  </target>
</project>
ant
TypeScript Introduction

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Getting started with typescript
Getting started with typescriptGetting started with typescript
Getting started with typescript
 
TypeScript VS JavaScript.pptx
TypeScript VS JavaScript.pptxTypeScript VS JavaScript.pptx
TypeScript VS JavaScript.pptx
 
TypeScript
TypeScriptTypeScript
TypeScript
 
TypeScript Best Practices
TypeScript Best PracticesTypeScript Best Practices
TypeScript Best Practices
 
Typescript ppt
Typescript pptTypescript ppt
Typescript ppt
 
TypeScript intro
TypeScript introTypeScript intro
TypeScript intro
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
TypeScript
TypeScriptTypeScript
TypeScript
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 
Introduction to Javascript
Introduction to JavascriptIntroduction to Javascript
Introduction to Javascript
 
A Deeper look into Javascript Basics
A Deeper look into Javascript BasicsA Deeper look into Javascript Basics
A Deeper look into Javascript Basics
 
Nestjs MasterClass Slides
Nestjs MasterClass SlidesNestjs MasterClass Slides
Nestjs MasterClass Slides
 
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
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
Type script - advanced usage and practices
Type script  - advanced usage and practicesType script  - advanced usage and practices
Type script - advanced usage and practices
 
Object Oriented Javascript
Object Oriented JavascriptObject Oriented Javascript
Object Oriented Javascript
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 

Destaque

«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21MoscowJS
 
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
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type scriptDmitrii Stoian
 
TypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponTypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponLaurent Duveau
 
Typescript tips & tricks
Typescript tips & tricksTypescript tips & tricks
Typescript tips & tricksOri Calvo
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScriptOffirmo
 
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: особенности разработки / Александр Майоров (Tutu.ru)
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)Ontico
 
TypeScript Seminar
TypeScript SeminarTypeScript Seminar
TypeScript SeminarHaim Michael
 
Angular 2 - Typescript
Angular 2  - TypescriptAngular 2  - Typescript
Angular 2 - TypescriptNathan Krasney
 
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
 

Destaque (16)

«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
«Typescript: кому нужна строгая типизация?», Григорий Петров, MoscowJS 21
 
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
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type script
 
TypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret WeaponTypeScript: Angular's Secret Weapon
TypeScript: Angular's Secret Weapon
 
Typescript
TypescriptTypescript
Typescript
 
Typescript tips & tricks
Typescript tips & tricksTypescript tips & tricks
Typescript tips & tricks
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScript
 
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
 
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)
 
TypeScript Seminar
TypeScript SeminarTypeScript Seminar
TypeScript Seminar
 
Angular 2 - Typescript
Angular 2  - TypescriptAngular 2  - Typescript
Angular 2 - Typescript
 
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
 
TypeScriptで快適javascript
TypeScriptで快適javascriptTypeScriptで快適javascript
TypeScriptで快適javascript
 

Semelhante a TypeScript Introduction

HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6Dmitry Soshnikov
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs偉格 高
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5arajivmordani
 
JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervosoLuis Vendrame
 
EcmaScript unchained
EcmaScript unchainedEcmaScript unchained
EcmaScript unchainedEduard Tomàs
 
Bindings: the zen of montage
Bindings: the zen of montageBindings: the zen of montage
Bindings: the zen of montageKris Kowal
 
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6Dmitry Soshnikov
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScriptkvangork
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascriptkvangork
 
AJUG April 2011 Cascading example
AJUG April 2011 Cascading exampleAJUG April 2011 Cascading example
AJUG April 2011 Cascading exampleChristopher Curtin
 
Type script, for dummies
Type script, for dummiesType script, for dummies
Type script, for dummiessantiagoaguiar
 
ES6 patterns in the wild
ES6 patterns in the wildES6 patterns in the wild
ES6 patterns in the wildJoe Morgan
 

Semelhante a TypeScript Introduction (20)

HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
 
ES6 Overview
ES6 OverviewES6 Overview
ES6 Overview
 
Functional programming using underscorejs
Functional programming using underscorejsFunctional programming using underscorejs
Functional programming using underscorejs
 
The Beauty Of Java Script V5a
The Beauty Of Java Script V5aThe Beauty Of Java Script V5a
The Beauty Of Java Script V5a
 
JavaScript - Agora nervoso
JavaScript - Agora nervosoJavaScript - Agora nervoso
JavaScript - Agora nervoso
 
The Beauty of Java Script
The Beauty of Java ScriptThe Beauty of Java Script
The Beauty of Java Script
 
SDC - Einführung in Scala
SDC - Einführung in ScalaSDC - Einführung in Scala
SDC - Einführung in Scala
 
EcmaScript unchained
EcmaScript unchainedEcmaScript unchained
EcmaScript unchained
 
Bindings: the zen of montage
Bindings: the zen of montageBindings: the zen of montage
Bindings: the zen of montage
 
What's New In C# 7
What's New In C# 7What's New In C# 7
What's New In C# 7
 
ES6, WTF?
ES6, WTF?ES6, WTF?
ES6, WTF?
 
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6
 
Academy PRO: ES2015
Academy PRO: ES2015Academy PRO: ES2015
Academy PRO: ES2015
 
Scala in practice
Scala in practiceScala in practice
Scala in practice
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScript
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascript
 
AJUG April 2011 Cascading example
AJUG April 2011 Cascading exampleAJUG April 2011 Cascading example
AJUG April 2011 Cascading example
 
Type script, for dummies
Type script, for dummiesType script, for dummies
Type script, for dummies
 
Advanced JavaScript
Advanced JavaScript Advanced JavaScript
Advanced JavaScript
 
ES6 patterns in the wild
ES6 patterns in the wildES6 patterns in the wild
ES6 patterns in the wild
 

Mais de Dmitry Sheiko

The Flavor of TypeScript
The Flavor of TypeScriptThe Flavor of TypeScript
The Flavor of TypeScriptDmitry Sheiko
 
Writing Scalable and Maintainable CSS
Writing Scalable and Maintainable CSSWriting Scalable and Maintainable CSS
Writing Scalable and Maintainable CSSDmitry Sheiko
 
Tooling JavaScript to ensure consistency in coding style
Tooling JavaScript to ensure consistency in coding styleTooling JavaScript to ensure consistency in coding style
Tooling JavaScript to ensure consistency in coding styleDmitry Sheiko
 
JavaScript MV* Framework - Making the Right Choice
JavaScript MV* Framework - Making the Right ChoiceJavaScript MV* Framework - Making the Right Choice
JavaScript MV* Framework - Making the Right ChoiceDmitry Sheiko
 
Modular JavaScript with CommonJS Compiler
Modular JavaScript with CommonJS CompilerModular JavaScript with CommonJS Compiler
Modular JavaScript with CommonJS CompilerDmitry Sheiko
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with GitDmitry Sheiko
 
Bringing classical OOP into JavaScript
Bringing classical OOP into JavaScriptBringing classical OOP into JavaScript
Bringing classical OOP into JavaScriptDmitry Sheiko
 

Mais de Dmitry Sheiko (7)

The Flavor of TypeScript
The Flavor of TypeScriptThe Flavor of TypeScript
The Flavor of TypeScript
 
Writing Scalable and Maintainable CSS
Writing Scalable and Maintainable CSSWriting Scalable and Maintainable CSS
Writing Scalable and Maintainable CSS
 
Tooling JavaScript to ensure consistency in coding style
Tooling JavaScript to ensure consistency in coding styleTooling JavaScript to ensure consistency in coding style
Tooling JavaScript to ensure consistency in coding style
 
JavaScript MV* Framework - Making the Right Choice
JavaScript MV* Framework - Making the Right ChoiceJavaScript MV* Framework - Making the Right Choice
JavaScript MV* Framework - Making the Right Choice
 
Modular JavaScript with CommonJS Compiler
Modular JavaScript with CommonJS CompilerModular JavaScript with CommonJS Compiler
Modular JavaScript with CommonJS Compiler
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
 
Bringing classical OOP into JavaScript
Bringing classical OOP into JavaScriptBringing classical OOP into JavaScript
Bringing classical OOP into JavaScript
 

Último

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 

TypeScript Introduction

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. var inx: number = 1, text: string = “Lorem”, isReady: bool = false, arr: string[], obj: ObjInterface = factory.getObj(), mixedVal: any;
  • 18. var obj: { x: number, y: number }, fn: ( x: number, y?: any ) => number, constr: new() => ObjInterface;
  • 19. var treatItems = function( arr, callback ) { // do something return arr; };
  • 20. var treatItems = function( arr: string[], callback: (value: string, inx: number, arr: string[]) => string[]) { // do something return arr; };
  • 21. var treatItems = function( arr, callback ) { // do something return arr; };
  • 22.
  • 23. class Mamal { private nickname: string; constructor( nickname: string = "Noname" ) { this.nickname = nickname; } public getNickname():string { return this.nickname; } }
  • 24. class Cat extends Mamal { private family: string = "Felidae"; constructor( nickname: string ) { super( nickname ); } public getFamily():string { return this.family; } }
  • 25. // Generated JavaScript: helper var __extends = this.__extends || function (d, b) { function __() { this.constructor = d; } __.prototype = b.prototype; d.prototype = new __(); }
  • 26. // Generated JavaScript: classes var Mamal = (function () { … })(); var Cat = (function (_super) { __extends(Cat, _super); function Cat(nickname) { _super.call(this, nickname); this.family = "Felidae"; } Cat.prototype.getFamily = function () { return this.family; }; return Cat; })(Mamal);
  • 27.
  • 28. interface Point { x: number; y: number; } function getDistance( pointA: Point, pointB: Point ) { return Math.sqrt( Math.pow( pointB.x - pointA.x, 2 ) + Math.pow( pointB.y - pointA.y, 2 ) ); } var result = getDistance( { x: - 2, y: - 3 }, { x: - 4, y: 4 })
  • 29. interface Mover { move(): void; } interface Shaker { shake(): void; } interface MoverShaker extends Mover, Shaker { }
  • 30.
  • 31. module graphic { export class Point { x: number; y: number; constructor( x: number = 0, y: number = 0 ) { }; } } var point = new graphic.Point( 10, 10 );
  • 32. // File main.ts: import log = module ( "log” ); log.message( "hello" ); // File log.js: export function message(s: string) { console.log(s); }
  • 33.
  • 34. (x) => { return Math.sin(x); } (x) => Math.sin(x); x => { return Math.sin(x); } x => Math.sin(x);
  • 35. var messenger = { message: "Hello World", start: function() { setTimeout( () => { alert( this.message ); }, 3000 ); } }; messenger.start();
  • 36.
  • 37. class Shape { ... } class Circle extends Shape { ... } function createShape( kind: string ): Shape { if ( kind === "circle" ) return new Circle(); ... } var circle = <Circle> createShape( "circle" );
  • 38.
  • 39. interface JQuery { text(content: string); } interface JQueryStatic { get(url: string, callback: (data: string) => any); (query: string): JQuery; } declare var $: JQueryStatic;
  • 40.
  • 41. /// <reference path="jquery.d.ts" /> module Parallax { export class ParallaxContainer { private content: HTMLElement; constructor( scrollableContent: HTMLElement ) { $( scrollableContent ).scroll(( event: JQueryEventObject ) => { this.onContainerScroll( event ); }); } private onContainerScroll( e: JQueryEventObject ) : void { // do something } }
  • 43.
  • 44.
  • 45. https://github.com/joyent/node/wiki/In stalling-Node.js-via-package- manager
  • 46. npm install -g typescript
  • 48. tsc --target ES5 example.ts
  • 50.
  • 51. <?xml version="1.0"?> <!DOCTYPE project> <project name="tsc" basedir="." default="build"> <target name="build"> <!-- Compile all .ts files --> <apply executable="tsc" parallel="true"> <srcfile/> <fileset dir="." includes="**/*.ts"/> </apply> <!-- Lint all required CSS, JS files --> <!-- Concatenate all required CSS, JS files --> <!-- Compress built CSS, JS files --> </target> </project>
  • 52. ant