TypeScript/tests/cases/conformance/salsa/varRequireFromJavascript.ts
2018-03-08 11:11:51 -08:00

31 lines
413 B
TypeScript

// @allowJs: true
// @checkJs: true
// @strict: true
// @noEmit: true
// @Filename: ex.js
export class Crunch {
/** @param {number} n */
constructor(n) {
this.n = n
}
m() {
return this.n
}
}
// @Filename: use.js
var ex = require('./ex')
// values work
var crunch = new ex.Crunch(1);
crunch.n
// types work
/**
* @param {ex.Crunch} wrap
*/
function f(wrap) {
wrap.n
}