-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Expand file tree
/
Copy pathjsDeclarationsTypeReferences3.js
More file actions
56 lines (43 loc) · 1.36 KB
/
jsDeclarationsTypeReferences3.js
File metadata and controls
56 lines (43 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//// [tests/cases/conformance/jsdoc/declarations/jsDeclarationsTypeReferences3.ts] ////
//// [index.d.ts]
declare module "fs" {
export class Something {}
}
//// [index.js]
/// <reference types="node" />
const Something = require("fs").Something;
module.exports.A = {}
module.exports.A.B = {
thing: new Something()
}
//// [index.js]
/// <reference types="node" />
var Something = require("fs").Something;
module.exports.A = {};
module.exports.A.B = {
thing: new Something()
};
//// [index.d.ts]
export namespace A {
namespace B {
let thing: Something;
}
}
import Something_1 = require("fs");
import Something = Something_1.Something;
//// [DtsFileErrors]
tests/cases/conformance/jsdoc/declarations/out/index.d.ts(6,30): error TS2307: Cannot find module 'fs' or its corresponding type declarations.
==== tests/cases/conformance/jsdoc/declarations/out/index.d.ts (1 errors) ====
export namespace A {
namespace B {
let thing: Something;
}
}
import Something_1 = require("fs");
~~~~
!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations.
import Something = Something_1.Something;
==== node_modules/@types/node/index.d.ts (0 errors) ====
declare module "fs" {
export class Something {}
}