π Search Terms
transpile declaration api emit missing import
π Version & Regression Information
β― Playground Link
https://github.com/MichaelMitchell-at/transpile_declaration_bug_repro/tree/bug2
π» Code
// @strict: true
// @declaration: true
// @showEmit
// @showEmittedFile: a.d.ts
// @showEmittedFile: b.d.ts
// @filename: a.ts
export interface Type {}
// @filename: b.ts
import { type Type } from "./a";
export const foo = (_: Type): void => {};
export const bar = (_: import("./a").Type): void => {};
Workbench Repro
π Actual behavior
Refer to this program which invokes the ts.transpileDeclaration API:
https://github.com/MichaelMitchell-at/transpile_declaration_bug_repro/blob/bug2/transpile.mjs
Basic instructions to invoke it can be found in
https://github.com/MichaelMitchell-at/transpile_declaration_bug_repro/blob/bug2/README.md
When using the API, b.d.ts is emitted as
export declare const foo: (_: Type) => void;
export declare const bar: (_: any) => void;
while when using tsc it gets emitted as
import { type Type } from "./a";
export declare const foo: (_: Type) => void;
export declare const bar: (_: import("./a").Type) => void;
π Expected behavior
Using the API should emit
import { type Type } from "./a";
export declare const foo: (_: Type) => void;
export declare const bar: (_: import("./a").Type) => void;
Additional information about the issue
π Search Terms
transpile declaration api emit missing import
π Version & Regression Information
transpileDeclarationAPI methodΒ #58261 @weswighamβ― Playground Link
https://github.com/MichaelMitchell-at/transpile_declaration_bug_repro/tree/bug2
π» Code
Workbench Repro
π Actual behavior
Refer to this program which invokes the
ts.transpileDeclarationAPI:https://github.com/MichaelMitchell-at/transpile_declaration_bug_repro/blob/bug2/transpile.mjs
Basic instructions to invoke it can be found in
https://github.com/MichaelMitchell-at/transpile_declaration_bug_repro/blob/bug2/README.md
When using the API,
b.d.tsis emitted aswhile when using
tscit gets emitted asπ Expected behavior
Using the API should emit
Additional information about the issue