Jump to content

Pahser Typescript definition does not contain js doc comments!


ursuletzu
 Share

Recommended Posts

If I'm not mistaken, it should be possible to tweak:

 

    https://github.com/joshheyse/jsdocts/blob/master/templates/typescript/module.tmpl

 

to include the description. I don't have the doc compilation set up, but something like the following should at least get return types and descriptions.

<for each="module" in="data"><if test="module.name != '{GLOBAL}'">declare module {+module.name+} { </if>  <for each="cls" in="module.classes">  export interface {+cls.name+} <if test="cls.inheritsFrom">extends {+ cls.inheritsFrom +} </if> {   <if test="cls.properties.length">    <for each="property" in="cls.properties">      <if test="property.isStatic">static </if>{+property.name+}<if test="property.type">: {+property.type+}</if>;</for></if>  <if test="cls.methods.length"><for each="method" in="cls.methods">      /**       <if test="method.description">* {+ method.description +}</if>       <if test="method.returnType">* @type {{+method.returnType+}}</if>       */      <if test="method.isStatic">static </if>{+method.name+}{+makeSignature(method.params)+}<if test="method.returnType">: {+method.returnType+}</if>;</for>  </if>}</for>  <if test="module.name != '{GLOBAL}'">    }  </if></for>

Note: publish.js would also need to be edited to pass through the description in mapMethod. This could actually do the wrapping and star adding too.

Link to comment
Share on other sites

In the same area, TypeScript,

it seems that some definitions are not accurate:

 

a) some method parameters should be marked as optional

B) some methods need overload for example the game constructor.

c) Typescript 0,9.1.1 seems to have a big problem that Phaser class is also a module. I had to define a separate PhaserConsts class.

 

 

Regards

Link to comment
Share on other sites

  • 1 year later...
  • 2 weeks later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...