spatools / ts2jsdoc

A JSDoc plugin with an optional template which automatically adds JSDoc comments based on Typescript definitions.
MIT License
13 stars 5 forks source link

Not exporting interfaces in modules #3

Open AdamHarte opened 8 years ago

AdamHarte commented 8 years ago

I have the following file I want to create docs from:

test-lib.d.ts

declare module "test-module" {
    interface TestOptions {
        token: string;
    }
    export function create(options: TestOptions): void;
}

I am using the following config:

{
    "source": {
        "includePattern": "(\\.d)?\\.ts$"
    },
    "plugins": [
        "node_modules/ts2jsdoc/plugin.js"
    ],
    "opts": {
        "template": "node_modules/ts2jsdoc/template"
    }
}

Then I run this command to generate my docs: jsdoc -c conf.json test-lib.d.ts

When I navigate to the TestOptions interface in the generated docs, it is just a blank page, no mention of the token property at all.

If I have the interface at root level (outside the module) then the property shows in the docs. Seems like it doesn't like interfaces inside modules.

SomaticIT commented 8 years ago

Hi,

Did you try to export the interface ?

declare module "test-module" {
    export interface TestOptions {
        token: string;
    }

    export function create(options: TestOptions): void;
}