Skip to content

Commit e4f8c37

Browse files
authored
Add tests for importing types from .d.ts with explicit extension (#53890)
1 parent 3d3b2c7 commit e4f8c37

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// @allowImportingTsExtensions: true,false
2+
// @noEmit: true
3+
// @moduleResolution: classic,node10,node16,nodenext
4+
// @noTypesAndSymbols: true
5+
6+
// @Filename: /types.d.ts
7+
export declare type User = {
8+
name: string;
9+
}
10+
11+
// @Filename: /a.ts
12+
import type { User } from "./types.d.ts";
13+
export type { User } from "./types.d.ts";
14+
15+
export const user: User = { name: "John" };
16+
17+
export function getUser(): import("./types.d.ts").User {
18+
return user;
19+
}

0 commit comments

Comments
 (0)