mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
be5de2a808
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jakebailey <[email protected]>
53 lines
1.5 KiB
TypeScript
53 lines
1.5 KiB
TypeScript
//// [tests/cases/compiler/declarationEmitForModuleImportingModuleAugmentationRetainsImport.ts] ////
|
|
|
|
//// [child1.ts]
|
|
import { ParentThing } from './parent';
|
|
|
|
declare module './parent' {
|
|
interface ParentThing {
|
|
add: (a: number, b: number) => number;
|
|
}
|
|
}
|
|
|
|
export function child1(prototype: ParentThing) {
|
|
prototype.add = (a: number, b: number) => a + b;
|
|
}
|
|
|
|
//// [parent.ts]
|
|
import { child1 } from './child1'; // this import should still exist in some form in the output, since it augments this module
|
|
|
|
export class ParentThing implements ParentThing {}
|
|
|
|
child1(ParentThing.prototype);
|
|
|
|
//// [parent.js]
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.ParentThing = void 0;
|
|
const child1_1 = require("./child1"); // this import should still exist in some form in the output, since it augments this module
|
|
class ParentThing {
|
|
}
|
|
exports.ParentThing = ParentThing;
|
|
(0, child1_1.child1)(ParentThing.prototype);
|
|
//// [child1.js]
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.child1 = child1;
|
|
function child1(prototype) {
|
|
prototype.add = (a, b) => a + b;
|
|
}
|
|
|
|
|
|
//// [parent.d.ts]
|
|
import './child1';
|
|
export declare class ParentThing implements ParentThing {
|
|
}
|
|
//// [child1.d.ts]
|
|
import { ParentThing } from './parent';
|
|
declare module './parent' {
|
|
interface ParentThing {
|
|
add: (a: number, b: number) => number;
|
|
}
|
|
}
|
|
export declare function child1(prototype: ParentThing): void;
|