dev:typescript

Differences

This shows you the differences between two versions of the page.


Previous revision
dev:typescript [2023/05/01 17:30] (current) – [Hello World] Henrik Yllemo
Line 1: Line 1:
 +<button type="primary" size="xs" icon="glyphicon glyphicon-bookmark">[[programming_lagugages| Programming Language]]</button> 
 +====== TypeScript ======
 +
 +<data programminglanguage>
 +Full Name: TypeScript
 +Short Name: TS
 +Description: Strict syntactical superset of JavaScript, 
 +Company: Microsoft
 +Web: Yes
 +Mobile: Yes
 +Enterprise: No
 +Embedded : No
 +</data>
 +
 +<accordion>
 +<panel title='What is TypeScript?'>
 +TypeScript is a strongly typed superset of JavaScript that adds optional static typing and other features to the language. It was developed by Microsoft and released in 2012 as an open-source language.
 +</panel><panel title='What are the benefits of using TypeScript?'>
 +Type safety: TypeScript's static type checking helps catch errors early in the development process and makes code easier to maintain and refactor.
 +Improved code organization: TypeScript supports interfaces, classes, and modules, which make it easier to organize and structure larger codebases.
 +Improved editor support: TypeScript offers better editor support than JavaScript, including code completion, refactoring, and error highlighting.
 +Compatibility with existing JavaScript code: TypeScript can be used with existing JavaScript code and libraries, making it easy to adopt gradually.
 +Improved tooling: TypeScript has a robust set of tools, including the TypeScript compiler, which can convert TypeScript code into JavaScript, and many popular editors and IDEs support TypeScript.
 +</panel><panel title='What are some of the key features of TypeScript?'>
 +Some of the key features of TypeScript include:
 +  * Static typing: TypeScript supports static typing, which helps catch errors early in the development process.
 +  * Interfaces: TypeScript supports interfaces, which allow you to define contracts between different parts of your code.
 +  * Classes: TypeScript supports classes, which allow you to define reusable objects with properties and methods.
 +  * Generics: TypeScript supports generics, which allow you to create reusable code that works with different types.
 +  * Decorators: TypeScript supports decorators, which allow you to add metadata to your code that can be used at runtime.
 +</panel><panel title='Can TypeScript be used in production applications?'>
 +Yes, TypeScript can be used in production applications. Many large-scale applications, including Angular and Microsoft's own Visual Studio Code, are built using TypeScript.
 +</panel><panel title='Can TypeScript be used with React?'>
 +Yes, TypeScript can be used with React. In fact, many developers prefer using TypeScript with React because of its improved type checking and editor support.
 +</panel><panel title='How do I get started with TypeScript?'>
 +To get started with TypeScript, you'll need to install the TypeScript compiler and configure your development environment to use it. You can then start writing TypeScript code and compiling it to JavaScript using the compiler. Many popular editors and IDEs, including Visual Studio Code and WebStorm, have built-in support for TypeScript.
 +</panel><panel title='Does TypeScript support asynchronous programming?'>
 +Yes, TypeScript supports asynchronous programming using features like async/await and Promises. These features allow you to write asynchronous code that is more readable and maintainable than traditional callback-based code.
 +</panel>
 +<panel  title='How does TypeScript compare to other programming languages?'>
 +TypeScript is a superset of JavaScript and shares many features with it, but it also includes additional features like static typing, interfaces, and classes. TypeScript is often compared to languages like Java and C#, which also support strong typing and object-oriented programming.
 +</panel>
 +</accordion>
 +
 +
 +{{wp>TypeScript}}
 +<callout type="" title="GitHub Topics" icon="fa fa-github">
 +  * https://github.com/topics/typescript
 +
 +TypeScript is an open source programming language developed by Microsoft and first released in 2012. It is designed to add type safety to JavaScript while conforming as closely as possible to the syntax and semantics of the ECMAScript standard.
 +
 +It is a syntactical superset of the JavaScript programming language; all valid JavaScript source code is also valid TypeScript source code, but not vice-versa. TypeScript compiles (or transpiles) to JavaScript, meaning that it can be utilized to target any JavaScript environment. It can be used to develop JavaScript for both client-side and server-side applications.
 +</callout> 
 +<callout type="" title="Free Programming Books" icon="fa fa-book">
 +  * [[https://learnxinyminutes.com/docs/typescript/|Learn TypeScript in Y Minutes]]
 +  * [[https://exploringjs.com/tackling-ts/toc.html|Tackling TypeScript: Upgrading from JavaScript]] - Dr. Axel Rauschmayer
 +  * [[https://accelerated.amimetic.co.uk|TypeScript Accelerated]] - James Porter
 +  * [[https://basarat.gitbooks.io/typescript/|TypeScript Deep Dive]]
 +  * [[http://www.infoq.com/minibooks/typescript-c-sharp-programmers|TypeScript for C# Programmers]]
 +  * [[https://www.syncfusion.com/resources/techportal/ebooks/typescript|TypeScript Succinctly, Syncfusion]] (PDF, Kindle) (email address //requested//, not required)
 +
 +<WRAP column right><wrap lo>Source: [[https://github.com/EbookFoundation/free-programming-books/blob/main/books/free-programming-books-langs.md|EbookFoundation]]</wrap></WRAP>
 +</callout> 
 +<jumbotron>
 +===== Hello World =====
 +
 +<sxh javascript>
 +var message = 'Hello World';
 +console.log(message);
 +
 +</sxh>
 +<WRAP column right><wrap lo>Source: [[https://en.wikibooks.org/wiki/Computer_Programming/Hello_world|Wikibooks]]</wrap></WRAP>
 +</jumbotron>
 + 
 +
 +
 +
 +See also: [[dev:programming_lagugages]]
 +
 +{{tag>programminglanguage dev-web}}
 +
 +
 +=== ## ToDo ## ===
 +  * FIXME
 +  * Static typing
 +  * Interfaces
 +  * Classes
 +  * Inheritance
 +  * Polymorphism
 +  * Enums
 +  * Generics
 +  * Union and intersection types
 +  * Type guards
 +  * Decorators
 +  * Modules
 +  * Namespaces
 +  * Error handling
 +  * Promises
 +  * Async/await
 +  * Arrow functions
 +  * Template literals
 +  * Type compatibility
 +  * Type aliases
 +  * Declaration files
 +  * Web development (e.g., React, Angular, Vue)
 +  * Node.js
 +  * Deno runtime
 +