mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
59 lines
1.1 KiB
TypeScript
59 lines
1.1 KiB
TypeScript
//// [tests/cases/compiler/jsDeclarationsRequireImportForms.ts] ////
|
|
|
|
//// [obj.js]
|
|
class Obj {
|
|
constructor() {
|
|
this.x = 12;
|
|
}
|
|
}
|
|
module.exports.Obj = Obj
|
|
//// [index.js]
|
|
const {Obj, Obj: Other} = require("./obj");
|
|
|
|
class Container {
|
|
constructor() {
|
|
this.usage = new Obj();
|
|
/** @type {Other} */
|
|
this.usage2 = new Other();
|
|
}
|
|
}
|
|
|
|
module.exports = Container;
|
|
|
|
//// [obj.js]
|
|
"use strict";
|
|
class Obj {
|
|
constructor() {
|
|
this.x = 12;
|
|
}
|
|
}
|
|
module.exports.Obj = Obj;
|
|
//// [index.js]
|
|
"use strict";
|
|
const { Obj, Obj: Other } = require("./obj");
|
|
class Container {
|
|
constructor() {
|
|
this.usage = new Obj();
|
|
/** @type {Other} */
|
|
this.usage2 = new Other();
|
|
}
|
|
}
|
|
module.exports = Container;
|
|
|
|
|
|
//// [obj.d.ts]
|
|
export { Obj };
|
|
declare class Obj {
|
|
x: number;
|
|
constructor();
|
|
}
|
|
//// [index.d.ts]
|
|
export = Container;
|
|
import { Obj, Obj as Other } from "./obj";
|
|
declare class Container {
|
|
usage: Obj;
|
|
/** @type {Other} */
|
|
usage2: Other;
|
|
constructor();
|
|
}
|