You can now generate TypeScript definition (
files from either
.winmd assembly files. Allowing you to leverage these
WinJS or other client side software
applications with all the type safety and benefits of TypeScript.
I know of two main scenarios where I think this could be useful.
- If you build a 'Modern' (come on, we still call it Metro) Windows 8 app
WinJSand want to leverage
TypeScript, wouldn't it be nice to get a set of TypeScript Definition files that reflect the native API's you're calling in the platform without manually creating the definition files?
Install via Chocolatey
You can see the Chocolatey package here: ToTypeScriptD package
ToTypeScriptD winmd "C:\Program Files (x86)\Windows Kits\8.0\References\CommonConfiguration\Neutral\Windows.winmd"
ToTypeScriptD winmd C:\Windows\System32\WinMetadata\Windows.Foundation.winmd C:\Windows\System32\WinMetadata\Windows.Networking.winmd
ToTypeScriptD winmd --specialTypes C:\Windows\System32\WinMetadata\Windows.Foundation.winmd
ToTypeScriptD winmd --specialTypes C:\Windows\System32\WinMetadata\Windows.Foundation.winmd --regexFilter "Windows.Foundation.Collections"
Checkout the project milestones, suggest a feature, bug etc. Or even better, submit a pull request.
Checkout the Contribution guide.
By loading assembly metadata with Mono.Cecil which can read any Ecma 355 Common Language Infrastructure (CLI) file, we can generate a set of TypeScript definition files that allow us to project the type system from these assemblies into TypeScript Definition files. Cool eh?