rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[api-extractor] [api-documenter] Why type is not documented like interface

Open marcinvalas opened this issue 6 years ago • 0 comments

Is this a feature or a bug?

  • [x] Feature
  • [ ] Bug

Please describe the actual behavior. I am curious why type's are threaded differently than interface's?

When I am using api-extractor and api-documenter markdown, then interface's are well described, including files annotations its types and tsDoc, while type's looks like injecting source code into documentation, no field description, no tsDoc, no field type

please look at examples:

  • interface

    /**
    * description for `TestInterface`
    */   
    export interface TestInterface {
    testProp: boolean;
    /**
     * description of `testFunction`
     * @param test some test number
     */
    testFunction: (test: number) => Promise<void>;
    }
    

    the documentation output from above code: image

  • type

    /**
     * description for `TestType`
     */
    export type TestType = {
      testProp: boolean;
      /**
       * description of `testFunction`
       * @param test some test number
       */
      testFunction: (test: number) => Promise<void>;
    };
    

    image

So my questions are:

  • Is there any way to change that (to override the default behavior)?
  • Why it is working in that way?

I was looking into the output from api-extractor (the *.api.json file) and I actually found that type is exported in different than interface way. So potential changes should be done on api-extractor

marcinvalas avatar Apr 02 '20 09:04 marcinvalas