TypeScript: Difference between revisions
| (3 intermediate revisions by the same user not shown) | |||
| Line 26: | Line 26: | ||
TypeScript does not support overloading in the traditional sense, with multiple implementations. | TypeScript does not support overloading in the traditional sense, with multiple implementations. | ||
However you can have multiple function | However you can have multiple function declarations similar to prototypes. | ||
===Interfaces=== | ===Interfaces=== | ||
[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. | #:<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]] | |||