/
elidedJSImport1.errors.txt
31 lines (27 loc) · 1.78 KB
/
elidedJSImport1.errors.txt
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
tests/cases/compiler/caller.js(1,21): error TS2307: Cannot find module 'fs' or its corresponding type declarations.
tests/cases/compiler/caller.js(2,8): error TS18042: 'TruffleContract' is a type and cannot be imported in JavaScript files. Use 'import("@truffle/contract").TruffleContract' in a JSDoc type annotation.
tests/cases/compiler/caller.js(4,43): error TS2708: Cannot use namespace 'TruffleContract' as a value.
tests/cases/compiler/caller.js(4,60): error TS2708: Cannot use namespace 'TruffleContract' as a value.
==== tests/cases/compiler/caller.js (4 errors) ====
import * as fs from 'fs';
~~~~
!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations.
import TruffleContract from '@truffle/contract'; // Runtime err: this import is elided in transform
~~~~~~~~~~~~~~~
!!! error TS18042: 'TruffleContract' is a type and cannot be imported in JavaScript files. Use 'import("@truffle/contract").TruffleContract' in a JSDoc type annotation.
console.log(fs);
console.log('TruffleContract is ', typeof TruffleContract, TruffleContract); // `TruffleContract` is considered 'unused'
~~~~~~~~~~~~~~~
!!! error TS2708: Cannot use namespace 'TruffleContract' as a value.
~~~~~~~~~~~~~~~
!!! error TS2708: Cannot use namespace 'TruffleContract' as a value.
==== tests/cases/compiler/node_modules/@truffle/contract/index.d.ts (0 errors) ====
declare module "@truffle/contract" {
interface ContractObject {
foo: number;
}
namespace TruffleContract {
export type Contract = ContractObject;
}
export default TruffleContract;
}