@@ -141458,8 +141458,9 @@ interface Symbol {
141458
141458
readonly [Symbol.toStringTag]: string;
141459
141459
}`;
141460
141460
var barebonesLibName = "lib.d.ts";
141461
- var barebonesLibSourceFile = createSourceFile(barebonesLibName, barebonesLibContent, { languageVersion: 99 /* Latest */ }) ;
141461
+ var barebonesLibSourceFile;
141462
141462
function transpileWorker(input, transpileOptions, declaration) {
141463
+ barebonesLibSourceFile ?? (barebonesLibSourceFile = createSourceFile(barebonesLibName, barebonesLibContent, { languageVersion: 99 /* Latest */ }));
141463
141464
const diagnostics = [];
141464
141465
const options = transpileOptions.compilerOptions ? fixupCompilerOptions(transpileOptions.compilerOptions, diagnostics) : {};
141465
141466
const defaultOptions = getDefaultCompilerOptions2();
@@ -143929,7 +143930,7 @@ function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PUR
143929
143930
const unusedImportsFromOldFile = /* @__PURE__ */ new Set();
143930
143931
for (const statement of toMove) {
143931
143932
forEachReference(statement, checker, (symbol, isValidTypeOnlyUseSite) => {
143932
- if (!symbol.declarations) {
143933
+ if (!symbol.declarations || isGlobalType(checker, symbol) ) {
143933
143934
return;
143934
143935
}
143935
143936
if (existingTargetLocals.has(skipAlias(symbol, checker))) {
@@ -143979,6 +143980,16 @@ function getUsageInfo(oldFile, toMove, checker, existingTargetLocals = /* @__PUR
143979
143980
return !!jsxNamespaceSymbol2 && some(jsxNamespaceSymbol2.declarations, isInImport) ? jsxNamespaceSymbol2 : void 0;
143980
143981
}
143981
143982
}
143983
+ function isGlobalType(checker, symbol) {
143984
+ return !!checker.resolveName(
143985
+ symbol.name,
143986
+ /*location*/
143987
+ void 0,
143988
+ 788968 /* Type */,
143989
+ /*excludeGlobals*/
143990
+ false
143991
+ );
143992
+ }
143982
143993
function makeUniqueFilename(proposedFilename, extension, inDirectory, host) {
143983
143994
let newFilename = proposedFilename;
143984
143995
for (let i = 1; ; i++) {
0 commit comments