fix(typescript): add missing `qualifier` and `typeof` in TSImportType (#4438)
parent
c6e7c1966e
commit
76a5f3c7b6
|
@ -2881,7 +2881,13 @@ function printPathNoParens(path, options, print, args) {
|
||||||
case "TSThisType":
|
case "TSThisType":
|
||||||
return "this";
|
return "this";
|
||||||
case "TSLastTypeNode": // TSImportType
|
case "TSLastTypeNode": // TSImportType
|
||||||
return concat(["import(", path.call(print, "argument"), ")"]);
|
return concat([
|
||||||
|
!n.isTypeOf ? "" : "typeof ",
|
||||||
|
"import(",
|
||||||
|
path.call(print, "argument"),
|
||||||
|
")",
|
||||||
|
!n.qualifier ? "" : concat([".", path.call(print, "qualifier")])
|
||||||
|
]);
|
||||||
case "TSLiteralType":
|
case "TSLiteralType":
|
||||||
return path.call(print, "literal");
|
return path.call(print, "literal");
|
||||||
case "TSIndexedAccessType":
|
case "TSIndexedAccessType":
|
||||||
|
|
|
@ -15,9 +15,9 @@ export let shim: typeof import("./foo2") = {
|
||||||
|
|
||||||
export const x: import("./foo") = { x: 0, y: 0 };
|
export const x: import("./foo") = { x: 0, y: 0 };
|
||||||
|
|
||||||
export let y: import("./foo2") = { a: "", b: 0 };
|
export let y: import("./foo2").Bar.I = { a: "", b: 0 };
|
||||||
|
|
||||||
export let shim: import("./foo2") = {
|
export let shim: typeof import("./foo2") = {
|
||||||
Bar: Bar2
|
Bar: Bar2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -38,9 +38,9 @@ export let shim: typeof import("./foo2") = {
|
||||||
|
|
||||||
export const x: import('./foo') = { x: 0, y: 0 };
|
export const x: import('./foo') = { x: 0, y: 0 };
|
||||||
|
|
||||||
export let y: import('./foo2') = { a: '', b: 0 };
|
export let y: import('./foo2').Bar.I = { a: '', b: 0 };
|
||||||
|
|
||||||
export let shim: import('./foo2') = {
|
export let shim: typeof import('./foo2') = {
|
||||||
Bar: Bar2
|
Bar: Bar2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue