Skip to content
This repository was archived by the owner on Jan 14, 2019. It is now read-only.

Commit 13e2a24

Browse files
armano2JamesHenry
authored andcommitted
feat: add optional global flag to TSModuleDeclaration for global augmentations (#38)
1 parent 7599aba commit 13e2a24

File tree

4 files changed

+453
-0
lines changed

4 files changed

+453
-0
lines changed

src/convert.ts

+3
Original file line numberDiff line numberDiff line change
@@ -2527,6 +2527,9 @@ export default function convert(config: ConvertConfig): ESTreeNode | null {
25272527
}
25282528
// apply modifiers first...
25292529
applyModifiersToResult((node as any).modifiers);
2530+
if (node.flags & ts.NodeFlags.GlobalAugmentation) {
2531+
result.global = true;
2532+
}
25302533
// ...then check for exports
25312534
result = nodeUtils.fixExports(node, result as any, ast);
25322535
break;

src/temp-types-based-on-js-source.ts

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export interface ESTreeNode {
3232
decorators?: any;
3333
const?: boolean;
3434
declare?: boolean;
35+
global?: boolean;
3536
modifiers?: any;
3637
body?: any;
3738
params?: any;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
declare global {
2+
declare module global {
3+
4+
}
5+
declare namespace global {
6+
7+
}
8+
}

0 commit comments

Comments
 (0)