Closed kevindstanley1988 closed 9 years ago
This is great. However, I haven't used TypeScript yet, can you explain how this works?
Yes I can try to explain. Javascript isn't a statically typed language and by that I mean when programming you can freely type pretty much anything. By having a definition intellisense can aid in the typing of properties and functions. When i tell my javascript variable what type definition I am using it will give me the options available like below. Since I defined the variable as an IAzureParameters type it is smart enough to give me properties as suggestions.
Typescript is powerful enough that Angular 2.0 is being developed completely in Typescript. You can read more about that here. http://blogs.msdn.com/b/typescript/archive/2015/03/05/angular-2-0-built-on-typescript.aspx
Typescript is an open source development tool and can be used on a multitude of development environments and you can mix and match how much typescript you want to use. Typescript gets converted to javascript, kind of like coffeescript or AtScript the difference though is that all javascript is valid typescript, which makes for learning it easy especially if you already know javascript in depth. You can read more about it here. http://www.typescriptlang.org/
There is also a repository specifically made for using the typescript definitions on other javascript library's. https://github.com/borisyankov/DefinitelyTyped If you write your projects in Typescript though you don't need to make a definition since the source typescript is the definition itself.
The file I have provided is just a definition for the library that you wrote. Since your library was in javascript I wasn't getting my smart environment which I like so I just wrote a definition and tell my environment which pieces parts I am using. If I code things incorrectly the development tool will give me an error when the typescript is compiling down to javascript.
If you use Typescript here is a good start on the type definition for this library.