On Mon, Oct 22, 2012 at 6:10 PM, Andrew Grieve <agri...@chromium.org> wrote:
> Not sure I follow your intended purpose for the "header files". Are they > for documentation purposes? > Here's the typescript "header file" for node.js: http://typescript.codeplex.com/SourceControl/changeset/view/fe3bc0bfce1f#samples%2fnode%2fnode.d.ts So, what could you use this for? Presumably, things like: - doc - instrumented version of Cordova that type-checks parameters - linters - code completion in editors, debuggers - showing structure in editors, debuggers > docs for CC interfaces: > > https://developers.google.com/closure/compiler/docs/js-for-compiler#tag-interface I meant "interfaces" generically - should have said "APIs". One of the things you need, if you're going to take the time and hand-code up a type-encrusted machine-readable description of your "API", is to get that type information back out again, for your doc, code completers, etc. Eg, you'd want to "compile" your description into a JSON structure that some other program can read. I don't see the Closure compiler nor TypeScript providing this kind of information. But maybe I'm wrong. It appears Closure uses JSDoc annotations for a lot of this information - and we're already using these types of annotations; perhaps that's a better route to go down, for anyone thinking about playing with this stuff. I'm not sure you can get the "data" description of your API out of JSDoc either, though. -- Patrick Mueller http://muellerware.org