/
elidedJSImport.types
41 lines (35 loc) · 1.35 KB
/
elidedJSImport.types
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
=== tests/cases/compiler/caller.js ===
import * as fs from 'fs';
>fs : error
import TruffleContract from '@truffle/contract'; // Runtime err: this import is elided in transform
>TruffleContract : any
console.log(fs);
>console.log(fs) : void
>console.log : (...data: any[]) => void
>console : Console
>log : (...data: any[]) => void
>fs : error
console.log('TruffleContract is ', typeof TruffleContract, TruffleContract); // `TruffleContract` is considered 'unused'
>console.log('TruffleContract is ', typeof TruffleContract, TruffleContract) : void
>console.log : (...data: any[]) => void
>console : Console
>log : (...data: any[]) => void
>'TruffleContract is ' : "TruffleContract is "
>typeof TruffleContract : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"
>TruffleContract : error
>TruffleContract : error
=== tests/cases/compiler/node_modules/@truffle/contract/index.d.ts ===
declare module "@truffle/contract" {
>"@truffle/contract" : typeof import("@truffle/contract")
// import { ContractObject } from "@truffle/contract-schema";
interface ContractObject {
foo: number;
>foo : number
}
namespace TruffleContract {
export type Contract = ContractObject;
>Contract : ContractObject
}
export default TruffleContract;
>TruffleContract : any
}