BowlerHatLLC / dts2as

Convert TypeScript definitions (d.ts files) into ActionScript classes and interfaces for use as external libraries with Apache FlexJS
https://www.npmjs.com/package/dts2as
Apache License 2.0
39 stars 4 forks source link

Add argument to enable function parameters and properties to be typed as strict interfaces instead of falling back to Object #3

Open joshtynjala opened 9 years ago

joshtynjala commented 9 years ago

TypeScript interfaces are looser than ActionScript interfaces because they allow any object to be passed to function parameters or properties as long as it has the required members. The object's class doesn't need to explicitly implement the interface. ActionScript interfaces must always be explicitly implemented.

dts2as types these parameters or properties as Object so that developers don't need to manually implement the interface. This is usually the most desirable behavior when working with JavaScript libraries, but there may be edge cases where a developer might want to use a strict interface.