Question

Will TypeScript support any of those great MV* frameworks.

I know it's too early to ask this, but what about the chances to reach support for them with this young javascript initiative?

Was it helpful?

Solution

TypeScript already supports these and every other JavaScript library. Any JavaScript code is valid TypeScript code.

Obviously to see any benefits from TypeScript these libraries would need to add type annotations, this can be done unobtrusively by creating Declaration Source Files (files with a .d.ts extension). These are basically header files that describe the type information associated with existing JavaScript code.

It is obviously outside the scope of the TypeScript project to create these Declaration Source Files for every popular JavaScript library. It is up to those projects and the community to contribute this.

You can view a sample Declaration Source File for jQuery that is included in the TypeScript samples.

OTHER TIPS

DefinitelyTyped has already covered most (if not all) of mv* JavaScript frameworks. They have definitions for angularjs, backbone, ember, knockout and more. Check it out.

  1. All JavaScript is TypeScript.
  2. MV* frameworks are JavaScript.
  3. Therefore, MV* frameworks are TypeScript.

Here is an interesting article talking about TypeScript and AngularJS

http://www.piotrwalat.net/using-typescript-with-angularjs-and-web-api/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top