TypeScript/tests/cases/conformance/moduleResolution/typesVersions.ambientModules.ts

39 lines
817 B
TypeScript
Raw Normal View History

2018-08-18 03:27:45 +02:00
// @traceResolution: true
// @target: esnext
// @module: commonjs
// @noImplicitReferences: true
// @filename: node_modules/ext/package.json
{
"name": "ext",
"version": "1.0.0",
"types": "index",
"typesVersions": {
2018-08-29 02:24:02 +02:00
">=3.1.0-0": { "*" : ["ts3.1/*"] }
2018-08-18 03:27:45 +02:00
}
}
// @filename: node_modules/ext/index.d.ts
declare module "ext" {
export const a = "default a";
}
declare module "ext/other" {
export const b = "default b";
}
2018-08-28 20:44:40 +02:00
// @filename: node_modules/ext/ts3.1/index.d.ts
2018-08-18 03:27:45 +02:00
declare module "ext" {
2018-08-28 20:44:40 +02:00
export const a = "ts3.1 a";
2018-08-18 03:27:45 +02:00
}
declare module "ext/other" {
2018-08-28 20:44:40 +02:00
export const b = "ts3.1 b";
2018-08-18 03:27:45 +02:00
}
// @filename: main.ts
import { a } from "ext";
import { b } from "ext/other";
2018-08-28 20:44:40 +02:00
const aa: "ts3.1 a" = a;
const bb: "ts3.1 b" = b;
2018-08-18 03:27:45 +02:00
// @filename: tsconfig.json
{}