Skip to content

Support for export import statements #159

Closed
Closed
@fede-s

Description

@fede-s

I have a library that uses requirejs modules and then is published as a node module.
I like to structure my project so that there is only 1 class per file, and then I have 1 file that is the library entry point file that exports all the classes I want to make available.
See the following example

file lib-entry-point.ts

export import ClassA = require('./ClassA');
//Here I change the name of ClassB and would like that it's name on the docs is the name I choose here
export import IChangedTheName = require('./ClassB');
export import module1 = require('./module1');

/**
 * does something
 */
export function aFunction () {

}

file ClassA.ts

/**
 * Class named A
 */
class ClassA  {
}

export = ClassA;

file ClassB.ts

/**
 * Class named B
 */
class ClassB  {
    public name = "B";
}

export = ClassB;

file module1.ts

/**
 * module that exports Class C
 */
export import ClassC = require('./ClassC');

file ClassC.ts

`/**
 * Class named C
 */
class ClassC  {
}

export = ClassC;

To generate the documentation I chose "file" mode and added the 5 files to the src property. What I get is:

screen shot 2015-12-01 at 12 17 24

But, I would like to get this:

screen shot 2015-12-01 at 12 22 26

The problem is that if I want to get that result, ClassB name must be "IChangedTheName" and ClassC has to be contained within module1.ts

/**
 * module that exports Class C
 */
module module1 {
    /**
     * Class named C
     */
    export class ClassC  {
    }
}

export = module1;

So my question is, would it be possible to have typedoc interpreting the structure of the project from the export import statements and be able to set whatever name I want for my class at that point?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions