@@ -445,6 +445,26 @@ export class ExportAnalyzer {
445
445
// Example: " ExportName as RenamedName"
446
446
const exportSpecifier : ts . ExportSpecifier = declaration as ts . ExportSpecifier ;
447
447
exportName = ( exportSpecifier . propertyName || exportSpecifier . name ) . getText ( ) . trim ( ) ;
448
+ } else if ( declaration . kind === ts . SyntaxKind . NamespaceExport ) {
449
+ // EXAMPLE:
450
+ // "export * as theLib from 'the-lib';"
451
+ //
452
+ // ExportDeclaration:
453
+ // ExportKeyword: pre=[export] sep=[ ]
454
+ // NamespaceExport:
455
+ // AsteriskToken: pre=[*] sep=[ ]
456
+ // AsKeyword: pre=[as] sep=[ ]
457
+ // Identifier: pre=[theLib] sep=[ ]
458
+ // FromKeyword: pre=[from] sep=[ ]
459
+ // StringLiteral: pre=['the-lib']
460
+ // SemicolonToken: pre=[;]
461
+
462
+ // Issue tracking this feature: https://github.com/microsoft/rushstack/issues/2780
463
+ throw new Error (
464
+ `The "export * as ___" syntax is not supported yet; as a workaround,` +
465
+ ` use "import * as ___" with a separate "export { ___ }" declaration\n` +
466
+ SourceFileLocationFormatter . formatDeclaration ( declaration )
467
+ ) ;
448
468
} else {
449
469
throw new InternalError (
450
470
`Unimplemented export declaration kind: ${ declaration . getText ( ) } \n` +
@@ -505,9 +525,8 @@ export class ExportAnalyzer {
505
525
506
526
if ( externalModulePath === undefined ) {
507
527
const astModule : AstModule = this . _fetchSpecifierAstModule ( importDeclaration , declarationSymbol ) ;
508
- let namespaceImport : AstNamespaceImport | undefined = this . _astNamespaceImportByModule . get (
509
- astModule
510
- ) ;
528
+ let namespaceImport : AstNamespaceImport | undefined =
529
+ this . _astNamespaceImportByModule . get ( astModule ) ;
511
530
if ( namespaceImport === undefined ) {
512
531
namespaceImport = new AstNamespaceImport ( {
513
532
namespaceName : declarationSymbol . name ,
0 commit comments