-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts files
Milestone
Description
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.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Declaration EmitThe issue relates to the emission of d.ts filesThe issue relates to the emission of d.ts files