mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
26 lines
866 B
TypeScript
26 lines
866 B
TypeScript
//// [tests/cases/compiler/elidedJSImport1.ts] ////
|
|
|
|
//// [caller.js]
|
|
import * as fs from 'fs';
|
|
import TruffleContract from '@truffle/contract'; // Runtime err: this import is elided in transform
|
|
console.log(fs);
|
|
console.log('TruffleContract is ', typeof TruffleContract, TruffleContract); // `TruffleContract` is considered 'unused'
|
|
|
|
|
|
//// [index.d.ts]
|
|
declare module "@truffle/contract" {
|
|
interface ContractObject {
|
|
foo: number;
|
|
}
|
|
namespace TruffleContract {
|
|
export type Contract = ContractObject;
|
|
}
|
|
export default TruffleContract;
|
|
}
|
|
|
|
//// [caller.js]
|
|
import * as fs from 'fs';
|
|
import TruffleContract from '@truffle/contract'; // Runtime err: this import is elided in transform
|
|
console.log(fs);
|
|
console.log('TruffleContract is ', typeof TruffleContract, TruffleContract); // `TruffleContract` is considered 'unused'
|