TypeScript Version: Version 3.1.0-dev.20180804
Search Terms: UMD module import export as namespace
Code
// declaration.d.ts
export = angular;
export as namespace angular;
declare namespace angular {
export interface Scope {}
}
export {};
// user.ts
export {}; // make me a module
let scope: angular.Scope; // no import!
Expected behavior:
Should fail to compile, as user.ts is a module, but has no import for angular. The global should only be available in scripts, according to the docs:
https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#support-for-umd-module-definitions
Actual behavior:
Compiles without errors.
Playground Link: n/a, needs multiple files.
I believe this to be a regression, at least at some point TS worked as documented, giving an error here.
TypeScript Version: Version 3.1.0-dev.20180804
Search Terms: UMD module import export as namespace
Code
Expected behavior:
Should fail to compile, as
user.tsis a module, but has no import forangular. The global should only be available in scripts, according to the docs:https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#support-for-umd-module-definitions
Actual behavior:
Compiles without errors.
Playground Link: n/a, needs multiple files.
I believe this to be a regression, at least at some point TS worked as documented, giving an error here.