TypeScript Version: 2.6.2 & 2.7.0-dev.20171216
Code
// module.d.ts (from the AngularJS typings)
declare var angular: angular.IAngularStatic;
export = angular;
export as namespace angular;
declare namespace angular {
export interface Module {}
interface IAngularStatic {
module(): Module;
}
}
// globalize.d.ts
import * as alias from './module';
declare global {
const angular: typeof alias;
}
// user.ts
export const foo = angular.module();
Compile with tsc --declaration
Expected behavior:
In TS2.5, this compiles fine, and produces a .d.ts with export const foo: angular.Module;, i.e. using the global alias for the module-scoped type.
Actual behavior:
In TS2.6+, this complains the symbol cannot be named:
user.ts(2,14): error TS4023: Exported variable 'foo' has or is using name 'angular.Module' from external module ".../module" but cannot be named.
TypeScript Version: 2.6.2 & 2.7.0-dev.20171216
Code
Compile with
tsc --declarationExpected behavior:
In TS2.5, this compiles fine, and produces a
.d.tswithexport const foo: angular.Module;, i.e. using the global alias for the module-scoped type.Actual behavior:
In TS2.6+, this complains the symbol cannot be named: