Skip to content

Commit 1ccca03

Browse files
Merge pull request TypeStrong#142 from aciccarello/default-export-fix
Added check for localSymbol
2 parents 71ab648 + c8d710a commit 1ccca03

File tree

2 files changed

+69
-1
lines changed

2 files changed

+69
-1
lines changed

bin/typedoc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3789,7 +3789,13 @@ var td;
37893789
if (!name) {
37903790
if (!node.symbol)
37913791
return null;
3792-
name = node.symbol.name;
3792+
// Get name (even of default export)
3793+
if (node.localSymbol) {
3794+
name = node.localSymbol.name;
3795+
}
3796+
else {
3797+
name = node.symbol.name;
3798+
}
37933799
}
37943800
// Test whether the node is exported
37953801
var isExported;

examples/basic/src/default-export.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/**
2+
* This class is exported under a different name. The exported name is
3+
* "ExportedClassName"
4+
*
5+
* ```JavaScript
6+
* export {NotExportedClassName as ExportedClassName};
7+
* ```
8+
*/
9+
class NotExportedClassName
10+
{
11+
/**
12+
* Property of NotExportedClassName class.
13+
*/
14+
public notExportedProperty:string;
15+
16+
17+
/**
18+
* This is the constructor of the NotExportedClassName class.
19+
*/
20+
constructor() { }
21+
22+
23+
/**
24+
* Method of NotExportedClassName class.
25+
*/
26+
public getNotExportedProperty():string {
27+
return this.notExportedProperty;
28+
}
29+
}
30+
31+
32+
/**
33+
* This class is exported via es6 export syntax.
34+
*
35+
* ```
36+
* export default class DefaultExportedClass
37+
* ```
38+
*/
39+
export default class DefaultExportedClass
40+
{
41+
/**
42+
* Property of default exported class.
43+
*/
44+
public exportedProperty:string;
45+
46+
47+
/**
48+
* This is the constructor of the default exported class.
49+
*/
50+
constructor() { }
51+
52+
53+
/**
54+
* Method of default exported class.
55+
*/
56+
public getExportedProperty():string {
57+
return this.exportedProperty;
58+
}
59+
}
60+
61+
// Rename class on export
62+
export {NotExportedClassName as ExportedClassName};

0 commit comments

Comments
 (0)