swc/crates/swc_ecma_parser/tests/tsc/jsDeclarationsReexportedCjsAlias.ts

30 lines
410 B
TypeScript
Raw Normal View History

// @allowJs: true
// @checkJs: true
// @target: es5
// @outDir: ./out
// @declaration: true
// @filename: lib.js
/**
* @param {string} a
*/
function bar(a) {
return a + a;
}
class SomeClass {
a() {
return 1;
}
}
module.exports = {
bar,
SomeClass
}
// @filename: main.js
const { SomeClass, SomeClass: Another } = require('./lib');
module.exports = {
SomeClass,
Another
}