-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix]
named
/ExportMap
: Fix ExportMap for a merged typescript name…
…space A typescript namespace may be declared multiple times, it is then merged together and considered to be a single declaration from consuming code. In the case where a merged namespace is assigned as the export from a module then the declarations from all the instances of the namespace in the AST need to be considered as exported.
- Loading branch information
Showing
4 changed files
with
68 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
export = AssignedNamespace; | ||
|
||
declare namespace AssignedNamespace { | ||
type MyType = string | ||
enum MyEnum { | ||
Foo, | ||
Bar, | ||
Baz | ||
} | ||
} | ||
|
||
declare namespace AssignedNamespace { | ||
interface Foo { | ||
native: string | number | ||
typedef: MyType | ||
enum: MyEnum | ||
} | ||
|
||
abstract class Bar { | ||
abstract foo(): Foo | ||
|
||
method(); | ||
} | ||
|
||
export function getFoo() : MyType; | ||
|
||
export module MyModule { | ||
export function ModuleFunction(); | ||
} | ||
|
||
export namespace MyNamespace { | ||
export function NamespaceFunction(); | ||
|
||
export module NSModule { | ||
export function NSModuleFunction(); | ||
} | ||
} | ||
|
||
// Export-assignment exports all members in the namespace, explicitly exported or not. | ||
// interface NotExported {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters