TypeScript: Difference between revisions

 
(2 intermediate revisions by the same user not shown)
Line 31: Line 31:
[https://www.typescriptlang.org/docs/handbook/interfaces.html Interfaces]
[https://www.typescriptlang.org/docs/handbook/interfaces.html Interfaces]


Unlike JavaScript, TypeScript comes with support for interfaces:
Unlike JavaScript, TypeScript comes with support for interfaces.<br>
You can treat these interfaces as types or structs.
<syntaxhighlight lang="typescript">
<syntaxhighlight lang="typescript">
interface LabeledValue {
interface LabeledValue {
Line 54: Line 55:
#:<pre>npm install -g typescript</pre>
#:<pre>npm install -g typescript</pre>
# Compile your typescript file
# Compile your typescript file
#:<pre>tsc greeter.js</pre>
#:<pre>tsc greeter.ts</pre>


===webpack===
===webpack===
Line 64: Line 65:
==Resources==
==Resources==
* [https://www.typescriptlang.org/docs/handbook/intro.html The TypeScript Handbook]
* [https://www.typescriptlang.org/docs/handbook/intro.html The TypeScript Handbook]
[[Category:Programming languages]]